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

   ## What
   
   When the retention manager cleans up a zombie `IN_PROGRESS` or `REVERTED`
   segment-lineage entry whose destination segments are no longer in the ideal
   state, it removed the lineage entry but left the destination segments' ZK
   metadata behind in the property store.
   
   This can happen, for example, when the controller crashes between writing the
   destination segment metadata and updating the ideal state — the orphan znodes
   are then never reclaimed.
   
   ## Change
   
   `DefaultLineageManager.updateLineageForRetention` now schedules the entry's
   `segmentsTo` for deletion when it reaps such an entry, so the orphan znodes 
are
   cleaned up together with the lineage entry.
   
   This is safe:
   - The branch only triggers when none of the destination segments are in the
     ideal state, so no queryable segment is touched.
   - Segment names with no znode are a no-op in the deletion path.
   - Deletion re-checks the ideal state / external view, so a destination that a
     late-finishing replace concurrently re-adds is handled correctly.
   
   ## Testing
   
   Extended `SegmentLineageCleanupTest` to plant an orphan destination znode 
that
   never reached the ideal state and assert it is reaped when the zombie entry 
is
   cleaned up. `DefaultLineageManagerTest` and `SegmentLineageCleanupTest` pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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