Re: Clean shutdown and warm standby - Mailing list pgsql-hackers

From Guillaume Smet
Subject Re: Clean shutdown and warm standby
Date
Msg-id 1d4e0c10904090236k43339cbcldb13889507abef79@mail.gmail.com
Whole thread Raw
In response to Re: Clean shutdown and warm standby  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Clean shutdown and warm standby  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Thu, Apr 9, 2009 at 5:00 AM, Fujii Masao <masao.fujii@gmail.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


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Clean shutdown and warm standby
Next
From: Fujii Masao
Date:
Subject: Re: Clean shutdown and warm standby