Re: GIN logging GIN_SEGMENT_UNMODIFIED actions? - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: GIN logging GIN_SEGMENT_UNMODIFIED actions?
Date
Msg-id CAHGQGwH+radEMOubXbkF0F+Ajdwat2Z53yhMa-7Xi7Ja7RL4qA@mail.gmail.com
Whole thread Raw
In response to Re: GIN logging GIN_SEGMENT_UNMODIFIED actions?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: GIN logging GIN_SEGMENT_UNMODIFIED actions?
List pgsql-hackers
On Wed, Aug 31, 2016 at 8:32 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Fujii Masao <masao.fujii@gmail.com> writes:
>> On Wed, Aug 31, 2016 at 12:10 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Hmm, comparing gin_desc() to ginRedoInsert() makes me think there are more
>>> problems there than that one.  Aren't the references to "payload" wrong
>>> in all three branches of that "if" construct, not just the middle one?
>
>> If we do this, the extra information like ginxlogInsertEntry->isDelete will
>> never be reported when the record has FPW.
>
> I'm happy to have it print whatever is there, but are you sure that the
> information is even there?  I thought that this chunk of the WAL record
> would get optimized away if we write an FPW image instead.

I was thinking that optimization logic was changed for logical decoding.
This understanding is right for heap, but not right for GIN, i.e., you're right,
such data chunk for GIN would be removed from WAL record if FPW is taken.
I applied your suggested changes into the patch. Patch attached.

Regards,

--
Fujii Masao

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Missing checks when malloc returns NULL...
Next
From: Simon Riggs
Date:
Subject: Re: Logical decoding slots can go backwards when used from SQL, docs are wrong