Re: crash on 8.2 and cvshead - failed to add item to the - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: crash on 8.2 and cvshead - failed to add item to the
Date
Msg-id 45B8E5CD.8080409@enterprisedb.com
Whole thread Raw
In response to Re: crash on 8.2 and cvshead - failed to add item to the  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: crash on 8.2 and cvshead - failed to add item to the  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Heikki Linnakangas <heikki@enterprisedb.com> writes:
>> Hmm. There seems to be something wrong in the free space calculation in 
>> the algorithm for choosing the right split location. I'll dig deeper, 
>> unless someone beats me to it..
> 
> I seem to recall that that part of the code was changed recently, so you
> might try looking at the CVS history for hints.  This is probably
> recently introduced, else we'd have seen it reported before :-(

I'm afraid the bug has been there for ages, but the 90%-fillfactor on 
rightmost page patch made it much more likely to get triggered. With a 
50% or 67% target for splitting, there is a lot more wiggle room.

To see what's going on, I added some logs to the split code to print out 
the free space on both halves as calculated by findsplitloc, and the 
actual free space on the pages after split. I'm seeing a discrepancy of 
4 bytes on the right half; actual space free on right page after split 
is 4 bytes less than anticipated. That's on every split, not just in 
some corner cases. That's not a big deal, but I'll take a closer look 
tomorrow to see what's missing from the calculations.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Recursive Queries
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Proposal: allow installation of any contrib module