Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPbjY-0002OM-8Q for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jun 2017 21:39:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dPbjX-0001Nm-JZ for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jun 2017 21:39:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dPbi0-000770-Pe for pgsql-hackers@postgresql.org; Mon, 26 Jun 2017 21:38:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dPbhx-0007eN-KM for pgsql-hackers@postgresql.org; Mon, 26 Jun 2017 21:38:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v5QLc3dt015733; Mon, 26 Jun 2017 17:38:03 -0400 From: Tom Lane To: Andres Freund cc: Jeff Janes , Michael Paquier , PostgreSQL mailing lists Subject: Re: Reducing pg_ctl's reaction time In-reply-to: <20170626213414.ejcesidei2hv4h5x@alap3.anarazel.de> References: <24992.1498504537@sss.pgh.pa.us> <18520.1498508356@sss.pgh.pa.us> <20170626202356.qybnpn5li2ke4ioc@alap3.anarazel.de> <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> Comments: In-reply-to Andres Freund message dated "Mon, 26 Jun 2017 14:34:14 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15731.1498513083.1@sss.pgh.pa.us> Date: Mon, 26 Jun 2017 17:38:03 -0400 Message-ID: <15732.1498513083@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > On 2017-06-26 17:30:30 -0400, Tom Lane wrote: >> No, I don't like that at all. Has race conditions against updates >> coming from the startup process. > You'd obviously have to take the appropriate locks. I think the issue > here is less race conditions, and more that architecturally we'd > interact with shmem too much. Uh, we are *not* taking any locks in the postmaster. >> Yeah, that would be a different way to go at it. The postmaster would >> probably just write the state of the hot_standby GUC to the file, and >> pg_ctl would have to infer things from there. > I'd actually say we should just mirror the existing > #ifdef USE_SYSTEMD > if (!EnableHotStandby) > sd_notify(0, "READY=1"); > #endif > with corresponding pidfile updates - doesn't really seem necessary for > pg_ctl to do more? Hm. Take that a bit further, and we could drop the connection probes altogether --- just put the whole responsibility on the postmaster to show in the pidfile whether it's ready for connections or not. 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