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

From Michael Paquier
Subject Re: WAL consistency check facility
Date
Msg-id CAB7nPqS56Yc+be5pMe+_8UPyJQscUOZ1+yDFwApvuN4O+hyxfg@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  (Kuntal Ghosh <kuntalghosh.2007@gmail.com>)
List pgsql-hackers
On Thu, Nov 3, 2016 at 6:15 PM, Kuntal Ghosh <kuntalghosh.2007@gmail.com> wrote:
> Actually, I just verified that bimg_info is not even valid if
> has_image is not set.
> In DecodeXLogRecord, we initialize bimg_info only when has_image flag
> is set. So, keeping them
> separate doesn't look a good approach to me. If we keep them separate,
> the output
> of the following assert is undefined:
> Assert(XLogRecHasBlockImage(record, block_id) ||
> !XLogRecBlockImageApply(record, block_id)).
>
> Thoughts??

Yes, that's exactly the reason why we should keep both macros as
checking for separate things: apply implies that has_image is set and
that's normal, hence we could use sanity checks by just using those
macros and not propagating xlogreader.h.
-- 
Michael



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: WAL consistency check facility
Next
From: Kuntal Ghosh
Date:
Subject: Re: WAL consistency check facility