Re: Clean shutdown and warm standby

From: Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Subject: Re: Clean shutdown and warm standby
Date: 2009-04-09 09:36:23
Message-ID: 1d4e0c10904090236k43339cbcldb13889507abef79@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 9, 2009 at 5:00 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> RequestXLogSwitch() doesn't wait until the switched WAL file has
> actually been archived. So, some WAL files still may not exist in
> the standby server also after clean shutdown of the primary.

Thanks for your comment.

RequestXLogSwitch() doesn't wait for archiving but the shutdown
process takes care of it AFAICS.

As far as I understand the shutdown code, we have the following
sequence (I just explain here the steps involved in the XLog and
archiver shutdown):
- postmaster.c line 2693: PM_WAIT_BACKENDS state: we start the
bgwriter and shut it down. It calls ShutdownXLog which creates the
shutdown checkpoint and, with my patch, switch to a new XLog file.
Then we are in PM_SHUTDOWN state.
- postmaster.c line 2244: the reaper is called for the bgwriter child
just shutdown and wakens the archiver one last time: the archive
command is executed for our last XLog file.

Did I miss something?

--
Guillaume

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2009-04-09 09:47:07 Re: Clean shutdown and warm standby
Previous Message Fujii Masao 2009-04-09 03:00:32 Re: Clean shutdown and warm standby