Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bejb3-0005nF-A7 for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2016 14:01:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bejb1-0002sX-T1 for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2016 14:00:59 +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 1bejb0-0002qB-QD for pgsql-hackers@postgresql.org; Tue, 30 Aug 2016 14:00:58 +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 1bejau-0004sq-KK for pgsql-hackers@postgresql.org; Tue, 30 Aug 2016 14:00:57 +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 u7UE0d19028713; Tue, 30 Aug 2016 10:00:39 -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> Comments: In-reply-to Michael Paquier message dated "Tue, 30 Aug 2016 22:35:02 +0900" Date: Tue, 30 Aug 2016 10:00:39 -0400 Message-ID: <28712.1472565639@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: > Does the attached suit better then? Thinking about it some more ... what we actually need to prevent, AFAICS, is standby_mode becoming true in a standalone backend. If you don't set that, then the process will do PITR recovery, but I'm not aware that there is any problem with running that standalone, and maybe it's useful to allow it for debugging purposes. So I'm thinking more like /* * Check for recovery control file, and if so set up state for offline * recovery */ readRecoveryCommandFile(); + /* + * We don't support standby_mode in standalone backends; that + * requires other processes such as WAL receivers to be alive. + */ + if (StandbyModeRequested && !IsUnderPostmaster) + ereport(FATAL, ...); + /* * Save archive_cleanup_command in shared memory so that other processes * can see it. */ or we could put the check near the bottom of readRecoveryCommandFile. Not sure which placement is clearer. 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