You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "xuzifu666 (via GitHub)" <gi...@apache.org> on 2024/10/24 14:45:30 UTC

[PR] Consumer procedure fix [paimon]

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

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   Linked issue: close #xxx
   Currently ResetConsumerProcedure not check for snapshot id, if user set a snapshot id which is large than the latest snapshot id (it would wait for a long time, and if small than earlist snapshot id is ok which would consumer from the latest snapshot id),this pr is aim to check it if set a not exisit large snapshot id.
   
   <!-- 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] Check snapshot when reset consumer [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #4373:
URL: https://github.com/apache/paimon/pull/4373


-- 
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] Check snapshot when reset consumer [paimon]

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


##########
paimon-flink/paimon-flink-1.18/src/main/java/org/apache/paimon/flink/procedure/ResetConsumerProcedure.java:
##########
@@ -49,6 +51,15 @@ public String[] call(
             throws Catalog.TableNotExistException {
         FileStoreTable fileStoreTable =
                 (FileStoreTable) catalog.getTable(Identifier.fromString(tableId));
+        SnapshotManager snapshotManager = fileStoreTable.snapshotManager();
+        Long latestSnapshotId = snapshotManager.latestSnapshotId();
+        if (latestSnapshotId != null && nextSnapshotId > latestSnapshotId) {
+            throw new SnapshotNotExistException(
+                    String.format(
+                            "the snapshot id is not exist, you can set it <= %s.",

Review Comment:
   The specified snapshot id %s should be smaller than the latest snapshot id %s.



-- 
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] Check snapshot when reset consumer [paimon]

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


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/ResetConsumerAction.java:
##########
@@ -49,6 +51,17 @@ public ResetConsumerAction withNextSnapshotIds(Long nextSnapshotId) {
     @Override
     public void run() throws Exception {
         FileStoreTable dataTable = (FileStoreTable) table;
+        SnapshotManager snapshotManager = dataTable.snapshotManager();
+        Long latestSnapshotId = snapshotManager.latestSnapshotId();
+        if (nextSnapshotId != null

Review Comment:
   Add a public static method, Otherwise, Otherwise, this check code would appear in three different places.



-- 
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] Check snapshot when reset consumer [paimon]

Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 closed pull request #4373: [core] Check snapshot when reset consumer
URL: https://github.com/apache/paimon/pull/4373


-- 
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] Check snapshot when reset consumer [paimon]

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


##########
paimon-flink/paimon-flink-1.18/src/main/java/org/apache/paimon/flink/procedure/ResetConsumerProcedure.java:
##########
@@ -49,6 +51,15 @@ public String[] call(
             throws Catalog.TableNotExistException {
         FileStoreTable fileStoreTable =
                 (FileStoreTable) catalog.getTable(Identifier.fromString(tableId));
+        SnapshotManager snapshotManager = fileStoreTable.snapshotManager();
+        Long latestSnapshotId = snapshotManager.latestSnapshotId();
+        if (latestSnapshotId != null && nextSnapshotId > latestSnapshotId) {

Review Comment:
   You can just read the snapshot.



##########
paimon-flink/paimon-flink-1.18/src/main/java/org/apache/paimon/flink/procedure/ResetConsumerProcedure.java:
##########
@@ -49,6 +51,15 @@ public String[] call(
             throws Catalog.TableNotExistException {
         FileStoreTable fileStoreTable =
                 (FileStoreTable) catalog.getTable(Identifier.fromString(tableId));
+        SnapshotManager snapshotManager = fileStoreTable.snapshotManager();

Review Comment:
   Do not copy codes 4 times.



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