From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Michael Paquier <michael.paquier@gmail.com>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: pg_ctl wait exit code (was Re: [COMMITTERS] pgsql: Additional tests for subtransactions in recovery)
Date: Mon, 1 May 2017 12:19:10 -0400
Message-ID: <f02aae4d-0063-7d73-ba35-74c608bbdb8c@2ndquadrant.com> (raw)
In-Reply-To: <CAB7nPqT5mFg=5=cPN0x1xbR_HOE=HFZeS4J=2C__MxRX6VBceg@mail.gmail.com>
References: <E1d3iXI-000657-AS@gemulon.postgresql.org>
<CAB7nPqT5mFg=5=cPN0x1xbR_HOE=HFZeS4J=2C__MxRX6VBceg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 4/27/17 08:41, Michael Paquier wrote:
> +$node_slave->promote;
> +$node_slave->poll_query_until('postgres',
> + "SELECT NOT pg_is_in_recovery()")
> + or die "Timed out while waiting for promotion of standby";
>
> This reminds me that we should really switch PostgresNode::promote to
> use the wait mode of pg_ctl promote, and remove all those polling
> queries...
I was going to say: This should all be obsolete already, because pg_ctl
promote waits by default.
However: Failure to complete promotion within the waiting time does not
lead to an error exit, so you will not get a failure if the promotion
does not finish. This is probably a mistake. Looking around pg_ctl, I
found that this was handled seemingly inconsistently in do_start(), but
do_stop() errors when it does not complete.
Possible patches for this attached.
Perhaps we need a separate exit code in pg_ctl to distinguish general
errors from did not finish within timeout?
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachments:
0001-pg_ctl-Make-failure-to-complete-operation-a-nonzero-.patch (invalid/octet-stream, 0B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, michael.paquier@gmail.com, simon@2ndquadrant.com, pgsql-hackers@postgresql.org
Subject: Re: pg_ctl wait exit code (was Re: [COMMITTERS] pgsql: Additional tests for subtransactions in recovery)
In-Reply-To: <f02aae4d-0063-7d73-ba35-74c608bbdb8c@2ndquadrant.com>
References: <E1d3iXI-000657-AS@gemulon.postgresql.org> <CAB7nPqT5mFg=5=cPN0x1xbR_HOE=HFZeS4J=2C__MxRX6VBceg@mail.gmail.com> <f02aae4d-0063-7d73-ba35-74c608bbdb8c@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox