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

Поиск
Список
Период
Сортировка
Искать
От
Bharath Rupireddy
Тема
Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint?
Дата
Msg-id
CALj2ACVvy+06hv7HocOFAHEBZWxLbc-t_61axdCUq9NaR2-c0Q@mail.gmail.com
Список
Дерево обсуждения
Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? "Bossart, Nathan" <bossartn@amazon.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? "Bossart, Nathan" <bossartn@amazon.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? "Bossart, Nathan" <bossartn@amazon.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? "Bossart, Nathan" <bossartn@amazon.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? "Bossart, Nathan" <bossartn@amazon.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Jaime Casanova <jcasanov@systemguards.com.ec>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Michael Paquier <michael@paquier.xyz>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? "Bossart, Nathan" <bossartn@amazon.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Michael Paquier <michael@paquier.xyz>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Michael Paquier <michael@paquier.xyz>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Michael Paquier <michael@paquier.xyz>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Michael Paquier <michael@paquier.xyz>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Nathan Bossart <nathandbossart@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Michael Paquier <michael@paquier.xyz>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Michael Paquier <michael@paquier.xyz>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Nathan Bossart <nathandbossart@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Michael Paquier <michael@paquier.xyz>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint? Michael Paquier <michael@paquier.xyz>
Hi,

While the database is performing end-of-recovery checkpoint, the
control file gets updated with db state as "shutting down" in
CreateCheckPoint (see the code snippet at [1]) and at the end it sets
it back to "shut down" for a brief moment and then finally to "in
production". If the end-of-recovery checkpoint takes a lot of time or
the db goes down during the end-of-recovery checkpoint for whatever
reasons, the control file ends up having the wrong db state.

Should we add a new db state something like
DB_IN_END_OF_RECOVERY_CHECKPOINT/"in end-of-recovery checkpoint" or
something else to represent the correct state?

Thoughts?

[1]
void
CreateCheckPoint(int flags)
{

    /*
     * An end-of-recovery checkpoint is really a shutdown checkpoint, just
     * issued at a different time.
     */
    if (flags & (CHECKPOINT_IS_SHUTDOWN | CHECKPOINT_END_OF_RECOVERY))
        shutdown = true;
    else
        shutdown = false;

    if (shutdown)
    {
        LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
        ControlFile->state = DB_SHUTDOWNING;
        UpdateControlFile();
        LWLockRelease(ControlFileLock);
    }

    if (shutdown)
        ControlFile->state = DB_SHUTDOWNED;

Regards,
Bharath Rupireddy.


В списке pgsql-hackers по дате отправления
От: Bharath Rupireddy
Дата:
От: Euler Taveira
Дата:
FAQ