Re: make pg_ctl more friendly

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Junwang Zhao <zhjwpku(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Crisp Lee <litianxiang01(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: make pg_ctl more friendly
Date: 2024-07-19 12:13:13
Message-ID: ed72e7aa-d19c-43ea-888b-3449632d944b@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024/07/19 2:58, Tom Lane wrote:
> Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> writes:
>> "because of recovery target settings" isn't always accurate.
>> For example, if the DBA shuts down the server during recovery,
>> POSTMASTER_SHUTDOWN_IN_RECOVERY can be returned regardless of
>> the recovery target settings. Should we change the message to
>> something like "server shut down in recovery" for accuracy?
>
> Hmm, I just pushed it with Laurenz's wording. I don't mind
> if we change it again, but I'm not sure that there's much
> wrong with it as it stands. Keep in mind that the context
> is the DBA doing "pg_ctl start". It seems unlikely that
> he/she would concurrently do "pg_ctl stop". Even if that
> did happen, do we really need to phrase the message to account
> for it?
>
> I like Laurenz's wording because it points the user in the
> direction of the settings that would need adjustment if an
> immediate shutdown wasn't what was expected/wanted. If we
> just say "shut down in recovery", that may be accurate,
> but it offers little help as to what to do next.

I was thinking the scenario where "pg_ctl -w start" exits due to
a recovery target setting, especially with recovery_target_action=shutdown,
can happen not so many times. This is because the server typically
can reach PM_STATUS_READY or PM_STATUS_STANDBY,
and pg_ctl exits normally before the recovery target is reached.

On the other thand, if users start the crash recovery and find
misconfiguration of parameter requiring a server restart,
they might shut down the server during recovery to fix it.
In this case, mentioning "recovery target" could be confusing.
This scenario also might not be so common, but seems a bit more
likely than the recovery target case. I understand this might be
a minority opinion, though..

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ron Johnson 2024-07-19 12:21:36 Re: Enhance pg_dump multi-threaded streaming (WAS: Re: filesystem full during vacuum - space recovery issues)
Previous Message Dean Rasheed 2024-07-19 11:55:28 Re: Adding OLD/NEW support to RETURNING