[13.x] Roll back transactions manager when commit fails

Merged
PA
9d ago
+37-0

Fixes #61964.

handleCommitTransactionException() decremented the connection's transaction level but never notified DatabaseTransactionsManager, so the failed root transaction stayed pending and afterCommit callbacks hung or ran twice on retry. It now calls rollback() on the manager, like the other paths that end a transaction.

Test: testFailedCommitRollsBackTheTransactionsManager (fails without the fix).