Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPbah-0001vj-Ga for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jun 2017 21:30:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dPbag-0007Be-IX for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jun 2017 21:30:38 +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 1dPbaf-0007BF-N9 for pgsql-hackers@postgresql.org; Mon, 26 Jun 2017 21:30:37 +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 1dPbac-0007VO-HY for pgsql-hackers@postgresql.org; Mon, 26 Jun 2017 21:30:37 +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 v5QLUUGU015167; Mon, 26 Jun 2017 17:30:30 -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: <20170626205853.ezhnmxpotdy3wokm@alap3.anarazel.de> References: <18444.1498428798@sss.pgh.pa.us> <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> Comments: In-reply-to Andres Freund message dated "Mon, 26 Jun 2017 13:58:53 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15165.1498512630.1@sss.pgh.pa.us> Date: Mon, 26 Jun 2017 17:30:30 -0400 Message-ID: <15166.1498512630@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: > It'd be quite possible to address the race-condition by moving the > updating of the control file to postmaster, to the > CheckPostmasterSignal(PMSIGNAL_BEGIN_HOT_STANDBY) block. That'd require > updating the control file from postmaster, which'd be somewhat ugly. No, I don't like that at all. Has race conditions against updates coming from the startup process. > Perhaps that indicates that field shouldn't be in pg_control, but in the > pid file? 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. 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