diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 395650d6406..2b24f79c268 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -1442,16 +1442,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->delayChkpt = false; - END_CRIT_SECTION(); - } - /* Compute latestXid while we have the child XIDs handy */ latestXid = TransactionIdLatest(xid, nchildren, children); @@ -1472,6 +1462,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->delayChkpt = false; + END_CRIT_SECTION(); + } + cleanup: /* Clean up local data */ if (rels)