Re: pg_ctl promote wait - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: pg_ctl promote wait
Date
Msg-id 56C76394.1040604@gmx.net
Whole thread Raw
In response to Re: pg_ctl promote wait  (Andres Freund <andres@anarazel.de>)
Responses Re: pg_ctl promote wait  (Andres Freund <andres@anarazel.de>)
Re: pg_ctl promote wait  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2/18/16 3:33 AM, Andres Freund wrote:
> Hi,
> 
> On 2016-02-17 21:47:50 -0500, Peter Eisentraut wrote:
>> It would be nice if pg_ctl promote supported the -w (wait) option.
>>
>> How could pg_ctl determine when the promotion has finished?
> 
> How about looking into pg_control? ControlFileData->state ought to have
> the correct information.

Is it safe to read pg_control externally without a lock?  pg_controldata
will just report a CRC error and proceed, and if you're not sure you can
just run it again.  But if a promotion fails every so often because of
concurrent pg_control writes, that would make this feature annoying.




pgsql-hackers by date:

Previous
From: Josh berkus
Date:
Subject: Re: about google summer of code 2016
Next
From: Peter Eisentraut
Date:
Subject: Re: pg_ctl promote wait