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 1m89cA-0005om-KA for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jul 2021 23:02:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m89c9-0008AE-C7 for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jul 2021 23:02:25 +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 1m89c8-0008A5-Mz for pgsql-hackers@lists.postgresql.org; Mon, 26 Jul 2021 23:02:25 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m89c5-0006lc-7m for pgsql-hackers@lists.postgresql.org; Mon, 26 Jul 2021 23:02:24 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id E1C79320090E for ; Mon, 26 Jul 2021 19:02:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 26 Jul 2021 19:02:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=XIowBw VyQ4GOfQK7Ulmyng4GcyskmoPvRTt+ygi0bWw=; b=vS2AkG+EzUcBzRZz4ZDwMf ikB5c+IdvBEfJsMmN0gtNce9d2HfBFnOv3r6V8C+Zw/F+Sfd2jmLyKDxTaC5Lgca bJrORDYt6XOneTobC+Y2lu3klasJsdZeCwos1isjxwj+RgIl7k6Ri8vQ2dIyLMJS FMkobuGDaISOJ3/ozPrKVIp4ArEtwuwo3HwFgHLg4Rx7X36GDMZIe6Pyj8KfhtBL koLVCyPda84//8S91KMBJv97W2mEkygiH6HxJYYyYKv/A/nk6C9cpe06nTHIU6Ck 533x8zjofgtRoy0irAbuY32EHVTBf9G0GbiCTUn6xWOi34mQPo7J7ub30O175IrQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrgeeigddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgsehmkeerredttdejnecuhfhrohhmpeetlhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqeenuc ggtffrrghtthgvrhhnpeekkeelhfdtfefhvefhteeijeevffelveduudehfeffffevffdv udekieekfeeiieenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghr rhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 26 Jul 2021 19:02:16 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8026C2A06A7; Mon, 26 Jul 2021 19:02:12 -0400 (-04) Date: Mon, 26 Jul 2021 19:02:12 -0400 From: Alvaro Herrera To: Pg Hackers Subject: pg_settings.pending_restart not set when line removed Message-ID: <202107262302.xsfdfc5sb7sh@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qxuecqk2dgpqyicg" Content-Disposition: inline Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --qxuecqk2dgpqyicg Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi I got a report from Gabriele Bartolini and team that the pg_settings view does not get the pending_restart flag set when a setting's line is removed from a file (as opposed to its value changed). The explanation seems to be that GUC_PENDING_RESTART is set by set_config_option, but when ProcessConfigFileInternal is called only to provide data (applySettings=true), then set_config_option is never called and thus the flag doesn't get set. I tried the attached patch, which sets GUC_PENDING_RESTART if we're doing pg_file_settings(). Then any subsequent read of pg_settings will have the pending_restart flag set. This seems to work correctly, and consistently with the case where you change a line (without removing it) in unpatched master. You could argue that this is *weird* (why does reading pg_file_settings set a flag in global state?) ... but that weirdness is not something this patch is introducing. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Hay dos momentos en la vida de un hombre en los que no debería especular: cuando puede permitírselo y cuando no puede" (Mark Twain) --qxuecqk2dgpqyicg Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-fix-guc.patch" From 71fa384a6bf7aef58bdbe6d382cbc1219dbaa420 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Mon, 26 Jul 2021 18:35:09 -0400 Subject: [PATCH] fix guc --- src/backend/utils/misc/guc-file.l | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l index 986ce542e3..1fe3af6284 100644 --- a/src/backend/utils/misc/guc-file.l +++ b/src/backend/utils/misc/guc-file.l @@ -354,6 +354,7 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) gconf->name), NULL, 0, &head, &tail); + gconf->status |= GUC_PENDING_RESTART; error = true; continue; } -- 2.20.1 --qxuecqk2dgpqyicg--