Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bf55I-0003fS-Tm for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Aug 2016 12:57:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bf55I-0007Mt-Bj for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Aug 2016 12:57:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bf534-0005mH-1i for pgsql-hackers@postgresql.org; Wed, 31 Aug 2016 12:55:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bf531-0005BT-GE for pgsql-hackers@postgresql.org; Wed, 31 Aug 2016 12:55:20 +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 u7VCtDB4027509; Wed, 31 Aug 2016 08:55:13 -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> <25082.1472563473@sss.pgh.pa.us> <28712.1472565639@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Wed, 31 Aug 2016 13:58:55 +0900" Date: Wed, 31 Aug 2016 08:55:13 -0400 Message-ID: <27508.1472648113@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 11:00 PM, Tom Lane wrote: >> Thinking about it some more ... what we actually need to prevent, AFAICS, >> is standby_mode becoming true in a standalone backend. > I have spent some time playing with that and you are right. Only > standby_mode = on is able trigger a failure here, and the first one is > in WaitForWALToBecomeAvailable(). I'd just put the check at the end of > readRecoveryCommandFile(), this will avoid extra thinking should > readRecoveryCommandFile() be moved around. That's unlikely to happen > but it is a cheap insurance. Pushed with minor adjustments --- I moved the check to be closer to existing sanity checks in readRecoveryCommandFile, tweaked the wording (the man page for postgres refers to --single as "single-user server" mode) and added an errcode. 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