Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>, matioli(dot)matheus(at)gmail(dot)com, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>, Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>, Максим Панченко <Panchenko(at)gw(dot)tander(dot)ru>, Сизов Сергей Павлович <sizov_sp(at)gw(dot)tander(dot)ru>
Subject: Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages
Date: 2014-01-13 20:26:00
Message-ID: 20140113202600.GB14861@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-01-13 20:34:33 Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages
Previous Message Tom Lane 2014-01-13 20:19:06 Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-01-13 20:26:46 Re: Planning time in explain/explain analyze
Previous Message Robert Haas 2014-01-13 20:24:27 Re: [PATCH] Negative Transition Aggregate Functions (WIP)