Re: Suspicious check (src/backend/access/gin/gindatapage.c) - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Suspicious check (src/backend/access/gin/gindatapage.c)
Date
Msg-id CAB7nPqRbLahnsPE7fXwaR14Rqa0H87WAJPH70cGWRwg5msLiTg@mail.gmail.com
Whole thread Raw
In response to Suspicious check (src/backend/access/gin/gindatapage.c)  (Gaetano Mendola <mendola@gmail.com>)
Responses Re: Suspicious check (src/backend/access/gin/gindatapage.c)  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
On Fri, Sep 12, 2014 at 7:35 AM, Gaetano Mendola <mendola@gmail.com> wrote:
> At line 650 I can read:
>
>  if ((leaf->lsize - segsize) - (leaf->lsize - segsize) < BLCKSZ / 4)
>          break;
>
> I believe one of the two should be leaf->rsize
Yes this condition is broken. Shouldn't it be that instead when
appending items at the end of a page?
if ((leaf->lsize - segsize) - (leaf->rsize + segsize) < BLCKSZ / 4)
This has been introduced by 36a35c5 and should be backpatched to 9.4.
Regards,
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: Re: [v9.5] Custom Plan API
Next
From: Josh Berkus
Date:
Subject: Re: jsonb format is pessimal for toast compression