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

+8
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)