You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2022/05/17 16:44:37 UTC

[iceberg] branch 0.13.x updated: Core: Fix table corruption from OOM during commit cleanup (#4673) (#4779)

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

blue pushed a commit to branch 0.13.x
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/0.13.x by this push:
     new ffaf6038f Core: Fix table corruption from OOM during commit cleanup (#4673) (#4779)
ffaf6038f is described below

commit ffaf6038f461eaac6293c10ea02040a87eaafe96
Author: Eduard Tudenhöfner <et...@gmail.com>
AuthorDate: Tue May 17 18:44:31 2022 +0200

    Core: Fix table corruption from OOM during commit cleanup (#4673) (#4779)
    
    Co-authored-by: Ryan Blue <bl...@apache.org>
---
 .../src/main/java/org/apache/iceberg/SnapshotProducer.java | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/core/src/main/java/org/apache/iceberg/SnapshotProducer.java b/core/src/main/java/org/apache/iceberg/SnapshotProducer.java
index f6b3a2d03..b5984772c 100644
--- a/core/src/main/java/org/apache/iceberg/SnapshotProducer.java
+++ b/core/src/main/java/org/apache/iceberg/SnapshotProducer.java
@@ -310,9 +310,9 @@ abstract class SnapshotProducer<ThisT> implements SnapshotUpdate<ThisT> {
       Exceptions.suppressAndThrow(e, this::cleanAll);
     }
 
-    LOG.info("Committed snapshot {} ({})", newSnapshotId.get(), getClass().getSimpleName());
-
     try {
+      LOG.info("Committed snapshot {} ({})", newSnapshotId.get(), getClass().getSimpleName());
+
       // at this point, the commit must have succeeded. after a refresh, the snapshot is loaded by
       // id in case another commit was added between this commit and the refresh.
       Snapshot saved = ops.refresh().snapshot(newSnapshotId.get());
@@ -330,11 +330,15 @@ abstract class SnapshotProducer<ThisT> implements SnapshotUpdate<ThisT> {
         LOG.warn("Failed to load committed snapshot, skipping manifest clean-up");
       }
 
-    } catch (RuntimeException e) {
-      LOG.warn("Failed to load committed table metadata, skipping manifest clean-up", e);
+    } catch (Throwable e) {
+      LOG.warn("Failed to load committed table metadata or during cleanup, skipping further cleanup", e);
     }
 
-    notifyListeners();
+    try {
+      notifyListeners();
+    } catch (Throwable e) {
+      LOG.warn("Failed to notify event listeners", e);
+    }
   }
 
   private void notifyListeners() {