pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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: Tue, 27 Jun 2017 16:26:15 -0400
Message-ID: <20871.1498595175@sss.pgh.pa.us> (raw)
In-Reply-To: <20170627200544.2czwjtdtyy4gr4sv@alap3.anarazel.de>
References: <18890.1498508760@sss.pgh.pa.us>
	<20170626203347.6efkdwiadyt33edy@alap3.anarazel.de>
	<19812.1498510147@sss.pgh.pa.us>
	<20170626205853.ezhnmxpotdy3wokm@alap3.anarazel.de>
	<15166.1498512630@sss.pgh.pa.us>
	<20170626213414.ejcesidei2hv4h5x@alap3.anarazel.de>
	<15732.1498513083@sss.pgh.pa.us>
	<20170626215018.2fudv2aha5rkkg4r@alap3.anarazel.de>
	<17327.1498515236@sss.pgh.pa.us>
	<15323.1498589958@sss.pgh.pa.us>
	<20170627200544.2czwjtdtyy4gr4sv@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andres Freund <andres@anarazel.de> writes:
> On 2017-06-27 14:59:18 -0400, Tom Lane wrote:
>> If we decide that it has to wait for v11,
>> I'd address Jeff's complaint by hacking the loop behavior in
>> test_postmaster_connection, which'd be ugly but not many lines of code.

> Basically increasing the wait time over time?

I was thinking of just dropping back to once-per-second after a couple
of seconds, with something along the lines of this in place of the
existing sleep at the bottom of the loop:

	if (i >= 2 * WAITS_PER_SEC)
	{
	    pg_usleep(USEC_PER_SEC);
	    i += WAITS_PER_SEC - 1;
	}
	else
	    pg_usleep(USEC_PER_SEC / WAITS_PER_SEC);


> The 8-space thing in multiple places is a bit ugly.  How about having a
> a bunch of constants declared in one place? Alternatively make it
> something like: status: $c, where $c is a one character code for the
> various states?

Yeah, we could add the string values as macros in miscadmin.h, perhaps.
I don't like the single-character idea --- if we do expand the number of
things reported this way, that could get restrictive.

			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



view thread (29+ messages)  latest in thread

Message-ID: <20871.1498595175@sss.pgh.pa.us>
Permalink:  ../20871.1498595175@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20871.1498595175@sss.pgh.pa.us

 · 

reply

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: <20871.1498595175@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