Re: pg_ctl promote wait - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: pg_ctl promote wait
Date
Msg-id CAHGQGwFoUz3hmRPn2wBCAvKwkdD3DQyeFkcg_HQBhk_bgzr16Q@mail.gmail.com
Whole thread Raw
In response to Re: pg_ctl promote wait  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: pg_ctl promote wait
Re: pg_ctl promote wait
List pgsql-hackers
On Thu, Feb 18, 2016 at 5:45 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> On 18 February 2016 at 08:33, Andres Freund <andres@anarazel.de> 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.

+1

>> > How could pg_ctl determine when the promotion has finished?
>>
>> How about looking into pg_control? ControlFileData->state ought to have
>> the correct information.
>
>
> +1

One concern is that there can be a "time" after the pg_control's state
is changed to DB_IN_PRODUCTION and before the server is able to
start accepting normal (not read-only) connections. So if users try to
start write transaction just after pg_ctl promote -w ends, they might
get an error because the server is still in recovery, i.e., the startup
process is running.

Regards,

-- 
Fujii Masao



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: checkpointer continuous flushing - V16
Next
From: Bruce Momjian
Date:
Subject: Re: PostgreSQL Audit Extension