JingsongLi commented on code in PR #8139:
URL: https://github.com/apache/paimon/pull/8139#discussion_r3446198531
##########
paimon-core/src/main/java/org/apache/paimon/table/sink/TableCommitImpl.java:
##########
@@ -203,6 +204,15 @@ public void compactManifests() {
commit.compactManifest();
}
+ public boolean restoreAsLatest(Snapshot targetSnapshot) {
+ checkCommitted();
+ boolean success = commit.restoreAsLatest(targetSnapshot);
+ if (success) {
+ maintain(COMMIT_IDENTIFIER, maintainExecutor, true);
Review Comment:
The restore-as-latest docs say this operation does not delete snapshots/tags
newer than the restored version, but this `true` still lets `maintain` run
snapshot expiration (and tag/partition expiration) immediately after the
restore. For a table configured with a low `snapshot.num-retained.max` such as
1, the new latest snapshot can cause `expireSnapshots.run()` to delete the
restored snapshot and the previous later snapshots right away. Please skip
automatic expiration for this path, or otherwise protect the restored/later
snapshots, so the procedure preserves the history it promises to keep.
--
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]