+1 on explicit abortTransaction. Just wondering if rollback might be a better name if we ever want to support savepoint in the future?
Qiegang On Fri, Feb 20, 2026, 8:48 AM 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 >
