Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bej3L-0002qi-Tx for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2016 13:26:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bej3L-0000QW-CU for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2016 13:26:11 +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 1bej1w-0007DI-RB for pgsql-hackers@postgresql.org; Tue, 30 Aug 2016 13:24:44 +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 1bej1p-0002WK-JX for pgsql-hackers@postgresql.org; Tue, 30 Aug 2016 13:24:44 +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 u7UDOXSN025083; Tue, 30 Aug 2016 09:24:33 -0400 From: Tom Lane To: Michael Paquier cc: Bernd Helmle , Alvaro Herrera , Simon Riggs , PostgreSQL mailing lists Subject: Re: standalone backend PANICs during recovery In-reply-to: References: <20160402215748.GA136801@alvherre.pgsql> <12838.1471639801@sss.pgh.pa.us> <2086.1471711308@sss.pgh.pa.us> <2DA7350F7296B2A142272901@eje.land.credativ.lan> <23650.1472561302@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Tue, 30 Aug 2016 22:06:05 +0900" Date: Tue, 30 Aug 2016 09:24:33 -0400 Message-ID: <25082.1472563473@sss.pgh.pa.us> X-Pg-Spam-Score: -3.4 (---) 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 Michael Paquier writes: > On Tue, Aug 30, 2016 at 9:48 PM, Tom Lane wrote: >> Hm, StartupXLOG seems like a pretty random place to check that, especially >> since doing it there requires an extra stat() call. Why didn't you just >> make readRecoveryCommandFile() error out? > Well, the idea is to do the check before doing anything on PGDATA and > leave it intact, particularly the post-crash fsync(). I don't see anything very exciting between the beginning of StartupXLOG and readRecoveryCommandFile. In particular, doing the fsync seems like a perfectly harmless and maybe-good thing. If there were some operation with potentially bad side-effects in that range, it would be dangerous anyway because of the risk of readRecoveryCommandFile erroring out due to invalid contents of recovery.conf. This might be an argument for re-ordering what we're doing in StartupXLOG, but that seems like an independent discussion. 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