Re: make pg_ctl more friendly

From: Junwang Zhao <zhjwpku(at)gmail(dot)com>
To: Crisp Lee <litianxiang01(at)gmail(dot)com>
Cc: 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: 2023-11-09 07:08:11
Message-ID: CAEG8a3LdVHqewqvuEmHz5CNdb1gi97XwNSQa2nisph3qC0E4hw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 9, 2023 at 9:57 AM Crisp Lee <litianxiang01(at)gmail(dot)com> wrote:
>
> Hi,
>
> I know it. But my question is not that. I did a PITR operation with recovery_target_name and recovery_target_action('shutdown'). The PITR process was very short and the PITR was done before pg_ctl check. The postmaster shutdown due to recovery_target_action, and there was no crash. But pg_ctl told me about startup failure. I think the startup had succeeded and the result was not a exception. pg_ctl should tell users about detailed messages.
>
> On Thu, Nov 9, 2023 at 9:32 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>>
>> Hi,
>>
>> On 2023-11-09 09:29:32 +0800, Crisp Lee wrote:
>> > 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.
>>
>> DB_SHUTDOWNED cannot be encountered while recovery is ongoing. If there was a
>> hard crash, you'd see DB_IN_ARCHIVE_RECOVERY or such, if the command was shut
>> down orderly before PITR has finished, you'd see DB_SHUTDOWNED_IN_RECOVERY.
>>
>> - Andres

After a PITR shutdown, the db state should be *shut down in recovery*, try the
patch attached.

--
Regards
Junwang Zhao

Attachment Content-Type Size
0001-PITR-shutdown-should-not-report-error-by-pg_ctl.patch application/octet-stream 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-11-09 07:08:38 Re: A recent message added to pg_upgade
Previous Message Michael Paquier 2023-11-09 06:53:26 Re: pg_upgrade and logical replication