Re: pg_ctl failover Re: Latches, signals, and waiting - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: pg_ctl failover Re: Latches, signals, and waiting
Date
Msg-id 20110131.130659.856152966720343416.t-ishii@sraoss.co.jp
Whole thread Raw
In response to Re: pg_ctl failover Re: Latches, signals, and waiting  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
> On Mon, Jan 31, 2011 at 12:35 PM, Tatsuo Ishii <ishii@postgresql.org> wrote:
>>> If the "pg_ctl promote" patch will have been committed, I recommend that
>>> the C function should send the signal to the startup process rather than
>>> creating the trigger file. Because the trigger file is checked every for 5s,
>>> which would lengthen the failover time by an average 2.5s.
>>
>> Ok, probably I could make the function smart enough to signal or not
>> by looking at the PostgreSQL version.
>>
>> BTW is it possible to export following variable in xlog.c?
>>
>> static char *TriggerFile = NULL;
>>
>> That would make coding of the C function lot easier.
> 
> If you change the function so that it sends the signal or call
> system("pg_ctl promote"), exporting that variable seems to
> be unnecessary. Because pg_ctl promote can promote
> the server even if trigger_file is not supplied. You don't need
> to check whether trigger_file is set or not, in the C function.

True.

BTW for 9.0, perhaps copy&paste parseRecoveryCommandFileLine() from
xlog.c into the C function is the only way to go.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: pg_ctl failover Re: Latches, signals, and waiting
Next
From: Shigeru HANADA
Date:
Subject: Re: review: FDW API