summaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2025-12-04 10:38:12 +0200
committerAlexander Korotkov <akorotkov@postgresql.org>2025-12-04 10:38:12 +0200
commitd6ef8ee3ee29ffa404bcd920e02fb4b196e07b0d (patch)
treef232804b95f47a406d033f323175a779dc6e3944 /src/backend/access
parent6c5c393b74031351721f8a44e55bfaf6f249eefb (diff)
Fix incorrect assertion bound in WaitForLSN()
The assertion checking MyProcNumber used MaxBackends as the upper bound, but the procInfos array is allocated with size MaxBackends + NUM_AUXILIARY_PROCS. This inconsistency would cause a false assertion failure if an auxiliary process calls WaitForLSN(). Author: Xuneng Zhou <xunengzhou@gmail.com>
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/transam/xlogwait.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlogwait.c b/src/backend/access/transam/xlogwait.c
index 98aa5f1e4a2..84613fc39c7 100644
--- a/src/backend/access/transam/xlogwait.c
+++ b/src/backend/access/transam/xlogwait.c
@@ -321,7 +321,7 @@ WaitForLSN(WaitLSNType lsnType, XLogRecPtr targetLSN, int64 timeout)
Assert(waitLSNState);
/* Should have a valid proc number */
- Assert(MyProcNumber >= 0 && MyProcNumber < MaxBackends);
+ Assert(MyProcNumber >= 0 && MyProcNumber < MaxBackends + NUM_AUXILIARY_PROCS);
if (timeout > 0)
{