aboutsummaryrefslogtreecommitdiff
path: root/src/include/commands/waitlsn.h
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2024-04-07 00:32:35 +0300
committerAlexander Korotkov <akorotkov@postgresql.org>2024-04-07 00:49:53 +0300
commitee79928441e7e291532b833455ebfee27d7cab5c (patch)
treebc8115da4fbef2a910f5f45531b21c9095b716bb /src/include/commands/waitlsn.h
parent25f42429e2ff2acca35c9154fc2e36b75c79227a (diff)
downloadpostgresql-ee79928441e7e291532b833455ebfee27d7cab5c.tar.gz
postgresql-ee79928441e7e291532b833455ebfee27d7cab5c.zip
Clarify what is protected by WaitLSNLock
Not just WaitLSNState.waitersHeap, but also WaitLSNState.procInfos and updating of WaitLSNState.minWaitedLSN is protected by WaitLSNLock. There is one now documented exclusion on fast-path checking of WaitLSNProcInfo.inHeap flag. Discussion: https://postgr.es/m/202404030658.hhj3vfxeyhft%40alvherre.pgsql
Diffstat (limited to 'src/include/commands/waitlsn.h')
-rw-r--r--src/include/commands/waitlsn.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/include/commands/waitlsn.h b/src/include/commands/waitlsn.h
index b3d9eed64d8..da17b8be6f9 100644
--- a/src/include/commands/waitlsn.h
+++ b/src/include/commands/waitlsn.h
@@ -49,7 +49,7 @@ typedef struct WaitLSNState
/*
* The minimum LSN value some process is waiting for. Used for the
* fast-path checking if we need to wake up any waiters after replaying a
- * WAL record.
+ * WAL record. Could be read lock-less. Update protected by WaitLSNLock.
*/
pg_atomic_uint64 minWaitedLSN;
@@ -59,7 +59,10 @@ typedef struct WaitLSNState
*/
pairingheap waitersHeap;
- /* An array with per-process information, indexed by the process number */
+ /*
+ * An array with per-process information, indexed by the process number.
+ * Protected by WaitLSNLock.
+ */
WaitLSNProcInfo procInfos[FLEXIBLE_ARRAY_MEMBER];
} WaitLSNState;