Skip to content

Commit d6ef8ee

Browse files
committed
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>
1 parent 6c5c393 commit d6ef8ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/transam/xlogwait.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ WaitForLSN(WaitLSNType lsnType, XLogRecPtr targetLSN, int64 timeout)
321321
Assert(waitLSNState);
322322

323323
/* Should have a valid proc number */
324-
Assert(MyProcNumber >= 0 && MyProcNumber < MaxBackends);
324+
Assert(MyProcNumber >= 0 && MyProcNumber < MaxBackends + NUM_AUXILIARY_PROCS);
325325

326326
if (timeout > 0)
327327
{

0 commit comments

Comments
 (0)