git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 71db645)
Move MarkCurrentTransactionIdLoggedIfAny() out of the critical section.
Tue, 2 Nov 2021 03:40:17 +0000 (09:10 +0530)
Tue, 2 Nov 2021 03:41:05 +0000 (09:11 +0530)
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


diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 6aca1fd75d99c2327d858bef09b69e8437049f62..0a0771a18eb40019b0c586b3d14144960fed478c 100644 (file)
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -1169,10 +1169,10 @@ XLogInsertRecord(XLogRecData *rdata,
*/
WALInsertLockRelease();
- MarkCurrentTransactionIdLoggedIfAny();
-
END_CRIT_SECTION();
+ MarkCurrentTransactionIdLoggedIfAny();
+
/*
* Mark top transaction id is logged (if needed) so that we should not try
* to log it again with the next WAL record in the current subtransaction.
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /