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

JingsongLi 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 0e9dc51701 [core][iceberg] Include table name in commit/Iceberg-commit 
exception (#9391)
0e9dc51701 is described below

commit 0e9dc517016b2bcde94804e6a264d854878df7a8
Author: Oleksandr Nitavskyi <[email protected]>
AuthorDate: Wed Aug 26 10:21:23 2026 +0200

    [core][iceberg] Include table name in commit/Iceberg-commit exception 
(#9391)
---
 .../paimon/iceberg/IcebergCommitCallback.java      |  2 ++
 .../paimon/operation/FileStoreCommitImpl.java      | 25 ++++++++++++++--------
 .../iceberg/IcebergHiveMetadataCommitter.java      | 10 ++++++++-
 .../iceberg/IcebergRestMetadataCommitter.java      | 14 ++++++++----
 4 files changed, 37 insertions(+), 14 deletions(-)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/iceberg/IcebergCommitCallback.java
 
b/paimon-core/src/main/java/org/apache/paimon/iceberg/IcebergCommitCallback.java
index 3f4532639f..bb44905625 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/iceberg/IcebergCommitCallback.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/iceberg/IcebergCommitCallback.java
@@ -294,6 +294,8 @@ public class IcebergCommitCallback implements 
CommitCallback, TagCallback {
                                                         + commitUser
                                                         + " and identifier "
                                                         + 
committable.identifier()
+                                                        + " for table "
+                                                        + table.name()
                                                         + ". This is 
unexpected."));
         long snapshotId = snapshot.id();
         createMetadata(
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 02ce5dc05d..cd4919b9ce 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
@@ -866,8 +866,8 @@ public class FileStoreCommitImpl implements FileStoreCommit 
{
                     || retryCount >= options.commitMaxRetries()) {
                 String message =
                         String.format(
-                                "Commit failed after %s millis with %s 
retries, there maybe exist commit conflicts between multiple jobs.",
-                                options.commitTimeout(), retryCount);
+                                "Commit failed for table %s after %s millis 
with %s retries, there maybe exist commit conflicts between multiple jobs.",
+                                tableName, options.commitTimeout(), 
retryCount);
                 throw new RuntimeException(message, retryResult.exception);
             }
 
@@ -1250,9 +1250,9 @@ public class FileStoreCommitImpl implements 
FileStoreCommit {
                     baseManifestList, mergeBeforeManifests, 
mergeAfterManifests);
             throw new RuntimeException(
                     String.format(
-                            "Exception occurs when preparing snapshot #%d by 
user %s "
+                            "Exception occurs when preparing snapshot #%d for 
table %s by user %s "
                                     + "with hash %s and kind %s. Clean up.",
-                            newSnapshotId, commitUser, identifier, 
commitKind.name()),
+                            newSnapshotId, tableName, commitUser, identifier, 
commitKind.name()),
                     e);
         }
 
@@ -1266,17 +1266,23 @@ public class FileStoreCommitImpl implements 
FileStoreCommit {
             success = commitSnapshotImpl(latestSnapshot, newSnapshot, 
deltaStatistics);
         } catch (Exception e) {
             // commit exception, not sure about the situation and should not 
clean up the files
-            LOG.warn("Retry commit for exception.", e);
+            LOG.warn(
+                    "Retry commit for exception when committing snapshot #{} 
for table {} by user {}.",
+                    newSnapshotId,
+                    tableName,
+                    commitUser,
+                    e);
             return RetryCommitResult.forCommitFail(latestSnapshot, 
baseDataFiles, e, null);
         }
 
         if (!success) {
             long commitTime = (System.currentTimeMillis() - startMillis) / 
1000;
             LOG.warn(
-                    "Atomic commit failed for snapshot #{} by user {} "
+                    "Atomic commit failed for snapshot #{} for table {} by 
user {} "
                             + "with identifier {} and kind {} after {} 
seconds. "
                             + "Skip clean up and try again.",
                     newSnapshotId,
+                    tableName,
                     commitUser,
                     identifier,
                     commitKind.name(),
@@ -1572,8 +1578,8 @@ public class FileStoreCommitImpl implements 
FileStoreCommit {
                     || retryCount >= options.commitMaxRetries()) {
                 throw new RuntimeException(
                         String.format(
-                                "Commit failed after %s millis with %s 
retries, there maybe exist commit conflicts between multiple jobs.",
-                                options.commitTimeout(), retryCount));
+                                "Commit failed for table %s after %s millis 
with %s retries, there maybe exist commit conflicts between multiple jobs.",
+                                tableName, options.commitTimeout(), 
retryCount));
             }
 
             retryWaiter.retryWait(retryCount);
@@ -1670,10 +1676,11 @@ public class FileStoreCommitImpl implements 
FileStoreCommit {
             // we cannot clean up because we can't determine the success
             throw new RuntimeException(
                     String.format(
-                            "Exception occurs when committing snapshot #%d by 
user %s "
+                            "Exception occurs when committing snapshot #%d for 
table %s by user %s "
                                     + "with identifier %s and kind %s. "
                                     + "Cannot clean up because we can't 
determine the success.",
                             newSnapshot.id(),
+                            tableName,
                             newSnapshot.commitUser(),
                             newSnapshot.commitIdentifier(),
                             newSnapshot.commitKind().name()),
diff --git 
a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/iceberg/IcebergHiveMetadataCommitter.java
 
b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/iceberg/IcebergHiveMetadataCommitter.java
index ad99382574..d46f485b68 100644
--- 
a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/iceberg/IcebergHiveMetadataCommitter.java
+++ 
b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/iceberg/IcebergHiveMetadataCommitter.java
@@ -128,7 +128,15 @@ public class IcebergHiveMetadataCommitter implements 
IcebergMetadataCommitter {
         try {
             commitMetadataImpl(newMetadataPath, baseMetadataPath);
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw new RuntimeException(
+                    "Fail to commit iceberg metadata to hive metastore for 
table: "
+                            + icebergDatabases
+                            + "."
+                            + icebergTableName
+                            + " (paimon table: "
+                            + table.name()
+                            + ")",
+                    e);
         }
     }
 
diff --git 
a/paimon-iceberg/src/main/java/org/apache/paimon/iceberg/IcebergRestMetadataCommitter.java
 
b/paimon-iceberg/src/main/java/org/apache/paimon/iceberg/IcebergRestMetadataCommitter.java
index adeec647f1..1115624788 100644
--- 
a/paimon-iceberg/src/main/java/org/apache/paimon/iceberg/IcebergRestMetadataCommitter.java
+++ 
b/paimon-iceberg/src/main/java/org/apache/paimon/iceberg/IcebergRestMetadataCommitter.java
@@ -121,7 +121,9 @@ public class IcebergRestMetadataCommitter implements 
IcebergMetadataCommitter {
 
             this.restCatalog = initRestCatalog(restConfigs, hadoopConf);
         } catch (Exception e) {
-            throw new RuntimeException("Fail to initialize iceberg rest 
catalog.", e);
+            throw new RuntimeException(
+                    "Fail to initialize iceberg rest catalog for table: " + 
icebergTableIdentifier,
+                    e);
         }
     }
 
@@ -141,7 +143,8 @@ public class IcebergRestMetadataCommitter implements 
IcebergMetadataCommitter {
         try {
             commitMetadataImpl(newIcebergMetadata, baseIcebergMetadata);
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw new RuntimeException(
+                    "Fail to commit iceberg metadata for table: " + 
icebergTableIdentifier, e);
         }
     }
 
@@ -252,7 +255,9 @@ public class IcebergRestMetadataCommitter implements 
IcebergMetadataCommitter {
                     .operations()
                     .commit(((BaseTable) icebergTable).operations().current(), 
updatedForCommit);
         } catch (Exception e) {
-            throw new RuntimeException("Fail to commit metadata to rest 
catalog.", e);
+            throw new RuntimeException(
+                    "Fail to commit metadata to rest catalog for table: " + 
icebergTableIdentifier,
+                    e);
         }
     }
 
@@ -609,7 +614,8 @@ public class IcebergRestMetadataCommitter implements 
IcebergMetadataCommitter {
             dropTable();
             return createTable(newMetadata);
         } catch (Exception e) {
-            throw new RuntimeException("Fail to recreate iceberg table.", e);
+            throw new RuntimeException(
+                    "Fail to recreate iceberg table: " + 
icebergTableIdentifier, e);
         }
     }
 

Reply via email to