postgresql/src/include
Nathan Bossart 0b1fe1413e 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 hook
that verifies the sum of those GUCs does not exceed a hard-coded
limit (see the comment for MAX_BACKENDS in postmaster.h).  In
general, the hooks effectively guard against egregious
misconfigurations.

However, this approach has some problems.  Since these check hooks
are called as each GUC is assigned its user-specified value, only
one of the hooks will be called with all the relevant GUCs set.  If
one or more of the user-specified values are less than the initial
values of the GUCs' underlying variables, false positives can
occur.

Furthermore, the error message emitted when one of the check hooks
fails 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": 10000

Fortunately, there is an extra copy of this check in
InitializeMaxBackends() that we can rely on, so this commit removes
the aforementioned GUC check hooks in favor of that one.  It also
enhances the error message to clearly show the values of the
relevant GUCs and the hard-coded limit their sum may not exceed.
The downside of this change is that server startup progresses
further before failing due to such misconfigurations (thus taking
longer), but these failures are expected to be rare, so we don't
anticipate any real harm in practice.

Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/ZnMr2k-Nk5vj7T7H%40nathan
2024-07-05 14:42:55 -05:00
..
access Remove comment about xl_heap_inplace "AT END OF STRUCT". 2024-06-27 19:21:06 -07:00
archive Add macro for customizing an archiving WARNING message. 2024-03-04 15:41:42 -06:00
backup Align blocks in incremental backups to BLCKSZ 2024-04-05 16:30:01 +02:00
bootstrap Update copyright for 2024 2024-01-03 20:49:05 -05:00
catalog Add pg_get_acl() to get the ACL for a database object 2024-07-04 17:09:06 +09:00
commands Reintroduce dead tuple counter in pg_stat_progress_vacuum. 2024-06-14 10:08:15 +09:00
common parse_manifest: Use const char * 2024-06-21 07:53:30 +02:00
datatype Update copyright for 2024 2024-01-03 20:49:05 -05:00
executor SQL/JSON: Always coerce JsonExpr result at runtime 2024-06-28 21:58:13 +09:00
fe_utils Allow dbname to be written as part of connstring via pg_basebackup's -R option. 2024-03-21 10:50:33 +05:30
foreign Clean up more indent breakage from 6377e12a5. 2024-04-16 13:00:40 -04:00
jit jit: Require at least LLVM 10. 2024-01-25 15:42:34 +13:00
lib Prevent access of uninitialized memory in radix tree nodes 2024-06-21 17:29:39 +07:00
libpq Harmonize function parameter names for Postgres 17. 2024-06-12 17:01:51 -04:00
mb Inline basic UTF-8 functions. 2024-03-20 09:40:57 -07:00
nodes Support "Right Semi Join" plan shapes 2024-07-05 09:26:48 +09:00
optimizer Fix asymmetry in setting EquivalenceClass.ec_sortref 2024-06-06 13:41:34 +03:00
parser Revert temporal primary keys and foreign keys 2024-05-16 08:17:46 +02:00
partitioning Implement ALTER TABLE ... SPLIT PARTITION ... command 2024-04-07 01:18:44 +03:00
pch Update copyright for 2024 2024-01-03 20:49:05 -05:00
port Remove bogus assertion in pg_atomic_monotonic_advance_u64 2024-07-04 13:25:31 +02:00
portability Update copyright for 2024 2024-01-03 20:49:05 -05:00
postmaster Improve some global variable declarations 2024-07-02 07:26:22 +02:00
regex Update copyright for 2024 2024-01-03 20:49:05 -05:00
replication Rename standby_slot_names to synchronized_standby_slots. 2024-07-01 11:36:56 +05:30
rewrite Support MERGE into updatable views. 2024-02-29 15:56:59 +00:00
snowball Update copyright for 2024 2024-01-03 20:49:05 -05:00
statistics Update copyright for 2024 2024-01-03 20:49:05 -05:00
storage Lift limitation that PGPROC->links must be the first field 2024-07-05 11:21:46 +03:00
tcop Fix incorrect year in some copyright notices added this year 2024-05-15 15:01:21 +12:00
tsearch Update copyright for 2024 2024-01-03 20:49:05 -05:00
utils Remove check hooks for GUCs that contribute to MaxBackends. 2024-07-05 14:42:55 -05:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Add macro to disable address safety instrumentation 2024-04-06 12:20:40 +07:00
fmgr.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
funcapi.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
getopt_long.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
Makefile Put genbki.pl output into src/include/catalog/ directly 2024-03-14 07:11:21 +01:00
meson.build meson: Restore implicit warning/debug/optimize flags for extensions 2024-06-07 09:36:26 +02:00
miscadmin.h Remove assertions that some compiler say are tautological 2024-03-20 09:14:51 +02:00
pg_config.h.in Optimize pg_popcount() with AVX-512 instructions. 2024-04-06 21:56:23 -05:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_config_manual.h Introduce a non-recursive JSON parser 2024-04-04 06:46:40 -04:00
pg_getopt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_trace.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgstat.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgtar.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgtime.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
port.h Replace calls to pg_qsort() with the qsort() macro. 2024-02-16 11:37:50 -06:00
postgres.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
postgres_ext.h Move RelFileNumber declarations to common/relpath.h. 2022-09-27 12:01:57 -04:00
postgres_fe.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
varatt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
windowapi.h Update copyright for 2024 2024-01-03 20:49:05 -05:00