leaves12138 commented on code in PR #8450:
URL: https://github.com/apache/paimon/pull/8450#discussion_r3520262843


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/RollbackToAsLatestProcedure.java:
##########
@@ -80,20 +84,39 @@ Row[] call(ProcedureContext procedureContext, String 
tableId, String tagName, Lo
         Preconditions.checkArgument(
                 hasTag != hasSnapshot, "Must specify exactly one of tag and 
snapshot_id.");
 
+        TagManager tagManager = store.newTagManager();
+        Tag targetTag;
         Snapshot targetSnapshot;
         if (hasTag) {

Review Comment:
   For the `tag` argument path we now use the user-provided tag directly and 
skip creating a dedicated rollback protection tag. This still leaves the new 
latest snapshot dependent on that tag's lifecycle. If the source tag has 
`timeRetained` and is expired by `TagTimeExpire`, or if the user deletes the 
tag after the target snapshot has been expired, `TagManager.deleteTag` can 
clean files from the tagged snapshot even though they are still referenced by 
the rollback-to-as-latest snapshot. The snapshot_id path avoids this by 
creating a non-expiring `rollback-to-as-latest-*` tag, but rollback by tag can 
still hit the same corruption scenario. Could we also create a dedicated 
non-expiring rollback tag for the `tag` path (or at least when the source tag 
is expiring), and clean it up on pre-commit/commit failure the same way as the 
snapshot_id path?



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