From: | Magnus Hagander <magnus(at)hagander(dot)net> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | Nathan Bossart <nathandbossart(at)gmail(dot)com>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Don Seiler <don(at)seiler(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Estimating HugePages Requirements? |
Date: | 2022-03-24 13:07:26 |
Message-ID: | CABUevEyExSDrtZ4wU19iX4yvgExR1EpjFKB4ExFQDgTAvAHFyg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin pgsql-hackers |
On Wed, Mar 23, 2022 at 7:25 AM Michael Paquier <michael(at)paquier(dot)xyz> 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.
> My solution for the docs is perhaps too confusing for the end-user,
> and we are talking about a Linux-only thing here anyway. So, at the
> end, I am tempted to just add the "2> /dev/null" as suggested upthread
> by Nathan and call it a day. Does that sound fine?
What would be a linux only thing?
--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/
From | Date | Subject | |
---|---|---|---|
Next Message | Nathan Bossart | 2022-03-24 20:31:08 | Re: Estimating HugePages Requirements? |
Previous Message | Michael Paquier | 2022-03-24 12:10:29 | Re: Estimating HugePages Requirements? |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2022-03-24 13:07:35 | Re: Remove an unnecessary errmsg_plural in dependency.c |
Previous Message | Peter Eisentraut | 2022-03-24 13:05:27 | Re: Remove an unnecessary errmsg_plural in dependency.c |