Skip to content

Commit 3353974

Browse files
author
Amit Kapila
committed
Move MarkCurrentTransactionIdLoggedIfAny() out of the critical section.
We don't modify any shared state in this function which could cause problems for any concurrent session. This will make it look similar to the other updates for the same structure (TransactionState) which avoids confusion for future readers of code. Author: Dilip Kumar Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/E1mSoYz-0007Fh-D9@gemulon.postgresql.org
1 parent 71db645 commit 3353974

File tree

1 file changed

+2
-2
lines changed
  • src/backend/access/transam

1 file changed

+2
-2
lines changed

src/backend/access/transam/xlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,10 +1169,10 @@ XLogInsertRecord(XLogRecData *rdata,
11691169
*/
11701170
WALInsertLockRelease();
11711171

1172-
MarkCurrentTransactionIdLoggedIfAny();
1173-
11741172
END_CRIT_SECTION();
11751173

1174+
MarkCurrentTransactionIdLoggedIfAny();
1175+
11761176
/*
11771177
* Mark top transaction id is logged (if needed) so that we should not try
11781178
* to log it again with the next WAL record in the current subtransaction.

0 commit comments

Comments
 (0)