diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index b885513f765..a0807e95b15 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -1531,16 +1531,6 @@ RecordTransactionCommit(void) TransactionIdAsyncCommitTree(xid, nchildren, children, XactLastRecEnd); } - /* - * If we entered a commit critical section, leave it now, and let - * checkpoints proceed. - */ - if (markXidCommitted) - { - MyProc->delayChkptFlags &= ~DELAY_CHKPT_START; - END_CRIT_SECTION(); - } - /* Compute latestXid while we have the child XIDs handy */ latestXid = TransactionIdLatest(xid, nchildren, children); @@ -1561,6 +1551,17 @@ RecordTransactionCommit(void) /* Reset XactLastRecEnd until the next transaction writes something */ XactLastRecEnd = 0; + + /* + * If we entered a commit critical section, leave it now, and let + * checkpoints proceed. + */ + if (markXidCommitted) + { + MyProc->delayChkptFlags &= ~DELAY_CHKPT_START; + END_CRIT_SECTION(); + } + cleanup: /* Clean up local data */ if (rels)