From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: Reducing pg_ctl's reaction time
Date: Mon, 26 Jun 2017 16:49:07 -0400
Message-ID: <19812.1498510147@sss.pgh.pa.us> (raw)
In-Reply-To: <20170626203347.6efkdwiadyt33edy@alap3.anarazel.de>
References: <18444.1498428798@sss.pgh.pa.us>
<CAB7nPqTWWBEZ6NN_pbgmU=yn-HZNKGY3nAivvLSuLPe61n1KJw@mail.gmail.com>
<24992.1498504537@sss.pgh.pa.us>
<CAMkU=1xJW8e+CTotojOMBd-yzUvD0e_JZu2xHo=MnuZ4__m7Pg@mail.gmail.com>
<18520.1498508356@sss.pgh.pa.us>
<20170626202356.qybnpn5li2ke4ioc@alap3.anarazel.de>
<18890.1498508760@sss.pgh.pa.us>
<20170626203347.6efkdwiadyt33edy@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Andres Freund <andres@anarazel.de> writes:
> Arguably we could and should improve the logic when the server has
> started, right now it's pretty messy because we never treat a standby as
> up if hot_standby is disabled...
True. If you could tell the difference between "HS disabled" and "HS not
enabled yet" from pg_control, that would make pg_ctl's behavior with
cold-standby servers much cleaner. Maybe it *is* worth messing with the
contents of pg_control at this late hour.
My inclination for the least invasive fix is to leave the DBState
enum alone and add a separate hot-standby state field with three
values (disabled/not-yet-enabled/enabled). Then pg_ctl would start
probing the postmaster when it saw either DB_IN_PRODUCTION DBstate
or hot-standby-enabled. (It'd almost not have to probe the postmaster
at all, except there's a race condition that the startup process
will probably change the field a little before the postmaster gets
the word to open the gates.) On the other hand, if it saw
DB_IN_ARCHIVE_RECOVERY with hot standby disabled, it'd stop waiting.
Any objections to that design sketch? Do we need to distinguish
between master and slave servers in the when-to-stop-waiting logic?
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, jeff.janes@gmail.com, michael.paquier@gmail.com
Subject: Re: Reducing pg_ctl's reaction time
In-Reply-To: <19812.1498510147@sss.pgh.pa.us>
* 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