mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +03:00
Revert the addition of GetMaxBackends() and related stuff.
This reverts commits0147fc7,4567596,aa64f23, and5ecd018. There is no longer agreement that introducing this function was the right way to address the problem. The consensus now seems to favor trying to make a correct value for MaxBackends available to mdules executing their _PG_init() functions. Nathan Bossart Discussion: http://postgr.es/m/20220323045229.i23skfscdbvrsuxa@jrouhaud
This commit is contained in:
@@ -213,7 +213,7 @@ SInvalShmemSize(void)
|
||||
* free slot. This is because the autovacuum launcher and worker processes,
|
||||
* which are included in MaxBackends, are not started in Hot Standby mode.
|
||||
*/
|
||||
size = add_size(size, mul_size(sizeof(ProcState), GetMaxBackends()));
|
||||
size = add_size(size, mul_size(sizeof(ProcState), MaxBackends));
|
||||
|
||||
return size;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ CreateSharedInvalidationState(void)
|
||||
shmInvalBuffer->maxMsgNum = 0;
|
||||
shmInvalBuffer->nextThreshold = CLEANUP_MIN;
|
||||
shmInvalBuffer->lastBackend = 0;
|
||||
shmInvalBuffer->maxBackends = GetMaxBackends();
|
||||
shmInvalBuffer->maxBackends = MaxBackends;
|
||||
SpinLockInit(&shmInvalBuffer->msgnumLock);
|
||||
|
||||
/* The buffer[] array is initially all unused, so we need not fill it */
|
||||
|
||||
Reference in New Issue
Block a user