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 21:26:00 +0100
Message-ID: <20140113202600.GB14861@awork2.anarazel.de> (raw)
In-Reply-To: <17450.1389644346@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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 2014-01-13 15:19:06 -0500, Tom Lane wrote:
> >> ISTM we can just use RBM_ZERO_ON_ERROR instead of RBM_NORMAL.
>
> > That'd be horrendously dangerous. It would silently zap any page with
> > any error on it. But we could add a new ReadBufferMode that returns
> > InvalidBuffer on error, without zeroing the page.
>
> The important point is not just that it not damage the page, but that
> it not log it as invalid. I concur that the right fix requires a
> new operating mode for XLogReadBufferExtended, perhaps RBM_NORMAL_ZERO_OK.
> I think the spec for this should be that if the page doesn't exist or
> contains zeroes, we return InvalidBuffer without logging the page number
> as invalid. The doesn't-exist case is justified by the expectation that
> there will be a later RBM_NORMAL call for a larger page number, which will
> result in a suitable complaint if the page range isn't there.
That's a sensible way to go, yes. But I wonder if we wouldn't end up
with less complicated code if we added a variant of ReadBuffer that only
returns a buffer from cache if already present in s_b.
I started to prototype something like RBM_NORMAL_ZERO_OK shortly after
Heikki's message and it seems to quickly turn a bit ugly because the
surrounding code isn't really ready to deal with not returning a
buffer. And for the purpose of that redo routine, that'd actually be
better.
> Will go fix this if there's not any objection to that plan.
Fine with me!
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
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: <20140113202600.GB14861@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>
* 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