There was an error while loading. Please reload this page.
1 parent bf80a4c commit 3d7cd57Copy full SHA for 3d7cd57
1 file changed
src/backend/access/transam/xact.c
@@ -3304,10 +3304,15 @@ CommitTransactionCommandInternal(void)
3304
3305
/*
3306
* Here we were in an aborted transaction block and we just got
3307
- * the ROLLBACK command from the user, so clean up the
+ * 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
3310
* already-aborted transaction and return to the idle state.
3311
*/
3312
case TBLOCK_ABORT_END:
3313
+ s->blockState = TBLOCK_ABORT;
3314
+ CallXactCallbacks(XACT_EVENT_ABORT);
3315
+ s->blockState = TBLOCK_ABORT_END;
3316
CleanupTransaction();
3317
s->blockState = TBLOCK_DEFAULT;
3318
if (s->chain)
0 commit comments