Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sK0gi-007qaK-4b for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2024 19:09:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sK0gf-005JYT-D9 for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2024 19:09:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sK0gf-005JTD-33 for pgsql-hackers@lists.postgresql.org; Wed, 19 Jun 2024 19:09:41 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sK0gd-002WH8-D1 for pgsql-hackers@postgresql.org; Wed, 19 Jun 2024 19:09:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 45JJ9alO147693; Wed, 19 Jun 2024 15:09:36 -0400 From: Tom Lane To: Nathan Bossart cc: pgsql-hackers@postgresql.org Subject: Re: remove check hooks for GUCs that contribute to MaxBackends In-reply-to: References: Comments: In-reply-to Nathan Bossart message dated "Wed, 19 Jun 2024 14:04:58 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <147691.1718824176.1@sss.pgh.pa.us> Date: Wed, 19 Jun 2024 15:09:36 -0400 Message-ID: <147692.1718824176@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart 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