pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Sergey Konoplev <gray.ru@gmail.com>
Cc: matioli.matheus@gmail.com
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Cc: Maxim Boguk <maxim.boguk@gmail.com>
Cc: Максим Панченко <Panchenko@gw.tander.ru>
Cc: Сизов Сергей Павлович <sizov_sp@gw.tander.ru>
Subject: Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages
Date: Mon, 13 Jan 2014 22:40:22 +0100
Message-ID: <20140113214022.GD5838@awork2.anarazel.de> (raw)
In-Reply-To: <19552.1389649001@sss.pgh.pa.us>
References: <CAL_0b1s4QCkFy_55kk_8XWcJPs7wsgVWf8vn4=jXe6V4R7Hxmg@mail.gmail.com>
	<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>
	<19552.1389649001@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2014-01-13 16:36:41 -0500, Tom Lane wrote:
> Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> > Good point. Normally, we expect the checksum to match on all pages that 
> > we read during WAL replay, because full page writes will initialize any 
> > page that is modified to an untorn state, before it's ever read. But we 
> > can't rely on that in the extra read that btree_xlog_vacuum() does.
> 
> But it's not an "extra" read.  It's replicating a read that was done
> on the master in the btvacuumpage() scan.  AFAICS the only way to fail
> on the slave and not the master is if the slave has inconsistent data,
> in which case you're at hazard of failing anyway.

I tried to explain which scenario I see as dangerous nearby.

> >> Now, you could argue that that shouldn't be the case because we're only
> >> entering that codepath once STANDBY_SNAPSHOT_READY and you might be
> >> right...
> 
> > 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.
> 
> Huh?  Surely we're not letting queries in until we're consistent.

We don't, but STANDBY_SNAPSHOT_READY isn't the only variable controlling
that. It just determines whether we'd have the necessary visibility
information. The full check is:
	 */
	if (standbyState == STANDBY_SNAPSHOT_READY &&
		!LocalHotStandbyActive &&
		reachedConsistency &&
		IsUnderPostmaster)
{
...
		xlogctl->SharedHotStandbyActive = true;
...
		SendPostmasterSignal(PMSIGNAL_BEGIN_HOT_STANDBY);
}

So we need to mimick that.

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (36+ messages)  latest in thread

Message-ID: <20140113214022.GD5838@awork2.anarazel.de>
Permalink:  ../20140113214022.GD5838@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20140113214022.GD5838@awork2.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@2ndquadrant.com, tgl@sss.pgh.pa.us, hlinnakangas@vmware.com, gray.ru@gmail.com, matioli.matheus@gmail.com, maxim.boguk@gmail.com, Panchenko@gw.tander.ru, sizov_sp@gw.tander.ru
  Subject: Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages
  In-Reply-To: <20140113214022.GD5838@awork2.anarazel.de>
  References: <CAL_0b1s4QCkFy_55kk_8XWcJPs7wsgVWf8vn4=jXe6V4R7Hxmg@mail.gmail.com> <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> <19552.1389649001@sss.pgh.pa.us> <20140113214022.GD5838@awork2.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox