mirror of
https://github.com/postgres/postgres.git
synced 2025-12-06 00:02:13 +03: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