Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Fix negation in requireStrictCleanup #8675

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/main/java/org/apache/iceberg/BaseTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Contributor

@aokolnychyi aokolnychyi Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, isn't the existing logic correct? We should not clean up in strict mode unless it is CleanableFailure? Is there a chance the test in Trino produced a commit error that we treat as unknown or unsafe to clean up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the one that failed in Trino was testing SchemaNotFoundException here.

if (ops.requireStrictCleanup() || e instanceof CleanableFailure) {
cleanAllUpdates();
}

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down
Loading