junmuz commented on code in PR #5228:
URL: https://github.com/apache/paimon/pull/5228#discussion_r1989173216
##########
paimon-core/src/main/java/org/apache/paimon/iceberg/IcebergCommitCallback.java:
##########
@@ -752,7 +752,25 @@ private void expireAllBefore(long snapshotId) throws
IOException {
}
table.fileIO().deleteQuietly(listPath);
}
- table.fileIO().deleteQuietly(path);
+ deleteApplicableMetadataFiles(snapshotId);
Review Comment:
Looking at the code, `createMetadataWithoutBase` would be invoked if
metadata file doesn't exist for the latest snapshot. This means whatever latest
Iceberg metadata file available would be referenced by the Iceberg readers. So
2 reasons for preserving.
1. Creating the new one and deleting old one quickly can cause some race
conditions for the readers.
2. Also, it would make it less consistent specially if someone disables
deletion of metadata file altogether with option `delete-after-commit.enabled`.
--
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]