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

Throw TrinoException when Iceberg commit fails #23312

Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ private static void commitUpdateAndTransaction(SnapshotUpdate<?> update, Connect
commit(update, session);
commitTransaction(transaction, operation);
}
catch (UncheckedIOException e) {
catch (UncheckedIOException | ValidationException e) {
throw new TrinoException(ICEBERG_COMMIT_ERROR, format("Failed to commit during %s: %s", operation, firstNonNull(e.getMessage(), e)), e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ public void testDeleteRowsConcurrently()
ExecutorService executor = newFixedThreadPool(threads);
List<String> rows = ImmutableList.of("(1, 0, 0, 0)", "(0, 1, 0, 0)", "(0, 0, 1, 0)", "(0, 0, 0, 1)");

String[] expectedErrors = new String[] {"Failed to commit the transaction during write:", "Failed to replace table due to concurrent updates:"};
String[] expectedErrors = new String[] {"Failed to commit the transaction during write:",
"Failed to replace table due to concurrent updates:",
"Failed to commit during write:"};
try (TestTable table = new TestTable(
getQueryRunner()::execute,
"test_concurrent_delete",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ protected void verifyVersionedQueryFailurePermissible(Exception e)
@Override
protected void verifyConcurrentUpdateFailurePermissible(Exception e)
{
assertThat(e).hasMessageContaining("Failed to commit the transaction during write");
assertThat(e).hasMessageMatching("Failed to commit the transaction during write.*|" +
"Failed to commit during write.*");
}

@Override
Expand Down