Re: New trigger option of pg_standby - Mailing list pgsql-hackers

From Guillaume Smet
Subject Re: New trigger option of pg_standby
Date
Msg-id 1d4e0c10904130321i14906f08g1d8863dfe0b6ff7@mail.gmail.com
Whole thread Raw
In response to Re: New trigger option of pg_standby  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: New trigger option of pg_standby  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Mon, Apr 13, 2009 at 7:52 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
> 1. the trigger file containing "smart" is created.
> 2. pg_standby is executed.
>    2-1. nextWALfile is restored.
>    2-2. the trigger file is deleted because nextWALfile+1 doesn't exist.
> 3. the restored nextWALfile is applied.
> 4. pg_standby is executed again to restore nextWALfile+1.

I don't think it should happen. IMHO, it's an acceptable compromise to
replay all the WAL files present when I created the trigger file. So
if I have the smart shutdown trigger file and I don't have any
nextWALfile+1, I can remove the trigger file and stop the recovery:
pg_standby won't be executed again after that, even if a nextWALfile+1
appeared while replaying the previous WAL file.

That said, stupid question: do we have a way to know the nextWALfile+1
name to test if it exists? nextWALfile is transmitted through the
restore_command API and I'm wondering if we can have nextWALfile+1
name without changing the restore_command API.

-- 
Guillaume


pgsql-hackers by date:

Previous
From: Itagaki Takahiro
Date:
Subject: Re: Solution of the file name problem of copy on windows.
Next
From: Fujii Masao
Date:
Subject: Re: New trigger option of pg_standby