Skip to content

Commit 3d7cd57

Browse files
davesharpe13hackorum
authored andcommitted
Fix CommitTransactionCommand() to CallXactCallbacks() in TBLOCK_ABORT_END
1 parent bf80a4c commit 3d7cd57

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • src/backend/access/transam

src/backend/access/transam/xact.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3304,10 +3304,15 @@ CommitTransactionCommandInternal(void)
33043304

33053305
/*
33063306
* Here we were in an aborted transaction block and we just got
3307-
* the ROLLBACK command from the user, so clean up the
3307+
* the ROLLBACK command from the user, so first return blockState
3308+
* to TBLOCK_ABORT in case of callXactCallbacks() failure, run any
3309+
* callback and restore blockState on success. Now clean up the
33083310
* already-aborted transaction and return to the idle state.
33093311
*/
33103312
case TBLOCK_ABORT_END:
3313+
s->blockState = TBLOCK_ABORT;
3314+
CallXactCallbacks(XACT_EVENT_ABORT);
3315+
s->blockState = TBLOCK_ABORT_END;
33113316
CleanupTransaction();
33123317
s->blockState = TBLOCK_DEFAULT;
33133318
if (s->chain)

0 commit comments

Comments
 (0)