a proper abortTransaction() call seems better, as it could make explicit that after its invocation commit() shall fail with CommitFailedException. cleanUpOnCommitFailure() doesn't actually do that, does it?
On Fri, 20 Feb 2026 at 13:47, Péter Váry <[email protected]> wrote: > Hi Team, > > I was recently contacted by Denis from the Hive project. Their team is > implementing multi‑table transactions guarded by Hive locks. When they fail > to acquire locks for all tables so the transaction ultimately fails, they > want to revert the individual partial changes. Today this cleanup is > handled by `BaseTransaction.cleanUpOnCommitFailure`. > > They asked whether we could make this method protected [1], so classes > extending BaseTransaction could invoke it and remove unused files. > > While this would be a quick and simple fix for their use case, it feels > more natural to expose a new `Transaction.abortTransaction()` method on the > public Transaction API. That way, cleanup would be performed explicitly > when a user chooses to roll back rather than commit. > > What do you think? > > Thanks, > Peter > > [1] - https://github.com/apache/iceberg/issues/15377 >
