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 1m8OZY-0003wc-P5 for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jul 2021 15:00:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m8OZW-0008O4-By for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jul 2021 15:00:42 +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 1m8OZW-0008Nt-46 for pgsql-hackers@lists.postgresql.org; Tue, 27 Jul 2021 15:00:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m8OZT-0005yt-Q6 for pgsql-hackers@lists.postgresql.org; Tue, 27 Jul 2021 15:00: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 16RF0a3T273675; Tue, 27 Jul 2021 11:00:36 -0400 From: Tom Lane To: Alvaro Herrera cc: Pg Hackers Subject: Re: pg_settings.pending_restart not set when line removed In-reply-to: <202107271429.4m5ngdum7f66@alvherre.pgsql> References: <202107271429.4m5ngdum7f66@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 27 Jul 2021 10:29:32 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <273673.1627398036.1@sss.pgh.pa.us> Date: Tue, 27 Jul 2021 11:00:36 -0400 Message-ID: <273674.1627398036@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > On 2021-Jul-27, Tom Lane wrote: >> Ugh. I think this patch is likely to create more problems than it fixes. > I doubt that; as I said, the code already behaves in exactly that way > for closely related operations, so this patch isn't doing anything new. > Note that that loop this code is modifying only applies to lines that > are removed from the config file. Ah ... what's wrong here is some combination of -ENOCAFFEINE and a not-great explanation on your part. I misread the patch as adding "error = true" rather than the flag change. I agree that setting the GUC_PENDING_RESTART flag is fine, because set_config_option would do so if we reached it. Perhaps you should comment this along that line? Also, the cases inside set_config_option uniformly set that flag *before* the ereport not after. So maybe like if (gconf->context < PGC_SIGHUP) { + /* The removal can't be effective without a restart */ + gconf->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), One thing worth checking is whether the pending-restart flag gets cleared again if the DBA undoes the removal and again reloads. I think the right thing will happen, but it'd be worthwhile to check. regards, tom lane