Re: GIN logging GIN_SEGMENT_UNMODIFIED actions?

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GIN logging GIN_SEGMENT_UNMODIFIED actions?
Date: 2016-08-30 07:49:30
Message-ID: CAHGQGwHHX9RHWwpF6XMJATda5-0=52K53KGE19UvHG9Pn=SwDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 30, 2016 at 3:13 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Tue, Aug 30, 2016 at 3:39 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>>> ISTM that the cause of this issue is that gin_desc() uses XLogRecGetData() to
>>> extract ginxlogVacuumDataLeafPage data from XLOG_GIN_VACUUM_DATA_LEAF_PAGE
>>> record. Since it's registered by XLogRegisterBufData() in
>>> ginVacuumPostingTreeLeaf(),
>>> XLogRecGetBlockData() should be used, instead. Patch attached. Thought?
>>
>> I think we probably have more issues than that. See for example
>> https://www.postgresql.org/message-id/flat/20160826072658.15676.7628%40wrigleys.postgresql.org
>>
>> which clearly shows that the replay logic is seeing something wrong too:
>>
>> 2016-08-26 06:01:50 UTC FATAL: unexpected GIN leaf action: 0
>> 2016-08-26 06:01:50 UTC CONTEXT: xlog redo Insert item, node:
>> 1663/16387/33108 blkno: 6622 isdata: T isleaf: T 3 segments: 2 (add 0 items)
>> 0 unknown action 0 ???
>>
>> If it were just a matter of gin_desc() being wrong, we'd not have
>> gotten such a failure. (Which is not to say that gin_desc() isn't
>> wrong; it may well be.)
>
> Yeah, I got the pg_xlogdump issue while I was trying to reproduce
> the above reported problem. Fixing pg_xlogdump would be helpful for
> the analysis of that problem.

Attached is the updated version of the patch.

I found that pg_xlogdump code for XLOG_GIN_INSERT record with
GIN_INSERT_ISLEAF flag has the same issue, i.e.,
"unknown action 0" error is thrown for that record.
The latest patch fixes this.

Regards,

--
Fujii Masao

Attachment Content-Type Size
gin-bug_v2.patch text/x-patch 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2016-08-30 08:08:49 Re: Missing checks when malloc returns NULL...
Previous Message Maksim Milyutin 2016-08-30 07:34:43 Re: [WIP] Patches to enable extraction state of query execution from external session