j1wonpark opened a new pull request, #4169:
URL: https://github.com/apache/amoro/pull/4169

   ## Why are the changes needed?
   
   `IcebergTableMaintainer.expireFiles()` captures the snapshot ID *before*
   `DeleteFiles.commit()`, then passes it to 
`RewriteFiles.validateFromSnapshot()`.
   This means the ID refers to a snapshot that no longer reflects the table 
state
   after the delete commit.
   
   Currently this is benign: the only files passed to 
`RewriteFiles.deleteFile()`
   are `DeleteFile`s, so `BaseRewriteFiles.replacedDataFiles` stays empty and
   `validateNoNewDeletesForDataFiles()` — the sole consumer of 
`startingSnapshotId`
   — is never invoked. However, the stale ID is semantically incorrect and will
   become a real bug if `expireFiles()` is ever extended to replace data files, 
or
   if a future Iceberg version tightens validation on the rewrite path.
   
   ## Brief change log
   
   - Move `IcebergTableUtil.getSnapshotId()` call in `expireFiles()` from before
     `delete.commit()` to after it, so that `validateFromSnapshot()` always
     receives the post-delete snapshot.
   
   ## How was this patch tested?
   
   - [x] Run test locally before making a pull request
   
   ## Documentation
   
   - Does this pull request introduce a new feature? 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