Skip to content

Commit fb231c4

Browse files
committed
fix: align Transaction::Apply() with Java BaseTransaction behavior
Match Java's BaseTransaction where hasLastOpCommitted tracks whether PendingUpdate.commit() was called, not Transaction.commitTransaction(). Key changes: - Remove last_update_committed_ reversion on Transaction::Commit() failure - The flag tracks PendingUpdate state (updates applied to metadata_builder_) - Transaction persistence to catalog is a separate concern This aligns with Java BaseTransaction.TransactionTableOperations.commit() at line 645 which sets hasLastOpCommitted=true and never reverts it based on transaction commit results.
1 parent 17c03f1 commit fb231c4

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/iceberg/transaction.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ Status Transaction::Apply(std::vector<std::unique_ptr<TableUpdate>> updates) {
7070
if (auto_commit_) {
7171
auto result = Commit();
7272
if (!result.has_value()) {
73-
// Commit failed, revert the flag
74-
last_update_committed_ = false;
7573
return std::unexpected(result.error());
7674
}
7775
}

0 commit comments

Comments
 (0)