On Thu, Apr 9, 2009 at 5:00 AM, Fujii Masao <masao.fu...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers