mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04:00
Fix variable usage in wakeupWaiters()
Mistakenly, `i` was used both as an integer representation of lsnType and an index in wakeUpProcs array. Discussion: https://postgr.es/m/CA%2BhUKG%2BL0OQR8dQtsNBSaA3FNNyQeFabdeRVzurm0b7Xtp592g%40mail.gmail.com Reviewed-by: Thomas Munro <thomas.munro@gmail.com> Reviewed-by: Ruikai Peng <ruikai@pwno.io>
This commit is contained in:
parent
8b9b93e39b
commit
bf308639bf
1 changed files with 4 additions and 2 deletions
|
|
@ -264,6 +264,8 @@ wakeupWaiters(WaitLSNType lsnType, XLogRecPtr currentLSN)
|
|||
|
||||
do
|
||||
{
|
||||
int j;
|
||||
|
||||
numWakeUpProcs = 0;
|
||||
LWLockAcquire(WaitLSNLock, LW_EXCLUSIVE);
|
||||
|
||||
|
|
@ -303,8 +305,8 @@ wakeupWaiters(WaitLSNType lsnType, XLogRecPtr currentLSN)
|
|||
* at worst we may set a latch for the wrong process or for no process
|
||||
* at all, which is harmless.
|
||||
*/
|
||||
for (i = 0; i < numWakeUpProcs; i++)
|
||||
SetLatch(&GetPGProcByNumber(wakeUpProcs[i])->procLatch);
|
||||
for (j = 0; j < numWakeUpProcs; j++)
|
||||
SetLatch(&GetPGProcByNumber(wakeUpProcs[j])->procLatch);
|
||||
|
||||
} while (numWakeUpProcs == WAKEUP_PROC_STATIC_ARRAY_SIZE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue