File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
paimon-core/src/main/java/org/apache/paimon/operation Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -886,6 +886,22 @@ CommitResult tryCommitOnce(
886886 ConflictCheck conflictCheck ,
887887 @ Nullable String newStatsFileName ) {
888888 long startMillis = System .currentTimeMillis ();
889+
890+ // Check if the commit has been completed. At this point, there will be no more repeated
891+ // commits and just return success
892+ if (retryResult != null && latestSnapshot != null ) {
893+ long lastLatestSnapshot = Snapshot .FIRST_SNAPSHOT_ID ;
894+ if (retryResult .latestSnapshot != null ) {
895+ lastLatestSnapshot = retryResult .latestSnapshot .id ();
896+ }
897+ for (long i = lastLatestSnapshot + 1 ; i <= latestSnapshot .id (); i ++) {
898+ Snapshot snapshot = snapshotManager .snapshot (i );
899+ if (snapshot .commitUser ().equals (commitUser )
900+ && snapshot .commitIdentifier () == identifier ) {
901+ return new SuccessResult ();
902+ }
903+ }
904+ }
889905 long newSnapshotId =
890906 latestSnapshot == null ? Snapshot .FIRST_SNAPSHOT_ID : latestSnapshot .id () + 1 ;
891907
You can’t perform that action at this time.
0 commit comments