Re: pg_ctl promote wait - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: pg_ctl promote wait
Date
Msg-id 1d761bbc-27f7-2e5f-678f-213232e94cfb@2ndquadrant.com
Whole thread Raw
In response to Re: pg_ctl promote wait  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: pg_ctl promote wait  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On 8/5/16 12:14 AM, Michael Paquier wrote:
> In do_stop, this patches makes the wait happen for a maximum of
> wait_seconds * 2, once when getting the control file information, and
> once when waiting for the server to shut down.

That's not how I read it.  get_controlfile() will decrease the
wait_seconds argument by how much wait time it has used.  The wait for
shutdown will then only use as much seconds as are left.

> This is not a good
> idea, and the idea of putting a wait argument in get_controlfile does
> not seem a good interface to me. I'd rather see get_controlfile be
> extended with a flag saying no_error_on_failure and keep the wait
> logic within pg_ctl.

I guess we could write a wrapper function in pg_ctl that encapsulated
the wait logic.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Heap WARM Tuples - Design Draft
Next
From: Bruce Momjian
Date:
Subject: Re: Heap WARM Tuples - Design Draft