Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2scH-00089s-W3 for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Jan 2014 01:16:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W2scG-0000Q1-Go for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Jan 2014 01:16:28 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2sc9-0000F2-3R for pgsql-bugs@postgresql.org; Tue, 14 Jan 2014 01:16:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2sc6-0001r2-SJ for pgsql-bugs@postgresql.org; Tue, 14 Jan 2014 01:16: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 s0E1FxuJ025049; Mon, 13 Jan 2014 20:15:59 -0500 From: Tom Lane To: Andres Freund cc: Heikki Linnakangas , Sergey Konoplev , matioli.matheus@gmail.com, pgsql-bugs , Maxim Boguk , =?utf-8?B?0JzQsNC60YHQuNC8INCf0LDQvdGH0LXQvdC60L4=?= , =?utf-8?B?0KHQuNC30L7QsiDQodC10YDQs9C10Lkg0J/QsNCy0LvQvtCy0LjRhw==?= Subject: Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages In-reply-to: <20140113220440.GE5838@awork2.anarazel.de> References: <20140106134815.GE28320@alap2.anarazel.de> <52CABF3E.2050004@vmware.com> <17450.1389644346@sss.pgh.pa.us> <20140113202600.GB14861@awork2.anarazel.de> <52D44F40.1000803@vmware.com> <20140113210245.GD14861@awork2.anarazel.de> <52D45AD7.9080406@vmware.com> <20140113220440.GE5838@awork2.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 13 Jan 2014 23:04:40 +0100" Date: Mon, 13 Jan 2014 20:15:59 -0500 Message-ID: <25048.1389662159@sss.pgh.pa.us> X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Andres Freund writes: > On 2014-01-13 23:29:59 +0200, Heikki Linnakangas wrote: >> I don't think that saves us. standbyMode can be STANDBY_SNAPSHOT_READY, >> before we reach consistency. Adding a check for reachedConsistency, though, >> ought to fix it. > Maybe we should just put LocalHotStandbyActive into xlog_internal.h? > That'd be enough for the startup process. Or alternatively add a check > for EnableHotStandby into HotStandbyActive() so we don't take the > spinlock if it's not enabled? After a little bit of research, I propose that we add a function like this in xlog.c: /* * Like HotStandbyActive(), but to be used only in WAL replay code, * where we don't need to ask any other process what the state is. */ bool HotStandbyActiveStartup(void) { Assert(AmStartupProcess()); return LocalHotStandbyActive; } Any objections? Bikeshedding on the name? regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs