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 1nXU72-0003xz-Qw for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Mar 2022 20:31:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nXU70-0008LA-Sv for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Mar 2022 20:31:14 +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 1nXU70-0008GL-GH for pgsql-hackers@lists.postgresql.org; Thu, 24 Mar 2022 20:31:14 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nXU6y-0000cs-8I for pgsql-hackers@postgresql.org; Thu, 24 Mar 2022 20:31:13 +0000 Received: by mail-ot1-x330.google.com with SMTP id i23-20020a9d6117000000b005cb58c354e6so4111879otj.10 for ; Thu, 24 Mar 2022 13:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bgILNj8VFRXqdtFoPqmaE4NnMA/HiLmPRT5HJ2wOcVs=; b=jOB3x/zbAzmsc6FPnSiMstwZM/HBb4zHi83C/5v/VysNHuyzsG0mlaQsmEmaon/pQN LAw0P89VAJSMoHXgIrcAg0QcXWgN51Z43xQmCCkl/wrtq8fF7D3egSOWBquzw60rGRv0 68X6pcDKSCQXJUw/bRvoa1+3uU3mPLCBeaRd2WKpIrPc+P9TWSxKtZkYxeXVfBbx84ld z8QfRPRedyYlxOqfYk5Yc08LJoUnX/qT+u40QRdN8C0qZK9rVltrtcF3sEpTQ5J5ia9h V4mjjcN3yUkPnEfnv5ichSuFeDwFBa8pMSAAzsGpGFAi4zXF3ldBkTKMBth8S3OE9rcR M+jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bgILNj8VFRXqdtFoPqmaE4NnMA/HiLmPRT5HJ2wOcVs=; b=2caIOt7JyTm6ofZ8uET15mh3lvVN8w+bZCQU4YKigUfOeukEiIfw5zS2CMcqih9jYm +i54nKMp0GtTgGPjKXi23zNg18PJXAkbVMcL0Ln3xnrKOA4qo2r2ESYDzCeoxp8rMjMF Q6aTDitjGdcTqqRgMuWp8hQhpHszrmTlO8d538JVE6LZtf1F0o7HPTonPV/zS3oTqzDE U68aeVDSS8RPlh3WMdJV3TM6AYxkpwwRW2GcWE8qiU6FTk66xWbm8Z8conFzJLiu/Qif FQo5fJjQANA3ofV+PkyAwoIFTqdUnanor6KegQSZ85aOelZ7qFMqM2jXsIRjzC2Fgum4 0TXw== X-Gm-Message-State: AOAM533MbA3uDo9PI6RCi/IGNLfEtDLZhCMz9l705JBz42o+L5QvTRsP PAc2GX7MpdcpEapX+lRefqY= X-Google-Smtp-Source: ABdhPJyO7qUBgZ9T/PQUbikJufL4sIa9wfOTM5V4/kxTV/9tWDKDPlleI5+XnlsfwR5Urg4HIVW/ug== X-Received: by 2002:a9d:454c:0:b0:5b2:3757:9fc6 with SMTP id p12-20020a9d454c000000b005b237579fc6mr2946611oti.314.1648153871377; Thu, 24 Mar 2022 13:31:11 -0700 (PDT) Received: from nathanxps13 ([2600:1700:48f8:340f:3a43:f7c5:e278:8a55]) by smtp.gmail.com with ESMTPSA id r41-20020a056870582900b000d6cbaf589esm1979707oap.40.2022.03.24.13.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 13:31:10 -0700 (PDT) Date: Thu, 24 Mar 2022 13:31:08 -0700 From: Nathan Bossart To: Magnus Hagander Cc: Michael Paquier , "Bossart, Nathan" , Fujii Masao , Justin Pryzby , Andres Freund , Mark Dilger , Don Seiler , "pgsql-hackers@postgresql.org" Subject: Re: Estimating HugePages Requirements? Message-ID: <20220324203108.GB1855897@nathanxps13> References: <6AE0285D-0917-4C05-B6AA-4AEDD2FCBA52@amazon.com> <20220314173417.GA1020555@nathanxps13> <20220315224439.GA1133771@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 24, 2022 at 02:07:26PM +0100, Magnus Hagander wrote: > On Wed, Mar 23, 2022 at 7:25 AM Michael Paquier wrote: >> On Tue, Mar 15, 2022 at 03:44:39PM -0700, Nathan Bossart wrote: >> > A simple approach could be to just set log_min_messages to PANIC before >> > exiting. I've attached a patch for this. With this patch, we'll still see >> > a FATAL if we try to use 'postgres -C' for a runtime-computed GUC on a >> > running server, and there will be no extra output as long as the user sets >> > log_min_messages to INFO or higher (i.e., not a DEBUG* value). For >> > comparison, 'postgres -C' for a non-runtime-computed GUC does not emit >> > extra output as long as the user sets log_min_messages to DEBUG2 or higher. >> >> > puts(config_val ? config_val : ""); >> > + >> > + /* don't emit shutdown messages */ >> > + SetConfigOption("log_min_messages", "PANIC", PGC_INTERNAL, PGC_S_OVERRIDE); >> > + >> > ExitPostmaster(0); >> >> That's fancy, but I don't like that much. And this would not protect >> either against any messages generated before this code path, either, > > But neither would the suggestion of redirecting stderr to /dev/null. > In fact, doing the redirect it will *also* throw away any FATAL that > happens. In fact, using the 2>/dev/null method, we *also* remove the > message that says there's another postmaster running in this > directory, which is strictly worse than the override of > log_min_messages. > > That said, the redirect can be removed without recompiling postgres, > so it is probably still hte better choice as a temporary workaround. > But we should really look into getting a better solution in place once > we start on 16. A couple of other options to consider: 1) Always set log_min_messages to WARNING/ERROR/FATAL for 'postgres -C'. We might need some special logic for handling the case where the user is inspecting the log_min_messages parameter. With this approach, you'd probably never get extra output unless something was wrong (e.g., database already running when inspecting a runtime-computed GUC). Also, this would silence any extra output that you might see today with non-runtime-computed GUCs. 2) Add some way to skip just the shutdown message (e.g., a variable set when output_config_variable is true). With this approach, you wouldn't get extra output by default, but you still might if log_min_messages is set to something like DEBUG3. This wouldn't impact any extra output that you see today with non-runtime-computed GUCs. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com