Re: WAL consistency check facility - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: WAL consistency check facility
Date
Msg-id CAB7nPqQfgs2d6wExshL1zBP-FCQ8Gd+3awLdBHMyqt+rYX4QYA@mail.gmail.com
Whole thread Raw
In response to Re: WAL consistency check facility  (Kuntal Ghosh <kuntalghosh.2007@gmail.com>)
Responses Re: WAL consistency check facility
List pgsql-hackers
On Wed, Sep 14, 2016 at 2:56 PM, Kuntal Ghosh
<kuntalghosh.2007@gmail.com> wrote:
> Master
> ---------------
> - If wal_consistency check is enabled or needs_backup is set in
> XLogRecordAssemble(), we do a fpw.
> - If a fpw is to be done, then fork_flags is set with BKPBLOCK_HAS_IMAGE,
> which in turns set has_image flag while decoding the record.
> - If a fpw needs to be restored during redo, i.e., needs_backup is true,
> then bimg_info is set with BKPIMAGE_IS_REQUIRED_FOR_REDO.

Here that should be if wal_consistency is true, no?

> Standby
> ---------------
> - In XLogReadBufferForRedoExtended(), if both XLogRecHasBlockImage() and
> XLogRecHasBlockImageForRedo()(added by me*) return true, we restore the
> backup image.
> - In checkConsistency, we only check if XLogRecHasBlockImage() returns true
> when wal_consistency check is enabled for this rmid.

My guess would have been that you do not need to check anymore for
wal_consistency in checkConsistency, making the GUC value only used on
master node.

> *XLogRecHasBlockImageForRedo() checks whether bimg_info is set with
> BKPIMAGE_IS_REQUIRED_FOR_REDO.

Yes, that's more or less what you should have.
-- 
Michael



pgsql-hackers by date:

Previous
From: Kuntal Ghosh
Date:
Subject: Re: WAL consistency check facility
Next
From: Tom Lane
Date:
Subject: Re: kqueue