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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages
Дата
Msg-id 17881.1389645273@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-bugs
Andres Freund <andres@2ndquadrant.com> writes:
> On 2014-01-13 15:19:06 -0500, Tom Lane wrote:
>> 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.

That sounds rather invasive to me, and more to the point it requires
fooling with code that doesn't have anything to do with WAL replay.

> 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.

It looks easy enough to me to support the desired behavior in
XLogReadBufferExtended.  I wasn't planning to support it in ReadBuffer
itself.  (Probably the path of least resistance is to define it as meaning
the same thing as RBM_NORMAL, so far as bufmgr.c is concerned.)

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages