mirror of
https://github.com/apache/druid.git
synced 2025-02-28 14:29:17 +00:00
Bug: In the `MarkOvershadowedSegmentsAsUnused` duty, the coordinator marks a segment as unused if it is overshadowed by a segment currently being served by a historical or broker. But it is possible to have segments that are eligible for a load rule but require zero replicas to be loaded. (Such segments can be queried only using the MSQ engine). If such a zero-replica segment overshadows any other segment, the overshadowed segment will never be marked as unused and will continue to exist in the metadata store as a dangling segment. Fix: - In a coordinator run, keep track of segments that are eligible for a load rule but require zero replicas - Allow the zero-replicas segments to overshadow old segments and hence mark the latter as unused Other changes: - Add simulation test to verify new behaviour. This test fails with the current code. - Clean up javadocs