Re: Setting pd_lower in GIN metapage

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting pd_lower in GIN metapage
Date: 2017-06-23 02:17:50
Message-ID: b36de5cc-ba48-4b7c-1544-7bc7bee4e800@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2017/06/23 10:22, Masahiko Sawada wrote:
> On Thu, Jun 22, 2017 at 6:55 PM, Amit Langote
> <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> On 2017/06/22 16:56, Michael Paquier wrote:
>>> Did you check this patch with wal_consistency_checking? I am getting
>>> failures so your patch does not have the masking of GIN pages
>>> completely right:
>>> FATAL: inconsistent page found, rel 1663/16385/28133, forknum 0, blkno 0
>>> CONTEXT: WAL redo at 0/39379EB8 for Gin/UPDATE_META_PAGE:
>>> That's easily reproducible with installcheck and a standby replaying
>>> the changes. I did not look at the code in details to see what you may
>>> be missing here.
>>
>> Oh, wasn't sure about the gin_mask() changes myself. Thanks for checking.
>>
>> Actually, the WAL consistency check fails even without patching
>> gin_mask(), so the problem may be with the main patch itself. That is,
>> the patch needs to do something else other than just teaching
>> GinInitMetabuffer() to initialize pd_lower. Will look into that.
>>
>
> I've not read the code deeply but I guess we should use
> GinInitMetabuffer() in ginRedoUpdateMetapage() instead of
> GinInitPage(). Maybe also GinInitPage() in ginRedoDeleteListPages() is
> the same.

That was it, thanks for the pointer.

Attached updated patch, which I confirmed, passes wal_consistency_check = gin.

Thanks,
Amit

Attachment Content-Type Size
set-gin-metapage-pd_lower-v2.patch text/plain 2.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-06-23 02:40:17 Re: Broken hint bits (freeze)
Previous Message Tom Lane 2017-06-23 02:10:54 Can ICU be used for a database's default sort order?