Skip to content

Add isBeingDeleted marker on SegmentZKMetadata#18369

Open
krishan1390 wants to merge 2 commits intoapache:masterfrom
krishan1390:segment_delete_flag
Open

Add isBeingDeleted marker on SegmentZKMetadata#18369
krishan1390 wants to merge 2 commits intoapache:masterfrom
krishan1390:segment_delete_flag

Conversation

@krishan1390
Copy link
Copy Markdown
Contributor

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.

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.
Comment thread pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java Outdated
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-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.46%. Comparing base (05de2a8) to head (4d2c484).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ntroller/helix/core/PinotHelixResourceManager.java 83.33% 1 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (?)
java-21 63.46% <89.47%> (+0.01%) ⬆️
temurin 63.46% <89.47%> (+0.01%) ⬆️
unittests 63.46% <89.47%> (+0.01%) ⬆️
unittests1 55.39% <71.42%> (+0.02%) ⬆️
unittests2 35.01% <78.94%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants