You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "askwang (via GitHub)" <gi...@apache.org> on 2024/11/06 09:46:15 UTC

[PR] [core] Fast return if rollback verion equals lastest version [paimon]

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

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   If the rollback snapshot version is equal to the lastest snapshot version, we should fast return.
   
   <!-- What is the purpose of the change -->
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core] Fast return if rollback verion equals lastest version [paimon]

Posted by "wwj6591812 (via GitHub)" <gi...@apache.org>.
wwj6591812 commented on PR #4467:
URL: https://github.com/apache/paimon/pull/4467#issuecomment-2461157368

   A question:
   Assuming that when the user executes the rollback procedure with snapshot = 1, the latestSnapshot Id of the Paimon table is 1, and before the rollback procedure ends, the latestSnapshot Id of the Paimon table changes to 2. After you apply this patch, in the end, the rollback procedure fast return so that the result is not snapshot = 1.
    Is this the result that the user wants?


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core] Fast return if rollback verion equals lastest version [paimon]

Posted by "wwj6591812 (via GitHub)" <gi...@apache.org>.
wwj6591812 commented on code in PR #4467:
URL: https://github.com/apache/paimon/pull/4467#discussion_r1831934781


##########
paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java:
##########
@@ -625,14 +630,19 @@ public void rollbackTo(String tagName) {
         checkArgument(tagManager.tagExists(tagName), "Rollback tag '%s' doesn't exist.", tagName);
 
         Snapshot taggedSnapshot = tagManager.taggedSnapshot(tagName);
+        SnapshotManager snapshotManager = snapshotManager();

Review Comment:
   Add a blank line.



##########
paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java:
##########
@@ -512,6 +512,11 @@ public void rollbackTo(long snapshotId) {
                 "Rollback snapshot '%s' doesn't exist.",
                 snapshotId);
 
+        // fast return
+        if (new Long(snapshotId).equals(snapshotManager.latestSnapshotId())) {

Review Comment:
   I think new Long has a little strange.
   Why not:
   
   Long latestSnapshotId = snapshotManager.latestSnapshotId();
   if (latestSnapshotId == null) {
       exception or error log
   }
   if (taggedSnapshot.id() == latestSnapshotId) {
       fast return
   }



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core] Fast return if rollback verion equals lastest version [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #4467:
URL: https://github.com/apache/paimon/pull/4467#issuecomment-2461482576

   > > Hi @askwang , what is this PR aims to? just for performance?
   > 
   > yes, juse fast return, no need to execute RollbackHelper#cleanLargerThan.
   
   Do we need to care about the speed of this operation? I think it should be very fast even no optimization.


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core] Fast return if rollback verion equals lastest version [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #4467:
URL: https://github.com/apache/paimon/pull/4467#issuecomment-2461271779

   Hi @askwang , what is this PR aims to? just for performance?


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core] Fast return if rollback verion equals lastest version [paimon]

Posted by "askwang (via GitHub)" <gi...@apache.org>.
askwang commented on PR #4467:
URL: https://github.com/apache/paimon/pull/4467#issuecomment-2461241352

   > A question: Assuming that when the user executes the rollback procedure with snapshot = 1, the latestSnapshot Id of the Paimon table is 1, and before the rollback procedure ends, the latestSnapshot Id of the Paimon table changes to 2. After you apply this patch, in the end, the rollback procedure fast return, so the RollbackHelper#cleanLargerThan will not be called. Is this the result that the user wants?
   
   In this case, the result is not what the user wants. But although there does not fast return, this case may also occur. For example, the rollback snapshot is 1 and the latest snapshot of table is also 1, before rollback ends the lastest snapshot of table changes to 2 or 3, the rollback logic gets the lastest shotshot is diffcult to keep always the newest, this will cause some new snapshots not to be processed.


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core] Fast return if rollback verion equals lastest version [paimon]

Posted by "askwang (via GitHub)" <gi...@apache.org>.
askwang closed pull request #4467: [core] Fast return if rollback verion equals lastest version
URL: https://github.com/apache/paimon/pull/4467


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core] Fast return if rollback verion equals lastest version [paimon]

Posted by "askwang (via GitHub)" <gi...@apache.org>.
askwang commented on PR #4467:
URL: https://github.com/apache/paimon/pull/4467#issuecomment-2461452235

   > Hi @askwang , what is this PR aims to? just for performance?
   
   yes, juse fast return, no need to execute RollbackHelper#cleanLargerThan.


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org