From 359f22d34f061a559af6ea53c51602b2a6be5fc8 Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Thu, 28 Sep 2023 21:02:52 +0200 Subject: [PATCH] Core: Fix negation in requireStrictCleanup Found a regression that the snapshots are still around after the commit fails: https://github.com/trinodb/trino/pull/19188 After the fix, I checked locally, the test passes. --- core/src/main/java/org/apache/iceberg/BaseTransaction.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/apache/iceberg/BaseTransaction.java b/core/src/main/java/org/apache/iceberg/BaseTransaction.java index c1ebd554befa..09f4ff301c8c 100644 --- a/core/src/main/java/org/apache/iceberg/BaseTransaction.java +++ b/core/src/main/java/org/apache/iceberg/BaseTransaction.java @@ -320,7 +320,7 @@ private void commitCreateTransaction() { } catch (RuntimeException e) { // the commit failed and no files were committed. clean up each update - if (!ops.requireStrictCleanup() || e instanceof CleanableFailure) { + if (ops.requireStrictCleanup() || e instanceof CleanableFailure) { cleanAllUpdates(); } @@ -375,7 +375,7 @@ private void commitReplaceTransaction(boolean orCreate) { } catch (RuntimeException e) { // the commit failed and no files were committed. clean up each update. - if (!ops.requireStrictCleanup() || e instanceof CleanableFailure) { + if (ops.requireStrictCleanup() || e instanceof CleanableFailure) { cleanAllUpdates(); } @@ -423,7 +423,7 @@ private void commitSimpleTransaction() { cleanUpOnCommitFailure(); throw e.wrapped(); } catch (RuntimeException e) { - if (!ops.requireStrictCleanup() || e instanceof CleanableFailure) { + if (ops.requireStrictCleanup() || e instanceof CleanableFailure) { cleanUpOnCommitFailure(); }