forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0b1fe14
committed
Remove check hooks for GUCs that contribute to MaxBackends.
Each of max_connections, max_worker_processes,autovacuum_max_workers, and max_wal_senders has a GUC check hookthat verifies the sum of those GUCs does not exceed a hard-codedlimit (see the comment for MAX_BACKENDS in postmaster.h). Ingeneral, the hooks effectively guard against egregiousmisconfigurations.However, this approach has some problems. Since these check hooksare called as each GUC is assigned its user-specified value, onlyone of the hooks will be called with all the relevant GUCs set. Ifone or more of the user-specified values are less than the initialvalues of the GUCs' underlying variables, false positives canoccur.Furthermore, the error message emitted when one of the check hooksfails is not tremendously helpful. For example, the command$ pg_ctl -D . start -o "-c max_connections=262100 -c max_wal_senders=10000"fails with the following error:FATAL: invalid value for parameter "max_wal_senders": 10000Fortunately, there is an extra copy of this check inInitializeMaxBackends() that we can rely on, so this commit removesthe aforementioned GUC check hooks in favor of that one. It alsoenhances the error message to clearly show the values of therelevant GUCs and the hard-coded limit their sum may not exceed.The downside of this change is that server startup progressesfurther before failing due to such misconfigurations (thus takinglonger), but these failures are expected to be rare, so we don'tanticipate any real harm in practice.Reviewed-by: Tom LaneDiscussion:https://postgr.es/m/ZnMr2k-Nk5vj7T7H%40nathan1 parentba8f00e commit0b1fe14
File tree
3 files changed
+11
-60
lines changed- src
- backend/utils
- init
- misc
- include/utils
3 files changed
+11
-60
lines changedLines changed: 7 additions & 50 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
580 | 580 |
| |
581 | 581 |
| |
582 | 582 |
| |
583 |
| - | |
584 | 583 |
| |
585 |
| - | |
586 |
| - | |
587 |
| - | |
588 |
| - | |
589 |
| - | |
590 |
| - | |
591 |
| - | |
592 |
| - | |
593 |
| - | |
594 |
| - | |
595 |
| - | |
596 |
| - | |
597 |
| - | |
598 |
| - | |
599 |
| - | |
600 |
| - | |
601 |
| - | |
602 |
| - | |
603 |
| - | |
604 |
| - | |
605 |
| - | |
606 |
| - | |
607 |
| - | |
608 |
| - | |
609 |
| - | |
610 |
| - | |
611 |
| - | |
612 |
| - | |
613 |
| - | |
614 |
| - | |
615 |
| - | |
616 |
| - | |
617 |
| - | |
618 |
| - | |
619 |
| - | |
620 |
| - | |
621 |
| - | |
622 |
| - | |
623 |
| - | |
624 |
| - | |
625 |
| - | |
626 |
| - | |
627 |
| - | |
628 |
| - | |
629 |
| - | |
630 |
| - | |
631 |
| - | |
632 |
| - | |
633 |
| - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
634 | 591 |
| |
635 | 592 |
| |
636 | 593 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2209 | 2209 |
| |
2210 | 2210 |
| |
2211 | 2211 |
| |
2212 |
| - | |
| 2212 | + | |
2213 | 2213 |
| |
2214 | 2214 |
| |
2215 | 2215 |
| |
| |||
2925 | 2925 |
| |
2926 | 2926 |
| |
2927 | 2927 |
| |
2928 |
| - | |
| 2928 | + | |
2929 | 2929 |
| |
2930 | 2930 |
| |
2931 | 2931 |
| |
| |||
3155 | 3155 |
| |
3156 | 3156 |
| |
3157 | 3157 |
| |
3158 |
| - | |
| 3158 | + | |
3159 | 3159 |
| |
3160 | 3160 |
| |
3161 | 3161 |
| |
| |||
3389 | 3389 |
| |
3390 | 3390 |
| |
3391 | 3391 |
| |
3392 |
| - | |
| 3392 | + | |
3393 | 3393 |
| |
3394 | 3394 |
| |
3395 | 3395 |
| |
|
Lines changed: 0 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
32 |
| - | |
33 |
| - | |
34 | 32 |
| |
35 | 33 |
| |
36 | 34 |
| |
| |||
84 | 82 |
| |
85 | 83 |
| |
86 | 84 |
| |
87 |
| - | |
88 |
| - | |
89 | 85 |
| |
90 | 86 |
| |
91 | 87 |
| |
92 |
| - | |
93 |
| - | |
94 | 88 |
| |
95 | 89 |
| |
96 | 90 |
| |
|
0 commit comments
Comments
(0)