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 1nnxH4-0004DY-0T for pgsql-hackers@arkaria.postgresql.org; Mon, 09 May 2022 06:53:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nnxH2-0008EP-L6 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 May 2022 06:53:40 +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 1nnxH1-0008EF-0H for pgsql-hackers@lists.postgresql.org; Mon, 09 May 2022 06:53:40 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nnxGy-0005pQ-7S for pgsql-hackers@postgresql.org; Mon, 09 May 2022 06:53:37 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id EC583320046E; Mon, 9 May 2022 02:53:32 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 09 May 2022 02:53:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1652079212; x=1652165612; bh=Dbm4Z0zPi2 UPmaIof+fOEhB/dvJ8bRypT3IGy+2IQBc=; b=EAFrJP6Z5oLoGD8nHprqQB12Ll TtwJuZMMdxQrMclUvnN+3sLnqW8GjblyPFWR+/OhHWl9XCARfR9RYtnEuDjNZO8p t85lJVZzFiwGsJR6UdUour28+r3QziGFIbikOhVV2WAjnjKdCYi0Ryw+cYwK110P 8NnUt5H8HzAuPf9rEraBvJvudUqcieLQ7+mJCMBmSUn2be/2I7iveLxOQXAZBRYB zSp+cZBBdF90V+xRdXOiyYt0Y2tv4uelcNdecx4vNh0B9nAFPQ9WFtEkvSUGJRuI DMacMk+Bf611knsDt12xMcZ/6/c/WhfNpBGHCm9uCJJx+921GZXpNggWSyrA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1652079212; x= 1652165612; bh=Dbm4Z0zPi2UPmaIof+fOEhB/dvJ8bRypT3IGy+2IQBc=; b=e pS5/u21/uZFVvVci8TvzDgcliXVjd81sDffy++2gA0Kds4M6sQW2Iv3YUR+BWaB3 poY2vJycdcl842eCmQqEQbtS1LRWi0LEDyadOubCz745/PZfE9waQBwBkUkJ3VRz HMfjWmhTc7rljOs9SluWrH/uy+eo+M/VgZ2eT53m1mPJdCsk0wE2T+IWUXqK2M4K Nt+QUt75wyYZHtjEAO5x4zRMOPaI6BstVN+G8LgnTNRjssh9Sc7b0ZPuoItz4VPb P6JCChIRrc4sqPkT/g7umEDI+u4pe/cJpxVsqemZ1rBq6si1LZIV/spZfLtj4kND y734granf2bvtJS/IsX/A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeekgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepgeffjeevgfevuddvjedtvddt ieejheduueelvddufedtgfefjedvkeevkeeivddvnecuffhomhgrihhnpehpohhsthhgrh gvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 May 2022 02:53:28 -0400 (EDT) Date: Mon, 9 May 2022 15:53:24 +0900 From: Michael Paquier To: Nathan Bossart Cc: Magnus Hagander , "Bossart, Nathan" , Fujii Masao , Justin Pryzby , Andres Freund , Mark Dilger , Don Seiler , PostgreSQL-development Subject: Re: Estimating HugePages Requirements? Message-ID: References: <20220315224439.GA1133771@nathanxps13> <20220506171318.GA3448558@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9dc2bRuWM/Xgdybl" Content-Disposition: inline In-Reply-To: <20220506171318.GA3448558@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --9dc2bRuWM/Xgdybl Content-Type: multipart/mixed; boundary="+uRjbbaBTX4RVhUK" Content-Disposition: inline --+uRjbbaBTX4RVhUK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 06, 2022 at 10:13:18AM -0700, Nathan Bossart wrote: > On Tue, Apr 26, 2022 at 10:34:06AM +0900, Michael Paquier wrote: >> Yes, the redirection issue would apply to all the run-time GUCs. >=20 > Should this be tracked as an open item for v15? There was another recent > report about the extra log output [0]. That makes it for two complaints on two separate threads. So an open item seems adapted to adjust this behavior. I have looked at the patch posted at [1], and I don't quite understand why you need the extra dance with log_min_messages. Why don't you just set the GUC at the end of the code path in PostmasterMain() where we print non-runtime-computed parameters? I am not really worrying about users deciding to set log_min_messages to PANIC in postgresql.conf when it comes to postgres -C, TBH, as they'd miss the FATAL messages if the command is attempted on a server already starting. Per se the attached. [1]: https://www.postgresql.org/message-id/20220328173503.GA137769@nathanxp= s13 -- Michael --+uRjbbaBTX4RVhUK Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v4-0001-Silence-extra-logging-with-postgres-C.patch" Content-Transfer-Encoding: quoted-printable =46rom 3b8a7f8079955cd59a5a318adf6938cdd3c29c6b Mon Sep 17 00:00:00 2001 =46rom: Michael Paquier Date: Mon, 9 May 2022 15:50:19 +0900 Subject: [PATCH v4] Silence extra logging with 'postgres -C'. Presently, the server may emit a variety of extra log messages when inspecting GUC values. For example, when inspecting a runtime-computed GUC, the server will always emit a "database system is shut down" LOG (unless the user has set log_min_messages higher than LOG). To avoid these extra log messages, this change sets log_min_messages to FATAL when -C is used (even if set to PANIC in postgresql.conf). At FATAL, the user will still receive messages explaining why a GUC's value cannot be inspected. --- src/backend/postmaster/postmaster.c | 10 ++++++++++ doc/src/sgml/runtime.sgml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/p= ostmaster.c index ce4007bb2c..38b63bc215 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -913,6 +913,16 @@ PostmasterMain(int argc, char *argv[]) puts(config_val ? config_val : ""); ExitPostmaster(0); } + + /* + * A runtime-computed GUC will be printed later on. As we initialize + * a server startup sequence, silence any log messages that may show up + * in the output generated. FATAL and more severe messages are useful + * to show, even if one would only expect at least PANIC. LOG entries + * are hidden. + */ + SetConfigOption("log_min_messages", "FATAL", PGC_INTERNAL, + PGC_S_OVERRIDE); } =20 /* Verify that DataDir looks reasonable */ diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 4465c876b1..62cec614d3 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1448,7 +1448,7 @@ export PG_OOM_ADJUST_VALUE=3D0 server must be shut down to view this runtime-computed parameter. This might look like: -$ postgres -D $PGDATA -C shared_memory_size_in_huge_pages 2> /d= ev/null +$ postgres -D $PGDATA -C shared_memory_size_in_huge_pages 3170 $ grep ^Hugepagesize /proc/meminfo Hugepagesize: 2048 kB --=20 2.36.0 --+uRjbbaBTX4RVhUK-- --9dc2bRuWM/Xgdybl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmJ4umQACgkQnvQgOdby QH23sRAAlEz+TAheqcHlh+IgBlXklo0ASgQ+jFOvtIZSMPO+diDpUqHuIX6XOFR/ aEE1sKY9/RABfTpdGiHD6qd+Tqz/W5GFK9TAbk06RpCRrS6qLLYgiBXnFtGN2UmQ LbD2Lr3b1LQCDIQp82xg3tryqnoEHxP5dnivztZzWuz44NToib4wWEf25K4dXcKS VyOqmc+ufIAYWaKVPwBc8RKRBYR+HSp6kto3jBxDHhkHzz5KBUBtHM6qBCrzptlK S3nXLckQUN7ZXsasdiJqI9O/YiZaBDagLrETmHqfYkbLGKzl0Eu6EWsEAa0WhQ/N r8ccSaFZZH4ZIeePCDSLCrpWWBDC8NQ+g6pjd46FH13yUiEbnGH6kqcSIYE16Q7Y Y2lYHRQPVeYKMwzeDCYJ71acLV3Rg+N6JkA0Iu8geQR3ai8bZGGMfoEMQaNRKd+D LK0x9MXvpupFfZhUOL9wJTib2Rou3itkWcrx/PHAOLzleueNfwbIVDCeVbl2dhxh Vn/i2qsPFtDYKTaFhPPjfpOBLHzx9hAn4GA/PsMg7JvDBHaFguQ1nfIg6ccv/Sd9 StobmstEWQAGCtTg0CO4v7Kjkc4YKF80iS9N0AlVk+EozOOKsmvmTXWVJhzqv/sP BE20n/Ptz9VlynkmSSIul8UTIaaOmlyllW0JX4Kl/cHGp3WpgZY= =UiwY -----END PGP SIGNATURE----- --9dc2bRuWM/Xgdybl--