BsoBird commented on code in PR #3805: URL: https://github.com/apache/paimon/pull/3805#discussion_r1689172657
########## paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java: ########## @@ -956,46 +986,46 @@ public boolean tryCommitOnce( // case !fileIO.exists(newSnapshotPath) && callable.call()); } else { + if (useSerializableIsolation) { + checkBeforeCommit(newSnapshotId); + } success = callable.call(); + if (useSerializableIsolation && success) { + checkAfterCommit(newSnapshotId); + } } - } catch (Throwable e) { + } catch (CommitStateUnknownException e) { // exception when performing the atomic rename, // we cannot clean up because we can't determine the success - throw new RuntimeException( - String.format( - "Exception occurs when committing snapshot #%d (path %s) by user %s " - + "with identifier %s and kind %s. " - + "Cannot clean up because we can't determine the success.", - newSnapshotId, - newSnapshotPath, - commitUser, - identifier, - commitKind.name()), - e); + throw e; + } catch (DirtyCommitException e) { + // We need to clean up all the metadata information generated by this commit. + cleanUpTmpManifests( Review Comment: Maybe cleaning up dirty commits will interfere with the creation of branch/tag. But since we are always cleaning up snapshots that exceed `snapshot.num-retained.max`.This shouldn't have much of an impact. After all, if we keep a snapshot that matches the characteristics of a dirty commit, we may never find the right time to delete it. -- 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-unsubscr...@paimon.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org