Add isBeingDeleted marker on SegmentZKMetadata#18369
Open
krishan1390 wants to merge 2 commits intoapache:masterfrom
Open
Add isBeingDeleted marker on SegmentZKMetadata#18369krishan1390 wants to merge 2 commits intoapache:masterfrom
krishan1390 wants to merge 2 commits intoapache:masterfrom
Conversation
Introduce a `segment.is.being.deleted` simpleField on SegmentZKMetadata so concurrent operations can detect a segment that is mid-deletion (between Ideal State removal and segment znode deletion) and skip it. PinotHelixResourceManager.deleteSegments now sets the marker via a version-checked CAS write before removing the segment from the Ideal State. The marker is advisory; old controllers that ignore the field fall back to today's behavior. A new Stat-bearing ZKMetadataProvider.getSegmentZKMetadata overload exposes the znode version for the CAS write.
krishan1390
commented
Apr 29, 2026
Address PR review feedback: expand the Javadoc on the IS_BEING_DELETED
constant and on markSegmentsAsBeingDeleted to make clear the flag is a
hint about an unstable lifecycle ("being deleted or may be deleted in
the near future"), not a guarantee that the segment is or will be
deleted. Subsequent IS removal and znode/deep-store cleanup may still
fail or be retried later, so a flagged segment may remain present
transiently; absence of the flag is similarly not proof of liveness.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18369 +/- ##
============================================
+ Coverage 63.44% 63.46% +0.01%
Complexity 1683 1683
============================================
Files 3253 3253
Lines 198881 198900 +19
Branches 30797 30800 +3
============================================
+ Hits 126184 126230 +46
+ Misses 62631 62603 -28
- Partials 10066 10067 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a
segment.is.being.deletedsimpleField on SegmentZKMetadata so concurrent operations can detect a segment that is mid-deletion (between Ideal State removal and segment znode deletion) and skip it.PinotHelixResourceManager.deleteSegments now sets the marker via a version-checked CAS write before removing the segment from the Ideal State. The marker is advisory; old controllers that ignore the field fall back to today's behavior. A new Stat-bearing
ZKMetadataProvider.getSegmentZKMetadata overload exposes the znode version for the CAS write.