Re: [HACKERS] Setting pd_lower in GIN metapage - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Setting pd_lower in GIN metapage
Date
Msg-id 14812.1504756756@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Setting pd_lower in GIN metapage  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] Setting pd_lower in GIN metapage
List pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> writes:
> On Thu, Sep 7, 2017 at 5:49 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I looked briefly at these patches.  I'm not sure that it's safe for the
>> mask functions to assume that meta pages always have valid pd_lower.
>> What happens when replaying log data concerning an old index that doesn't
>> have that field filled?

> There will be inconsistency between the pages, and the masking check
> will complain.

That doesn't seem like a pleasant outcome to me.  The WAL consistency
check code is supposed to complain if there's some kind of replication
or replay failure, and this cannot be categorized as either.

The idea I'd had was to apply the masking only if pd_lower >=
SizeOfPageHeaderData, or if you wanted to be stricter, only if
pd_lower != 0.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: [HACKERS] [BUGS] Bug in Physical Replication Slots (at least9.5)?
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Setting pd_lower in GIN metapage