Fix mark segment unused when overshadowed by zero replica segment#16181
Fix mark segment unused when overshadowed by zero replica segment#16181kfaraz merged 1 commit intoapache:masterfrom
Conversation
Could you please share when should a segment only on the brokers, but not on any of the historicals, overshadow segments? |
This could be possible for a broadcast segment that is missing from the historicals because of some intermittent issue. The logic regarding the brokers is pre-existing and is not being modified in this PR. Just to clarify, the segments being considered here are already overshadowed. We are not changing their overshadowed status in any way. |
AmatyaAvadhanula
left a comment
There was a problem hiding this comment.
Thank you @kfaraz! LGTM
|
Thanks a lot for the prompt review, @AmatyaAvadhanula , @adarshsanjeev ! |
| if (DateTimes.nowUtc().isBefore(coordinatorStartTime.plus(delayMillis))) { | ||
| log.info( | ||
| "Skipping MarkAsUnused until [%s] have elapsed after coordinator start [%s].", | ||
| "Skipping MarkAsUnused until [%s] have elapsed after coordinator start time[%s].", |
There was a problem hiding this comment.
| "Skipping MarkAsUnused until [%s] have elapsed after coordinator start time[%s].", | |
| "Skipping MarkAsUnused until [%s] have elapsed after coordinator start time [%s] ms.", |
There was a problem hiding this comment.
Sorry, @cryptoe , I saw your comment after the PR was merged. I will try to include this refactor in a later PR.
Bug
In the
MarkOvershadowedSegmentsAsUnusedduty, the coordinator marks a segment as unusedif 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.
Changes
Release note
Fix bug in the
MarkOvershadowedSegmentsAsUnusedcoordinator duty to also consider segments that are overshadowed by a segment that requires zero replicas.This PR has: