Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty datasource schema on the Broker when metadata query is disabled #16645

Merged
merged 10 commits into from
Jun 28, 2024

Conversation

findingrish
Copy link
Contributor

@findingrish findingrish commented Jun 24, 2024

Parent issue: #14989

With the CentralizedDatasourceSchema feature, Broker polls datasource schema from the Coordinator.

Datasource schema could be temporarily empty on the Broker in the following scenario,

  • Metadata querying is disabled on the Broker.
  • New datasource is added.
  • Both Broker and Coordinator tries to build the datasource schema.
  • Broker builds empty datasource schema, since none of the segments has a schema on the Broker.
  • Schema on the Broker is correctly updated after poll from the Coordinator.

In the period between Broker building empty datasource schema and polling correct schema from the Coordinator, queries start to fail with column not found exception.

The fix is to avoid caching any datasource schema which is empty.

This PR also updates the datasource readiness check in the Standard ITs to ensure that the datasource schema is non-empty.

if (rowSignature.getColumnNames().isEmpty()) {
// this case could arise when metadata refresh is disabled on broker
// and a new datasource is added
log.info("datasource [%s] has empty signature.", dataSource);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.info("datasource [%s] has empty signature.", dataSource);
log.info("datasource [%s] schema has not been initialized yet. If this happens continuously, check coordinator logs ", dataSource);

// this case could arise when metadata refresh is disabled on broker
// and a new datasource is added
log.info("datasource [%s] has empty signature.", dataSource);
continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets do table.remove(ds) ?

@cryptoe cryptoe merged commit b9c7664 into apache:master Jun 28, 2024
87 of 88 checks passed
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants