jojochuang opened a new pull request, #12240:
URL: https://github.com/apache/ozone/pull/12240

   ## What changes were proposed in this pull request?
   
   Snapshot defrag assumed `pathPreviousSnapshotId` on `SnapshotInfo` always 
referred to a snapshot that `getActiveSnapshot` could still open. After a large 
purge, that pointer can remain on a **deleted** predecessor until 
`SnapshotDeletingService` rewrites the chain one step at a time. The first 
active snapshot after the deleted range then fails every defrag interval with 
`FILE_NOT_FOUND` / "no longer active", while later snapshots in the path keep 
defragging.
   
   This change walks `pathPreviousSnapshotId` along stored metadata until an 
**ACTIVE** snapshot is found (or there is no path-previous, in which case full 
defrag runs). Incremental defrag and the checkpoint base use that resolved 
predecessor.
   
   Cloudera tracking: CDPD-129719.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-18010
   
   Epic: https://issues.apache.org/jira/browse/HDDS-17671 (Ozone Snapshot Phase 
6)
   
   ## How was this patch tested?
   
   - `mvn -pl :ozone-manager test 
-Dtest=TestSnapshotDefragService#testCheckAndDefragUsesActivePathPreviousWhenImmediatePreviousIsDeleted
 -DskipShade -DskipRecon -DskipDocs`
   - Verified on `asf/master`: test **fails** with production fix reverted; 
**passes** with fix present.
   
   Generated-by: Cursor (Auto)
   
   Made with [Cursor](https://cursor.com)


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