Skip to content

Commit edea649

Browse files
committed
Explain why the startup process can't cause a shortage of sinval slots.
Bharath Rupireddy, reviewed by Fujii Masao and Yura Sokolov. Lightly edited by me. Discussion: http://postgr.es/m/CALj2ACU=3_frMkDp9UUeuZoAMjaK1y0Z_q5RFNbGvwi8NM==AA@mail.gmail.com
1 parent 3785d8e commit edea649

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/storage/ipc/sinvaladt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ SInvalShmemSize(void)
205205
Size size;
206206

207207
size = offsetof(SISeg, procState);
208+
209+
/*
210+
* In Hot Standby mode, the startup process requests a procState array
211+
* slot using InitRecoveryTransactionEnvironment(). Even though MaxBackends
212+
* doesn't account for the startup process, it is guaranteed to get a
213+
* free slot. This is because the autovacuum launcher and worker processes,
214+
* which are included in MaxBackends, are not started in Hot Standby mode.
215+
*/
208216
size = add_size(size, mul_size(sizeof(ProcState), GetMaxBackends()));
209217

210218
return size;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy