clintropolis opened a new pull request #10660:
URL: https://github.com/apache/druid/pull/10660
### Description
This PR fixes an issue where tables with all of their segments dropped could
still incorrectly show up in the `INFORMATION_SCHEMA` tables when queries with
SQL. The underlying issue was caused by a race condition between
`DruidSchema.tables` being populated upon rebuilding the tables, segment
removal handlers removing segments from `tables` when no other segments were
left (but not `dataSourcesNeedingRebuild`), and
`DruidSchema.dataSourcesNeedingRebuild` not considering if the table had been
removed from `tables` due to all the segments being dropped in the time between
being added to the refresh list and actually doing the refresh.
The added an additional step to the `ITBroadcastJoinQueryTest` integration
test that would fail prior to the changes in `DruidSchema`, and chose this test
in particular to cover the most surface area since there are segments on both
the historical and the broker.
<hr>
This PR has:
- [x] been self-reviewed.
- [x] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [x] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [x] added integration tests.
- [x] been tested in a test Druid cluster.
<!-- Check the items by putting "x" in the brackets for the done things. Not
all of these items apply to every PR. Remove the items which are not done or
not relevant to the PR. None of the items from the checklist above are strictly
necessary, but it would be very helpful if you at least self-review the PR. -->
<hr>
##### Key changed/added classes in this PR
* `DruidSchema`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]