Re: make pg_ctl more friendly

Поиск
Список
Период
Сортировка
Искать
От
Crisp Lee
Тема
Re: make pg_ctl more friendly
Дата
Msg-id
CAGHPtV4uAnL_iOpbVUVjO4W9JS7ABprw7zHk_f=KAWMROSUb-g@mail.gmail.com
Ответ на
Список
Дерево обсуждения
make pg_ctl more friendly Crisp Lee <litianxiang01@gmail.com>
Re: make pg_ctl more friendly Andres Freund <andres@anarazel.de>
Re: make pg_ctl more friendly Crisp Lee <litianxiang01@gmail.com>
Re: make pg_ctl more friendly Andres Freund <andres@anarazel.de>
Re: make pg_ctl more friendly Crisp Lee <litianxiang01@gmail.com>
Re: make pg_ctl more friendly Junwang Zhao <zhjwpku@gmail.com>
Re: make pg_ctl more friendly Junwang Zhao <zhjwpku@gmail.com>
Re: make pg_ctl more friendly Crisp Lee <litianxiang01@gmail.com>
Re: make pg_ctl more friendly Nazir Bilal Yavuz <byavuz81@gmail.com>
Re: make pg_ctl more friendly Junwang Zhao <zhjwpku@gmail.com>
Re: make pg_ctl more friendly Nathan Bossart <nathandbossart@gmail.com>
Re: make pg_ctl more friendly Junwang Zhao <zhjwpku@gmail.com>
Re: make pg_ctl more friendly Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: make pg_ctl more friendly Junwang Zhao <zhjwpku@gmail.com>
Re: make pg_ctl more friendly Laurenz Albe <laurenz.albe@cybertec.at>
Re: make pg_ctl more friendly Junwang Zhao <zhjwpku@gmail.com>
Re: make pg_ctl more friendly Tom Lane <tgl@sss.pgh.pa.us>
Re: make pg_ctl more friendly Fujii Masao <masao.fujii@oss.nttdata.com>
Re: make pg_ctl more friendly Tom Lane <tgl@sss.pgh.pa.us>
Re: make pg_ctl more friendly Fujii Masao <masao.fujii@oss.nttdata.com>
Re: make pg_ctl more friendly Nazir Bilal Yavuz <byavuz81@gmail.com>
How to judge from 'DB_SHUTDOWNED' that PITR ends normally? 'DB_SHUTDOWNED' is just a state, it could not give more meaning, so I reuse the recovery.done.

On Sat, Nov 4, 2023 at 9:56 AM Andres Freund <andres@anarazel.de> wrote:
Hi,

On 2023-11-02 14:50:14 +0800, Crisp Lee wrote:
> I got a basebackup using pg_basebackup -R. After that, I created a restore
> point named test on primary, and set recovery_target_name to test,
> recovery_target_action to shutdown in standby datadir. I got a failure
> startup message  after 'pg_ctl start -D $standby_datadir'. I think it is
> not a failure, and makes users nervous, especially for newbies.
>
> My thought is to generate a recovery.done file if the postmaster receives
> exit code 3 from the startup process. When postmaster  exits, pg_ctl will
> give a more friendly message to users.

I think we can detect this without any additional state - pg_ctl already
accesses pg_control (via get_control_dbstate()). We should be able to detect
your case by issuing a different warning if

a) get_control_dbstate() at the start was *not* DB_SHUTDOWNED
b) get_control_dbstate() at the end is DB_SHUTDOWNED

Greetings,

Andres Freund
В списке pgsql-hackers по дате отправления
От: Michael Paquier
Дата:
От: Andres Freund
Дата:
FAQ