Nathan Bossart <nathandbossart@gmail.com> writes:
> While working on an idea from another thread [0], I noticed that each of
> max_connections, max_worker_process, max_autovacuum_workers, and
> max_wal_senders have a check hook that verifies the sum of those GUCs does
> not exceed a certain value. Then, in InitializeMaxBackends(), we do the
> same check once more. Not only do the check hooks seem redundant, but I
> think they might sometimes be inaccurate since some values might not yet be
> initialized.
Yeah, these per-variable checks are inherently bogus. If we can get
of them and make the net user experience actually better, that's a
win-win.
It seems easier to do for these because they can't change after server
start, so there can be one well-defined time to apply the consistency
check. IIRC, we have some similar issues in other hooks for variables
that aren't PGC_POSTMASTER, so it's harder to see how we might get rid
of their cross-checks. That doesn't make them less bogus though.
regards, tom lane