This is an automated email from the ASF dual-hosted git repository.

czweng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a22bd3c48 [core] Add Check for retry commit (#5771)
2a22bd3c48 is described below

commit 2a22bd3c485cddf3237e1599426f53d3ab007d54
Author: Jingsong Lee <[email protected]>
AuthorDate: Wed Jun 18 17:55:44 2025 +0800

    [core] Add Check for retry commit (#5771)
---
 .../org/apache/paimon/operation/FileStoreCommitImpl.java | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
 
b/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
index 37aac44bb2..2e364d6677 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
@@ -886,6 +886,22 @@ public class FileStoreCommitImpl implements 
FileStoreCommit {
             ConflictCheck conflictCheck,
             @Nullable String newStatsFileName) {
         long startMillis = System.currentTimeMillis();
+
+        // Check if the commit has been completed. At this point, there will 
be no more repeated
+        // commits and just return success
+        if (retryResult != null && latestSnapshot != null) {
+            long startCheckSnapshot = Snapshot.FIRST_SNAPSHOT_ID;
+            if (retryResult.latestSnapshot != null) {
+                startCheckSnapshot = retryResult.latestSnapshot.id() + 1;
+            }
+            for (long i = startCheckSnapshot; i <= latestSnapshot.id(); i++) {
+                Snapshot snapshot = snapshotManager.snapshot(i);
+                if (snapshot.commitUser().equals(commitUser)
+                        && snapshot.commitIdentifier() == identifier) {
+                    return new SuccessResult();
+                }
+            }
+        }
         long newSnapshotId =
                 latestSnapshot == null ? Snapshot.FIRST_SNAPSHOT_ID : 
latestSnapshot.id() + 1;
 

Reply via email to