Re: Recovery bug - Mailing list pgsql-bugs

From Jeff Davis
Subject Re: Recovery bug
Date
Msg-id 1288022672.8516.801.camel@jdavis
Whole thread Raw
In response to Re: Recovery bug  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Recovery bug
List pgsql-bugs
On Mon, 2010-10-25 at 14:44 +0300, Heikki Linnakangas wrote:
> It seems we should use ReadRecord instead of the lower-level
> XLogPageRead function. One difference is that ReadRecord performs a
> bunch of sanity checks on the record, while XLogPageRead just reads the
> raw page. Extra sanity checking before removing backup_label seems like
> a good idea. Another difference is that in standby-mode, ReadRecord will
> retry until it succeeds. A standby server should keep retrying, even the
> very first record, until it succeeds, otherwise we have a change in
> behavior.

The reason I didn't use ReadRecord is because it sets a global variable
to point to the next location in the log, so that subsequent calls can
just pass NULL for the location.

It looks like the patch leaves the global variable pointing just after
the redo location rather than the checkpoint. I haven't tested your
patch yet, but it looks like some of the following code depends on
ReadRecord(NULL,...) fetching the record right after the checkpoint
record; so I think something else is required if you want to use
ReadRecord.

Regards,
    Jeff Davis

pgsql-bugs by date:

Previous
From: Brendan Jurd
Date:
Subject: Re: Segfault in 9.0 inlining SRF
Next
From: Tom Lane
Date:
Subject: Re: Segfault in 9.0 inlining SRF