mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-05 03:47:36 +08:00
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>
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user