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

From Heikki Linnakangas
Subject Re: New trigger option of pg_standby
Date
Msg-id 49EC3B01.6050509@enterprisedb.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
List pgsql-hackers
Fujii Masao wrote:
> On Tue, Apr 14, 2009 at 2:41 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
>> I'd like to propose another simple idea; pg_standby deletes the
>> trigger file *whenever* the nextWALfile is a timeline history file.
>> A timeline history file is restored at the end of recovery, so it's
>> guaranteed that the trigger file is deleted whether nextWALfile
>> exists or not.
>>
>> A timeline history file is restored also at the beginning of
>> recovery, so the accidentally remaining trigger file is deleted
>> in early warm-standby as a side-effect of this idea.
> 
> Here is the revised patch as above.

I think we have gone off to an overly complicated solution. pg_standby 
shouldn't need to special-case history files, or know what order the 
server will ask for them.

What's wrong with just this: (ignoring the missing fast option)

--- a/contrib/pg_standby/pg_standby.c
+++ b/contrib/pg_standby/pg_standby.c
@@ -552,8 +552,6 @@ main(int argc, char **argv)                break;            case 't':           /* Trigger file */
              triggerPath = optarg;
 
-               if (CheckForExternalTrigger())
-                   exit(1);    /* Normal exit, with non-zero */                break;            case 'w':
/*Max wait time */                maxwaittime = atoi(optarg);
 

ie. only check and delete the trigger file once the server requests a 
file that doesn't exist.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Explicitly bind gettext to the correct encoding on Windows.
Next
From: Fujii Masao
Date:
Subject: Re: New trigger option of pg_standby