krishan1390 opened a new pull request, #18678:
URL: https://github.com/apache/pinot/pull/18678

   ## Description
   
   Refactors the controller deep-store segment deletion code path for clarity 
and correctness.
   
   ### `SegmentDeletionManager`
   - Breaks the monolithic `deleteSegmentFromPropertyStoreAndLocal` into small, 
focused, overridable methods:
     - `filterSegmentsToDelete` — determines which segments are absent from 
both ExternalView and IdealState (returns `null` when Helix state is 
unavailable so the whole batch is skipped).
     - `deleteSegmentsFromPropertyStore` — removes the property-store znodes 
and returns the set of segments that were *actually* deleted.
     - `rescheduleRetry` — reschedules the segments that could not be deleted 
this pass with the existing exponential back-off.
   - Deep-store removal now operates on the set of segments whose ZK metadata 
was successfully removed, rather than on the optimistic to-delete list. This 
avoids removing deep-store files for segments whose property-store deletion 
failed and will be retried.
   - `removeSegmentsFromStoreInBatch` now accepts a `Collection<String>` 
instead of `List<String>`.
   
   ### `PinotHelixResourceManager`
   - Extracts construction of the `SegmentDeletionManager` into an overridable 
`createSegmentDeletionManager` factory method.
   
   ### `RetentionManager`
   - Extracts segment-name collection into `getSegmentNames` helpers, removing 
duplicated stream-collect logic in the hybrid vs. non-hybrid branches.
   
   No behavioral change to retention semantics; this is a structural refactor 
that also makes the deletion ordering safer.
   
   ## Upgrade Notes
   None. No config, API, or wire-format changes.
   
   ## Testing
   Existing `SegmentDeletionManagerTest` updated for the signature change and 
continues to pass.
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to