Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint?

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint?
Date: 2021-12-08 01:20:36
Message-ID: CALj2ACXm0nHmuKzP2FSjHMSW6N9=qaYudLH7wDSJ5_+P0bcz2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 8, 2021 at 2:50 AM Bossart, Nathan <bossartn(at)amazon(dot)com> wrote:
>
> On 12/7/21, 12:10 AM, "Bharath Rupireddy" <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> > Here's a patch that I've come up with. Please see if this looks okay
> > and let me know if we want to take it forward so that I can add a CF
> > entry.
>
> Overall, the patch seems reasonable to me.

Thanks for reviewing this.

> + case DB_IN_END_OF_RECOVERY_CHECKPOINT:
> + ereport(LOG,
> + (errmsg("database system was interrupted while in end-of-recovery checkpoint at %s",
> + str_time(ControlFile->time))));
> + break;
>
> I noticed that some (but not all) of the surrounding messages say
> "last known up at" the control file time. I'm curious why you chose
> not to use that phrasing in this case.

If state is DB_IN_END_OF_RECOVERY_CHECKPOINT that means the db was
interrupted while in end-of-recovery checkpoint, so I used the
phrasing similar to DB_IN_CRASH_RECOVERY and DB_IN_ARCHIVE_RECOVERY
cases. I would like to keep it as-is (in the v1 patch) unless anyone
has other thoughts here?
(errmsg("database system was interrupted while in recovery at %s",
(errmsg("database system was interrupted while in recovery at log time %s",

I added a CF entry here - https://commitfest.postgresql.org/36/3442/

Regards,
Bharath Rupireddy.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-12-08 01:20:46 Re: Should we improve "PID XXXX is not a PostgreSQL server process" warning for pg_terminate_backend(<<postmaster_pid>>)?
Previous Message Tomas Vondra 2021-12-08 00:23:45 Re: logical decoding and replication of sequences