LuciferYang opened a new pull request, #10212:
URL: https://github.com/apache/paimon/pull/10212

   ### Purpose
   
   Three commit abort paths in `FileStoreCommitImpl` left the manifests and 
manifest lists they had just written as permanent orphans.
   
   A vetoing pre-commit callback (chain-table snapshot-branch drop validation, 
Iceberg pre-commit validation) aborts the commit after the base and delta 
manifest lists were written. A preparation failure already cleans these up with 
the commit cleaner; a callback veto now does the same before rethrowing. This 
applies to both the regular commit path and the `rollbackToAsLatest` variant.
   
   A CAS-lost `rollbackToAsLatest` has no retry loop, so its freshly written 
manifests and manifest lists stayed behind forever. They are now cleaned up on 
CAS failure.
   
   Each CAS-failed attempt of `compactManifestOnce` re-runs the full manifest 
merge and writes fresh manifests and manifest lists, so under concurrent 
writers the failed attempts piled up. The failed attempt's newly merged 
manifests and manifest lists are now deleted on CAS failure and the retry 
rewrites them. The cleanup only deletes files that were not part of 
`mergeBeforeManifests`, so manifests still referenced by the latest snapshot 
are preserved and no in-use file is removed.
   
   ### Tests
   
   `FileStoreCommitTest.testManifestCompactCleansUpFailedAttempt` forces the 
first compact attempt to lose the CAS race, then asserts every manifest file 
surviving the call is referenced by the resulting snapshot.
   
   `ChainTablePartitionExpireTest.testVetoedRollbackLeavesNoManifestOrphans` 
triggers a vetoed `rollbackToAsLatest` and asserts the manifest directory gains 
no new files after the aborted rollback.
   
   ### API and Format
   
   No.
   
   ### Documentation
   
   No.
   


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

Reply via email to