Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk5TL-00055v-LE for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Apr 2023 15:54:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pk5TK-0005T9-I7 for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Apr 2023 15:54:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk5TK-0005T0-8k for pgsql-hackers@lists.postgresql.org; Wed, 05 Apr 2023 15:54:54 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pk5TE-0014lx-Nt for pgsql-hackers@postgresql.org; Wed, 05 Apr 2023 15:54:53 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 7EABD2F7CA37 for ; Wed, 5 Apr 2023 17:54:47 +0200 (CEST) Received: from s979.loopia.se (unknown [172.22.191.6]) by s807.loopia.se (Postfix) with ESMTP id 6E7212E29C37; Wed, 5 Apr 2023 17:54:47 +0200 (CEST) Received: from s473.loopia.se (unknown [172.22.191.6]) by s979.loopia.se (Postfix) with ESMTP id 69DA810BC340; Wed, 5 Apr 2023 17:54:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1] autolearn=disabled Received: from s980.loopia.se ([172.22.191.6]) by s473.loopia.se (s473.loopia.se [172.22.190.13]) (amavisd-new, port 10024) with LMTP id J-sWAfStDYTF; Wed, 5 Apr 2023 17:54:47 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s980.loopia.se (Postfix) with ESMTPSA id C3FEC2201639; Wed, 5 Apr 2023 17:54:46 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.2\)) Subject: Re: Should vacuum process config file reload more often From: Daniel Gustafsson In-Reply-To: Date: Wed, 5 Apr 2023 17:54:46 +0200 Cc: Andres Freund , Tom Lane , Masahiko Sawada , Kyotaro Horiguchi , PostgreSQL Hackers , Amit Kapila Content-Transfer-Encoding: quoted-printable Message-Id: <2B12DDCC-63C4-49FD-B485-3479E543E2C5@yesql.se> References: <20230329.132155.629765142788133576.horikyota.ntt@gmail.com> <20230329.173456.1185961934810139447.horikyota.ntt@gmail.com> <935191FB-083B-4060-89FC-466F61FAA391@yesql.se> <1252075.1680547394@sss.pgh.pa.us> <20230403190837.qubpnwugfe2k2g46@awork3.anarazel.de> <7E06F879-7E20-4A6A-862F-CA72CDC9A323@yesql.se> To: Melanie Plageman X-Mailer: Apple Mail (2.3696.120.41.1.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 5 Apr 2023, at 17:29, Melanie Plageman = wrote: >>=20 >> I think I wasn't clear in my comment, sorry. I don't have a problem = with >> introducing a new variable to split the balanced value from the GUC = value. >> What I don't think we should do is repurpose an exported symbol into = doing a >> new thing. In the case at hand I think VacuumCostLimit and = VacuumCostDelay >> should remain the backing variables for the GUCs, with = vacuum_cost_limit and >> vacuum_cost_delay carrying the balanced values. So the inverse of = what is in >> the patch now. >>=20 >> The risk of these symbols being used in extensions might be very low = but on >> principle it seems unwise to alter a symbol and risk subtle breakage. >=20 > I totally see what you are saying. The only complication is that all = of > the other variables used in vacuum code are the camelcase and the gucs > follow the snake case -- as pointed out in a previous review comment = by > Sawada-san: Fair point. >> @@ -83,6 +84,7 @@ int vacuum_cost_limit; >> */ >> int VacuumCostLimit =3D 0; >> double VacuumCostDelay =3D -1; >> +static bool vacuum_can_reload_config =3D false; >>=20 >> In vacuum.c, we use snake case for GUC parameters and camel case for >> other global variables, so it seems better to rename it >> VacuumCanReloadConfig. Sorry, that's my fault. >=20 > This is less of a compelling argument than subtle breakage for = extension > code, though. How about if we rename the variable into something which also acts at = bit as self documenting why there are two in the first place? Perhaps BalancedVacuumCostLimit or something similar (I'm terrible with names)? > I am, however, wondering if extensions expect to have access to the = guc > variable or the global variable -- or both? Extensions have access to all exported symbols, and I think it's not = uncommon for extension authors to expect to have access to at least read GUC = variables. -- Daniel Gustafsson