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 1pk8QU-0007iq-Am for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Apr 2023 19:04:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pk8QT-0005YD-4y for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Apr 2023 19:04:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk8QS-0005Y3-Ra for pgsql-hackers@lists.postgresql.org; Wed, 05 Apr 2023 19:04:08 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk8QQ-0007k0-3T for pgsql-hackers@postgresql.org; Wed, 05 Apr 2023 19:04:07 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 863B32F3F2CC for ; Wed, 5 Apr 2023 21:04:03 +0200 (CEST) Received: from s934.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 75D192E2A06A; Wed, 5 Apr 2023 21:04:03 +0200 (CEST) Received: from s472.loopia.se (unknown [172.22.191.5]) by s934.loopia.se (Postfix) with ESMTP id 48E3C7CEA58; Wed, 5 Apr 2023 21:04:03 +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 s979.loopia.se ([172.22.191.5]) by s472.loopia.se (s472.loopia.se [172.22.190.12]) (amavisd-new, port 10024) with LMTP id UaIKdjFPZOFI; Wed, 5 Apr 2023 21:03:56 +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 s979.loopia.se (Postfix) with ESMTPSA id 6A07610BC481; Wed, 5 Apr 2023 21:03:54 +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 21:03:53 +0200 Cc: Melanie Plageman , Andres Freund , Tom Lane , Masahiko Sawada , Kyotaro Horiguchi , PostgreSQL Hackers , Amit Kapila Content-Transfer-Encoding: quoted-printable Message-Id: 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: Robert Haas 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 20:55, Robert Haas wrote: > Again, I don't think this is something we should try to > address right now under time pressure, but in the future, I think we > should consider ripping this behavior out. I would not be opposed to that, but I wholeheartedly agree that it's not = the job of this patch (or any patch at this point in the cycle). > + if (autovacuum_vac_cost_limit > 0) > + VacuumCostLimit =3D autovacuum_vac_cost_limit; > + else > + VacuumCostLimit =3D vacuum_cost_limit; > + > + /* Only balance limit if no cost-related storage > parameters specified */ > + if = (pg_atomic_unlocked_test_flag(&MyWorkerInfo->wi_dobalance)) > + return; > + Assert(VacuumCostLimit > 0); > + > + nworkers_for_balance =3D pg_atomic_read_u32( > + > &AutoVacuumShmem->av_nworkersForBalance); > + > + /* There is at least 1 autovac worker (this worker). = */ > + if (nworkers_for_balance <=3D 0) > + elog(ERROR, "nworkers_for_balance must be > = 0"); > + > + VacuumCostLimit =3D Max(VacuumCostLimit / > nworkers_for_balance, 1); >=20 > I think it would be better stylistically to use a temporary variable > here and only assign the final value to VacuumCostLimit. I can agree with that. Another supertiny nitpick on the above is to not = end a single-line comment with a period. > Daniel: Are you intending to commit this? Yes, my plan is to get it in before feature freeze. I notice now that I = had missed setting myself as committer in the CF to signal this intent, = sorry about that. -- Daniel Gustafsson