Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-31 Thread Heikki Linnakangas
Tom Lane wrote: Are you still concerned about the PageGetFreeSpace issue? Not anymore. The failure case I had in mind was not being able to find any valid split points when a page is full of max-sized index tuples. On a closer look, that doesn't seem to be a problem. Even though

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-27 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] 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 think I found it. The page splitting code didn't take into account

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-26 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas [EMAIL PROTECTED] writes: 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. But that patch has been there for ages too; the only new thing in 8.2 is that the fillfactor is

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-26 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] writes: Tom Lane wrote: I'm still wondering why the bug isn't seen in 8.1. The hardcoded fillfactor was 90% when building an index, and that's still the default. However, when inserting to an existing index, the fillfactor on the rightmost page was 2/3.

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-26 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas [EMAIL PROTECTED] writes: 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

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-26 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] writes: IMHO the right fix is to modify PageGetFreeSpace not to do the subtraction, it's a hack anyway, but that means we have to go through and fix every caller of it. Or we can add a new PageGetReallyFreeSpace function and keep the old one for

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the left sibling

2007-01-25 Thread Gregory Stark
Joe Conway [EMAIL PROTECTED] writes: psql:/home/jconway/pgsql/das_data_load_failure2.sql:419: PANIC: failed to add item to the left sibling for pk_status_log_2007_01_4_10 Was this preceded by a WARNING? Was the server running with a log_min_messages low enough to log WARNINGs? I probably

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-25 Thread Stefan Kaltenbrunner
Gregory Stark wrote: Joe Conway [EMAIL PROTECTED] writes: psql:/home/jconway/pgsql/das_data_load_failure2.sql:419: PANIC: failed to add item to the left sibling for pk_status_log_2007_01_4_10 Was this preceded by a WARNING? Was the server running with a log_min_messages low enough to log

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-25 Thread Joe Conway
Stefan Kaltenbrunner wrote: Gregory Stark wrote: Joe Conway [EMAIL PROTECTED] writes: psql:/home/jconway/pgsql/das_data_load_failure2.sql:419: PANIC: failed to add item to the left sibling for pk_status_log_2007_01_4_10 Was this preceded by a WARNING? Was the server running with a

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-25 Thread Heikki Linnakangas
Joe Conway wrote: We just came upon a crash bug in Postgres = 8.2. The attached standalone script (just needs a database with plpgsql installed) reproduces the crash for me on 32-bit machines (i686) but NOT on 64 bit machines (x86_64), for Postgres 8.2 and cvs-head, but not on 8.1. We've

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-25 Thread Heikki Linnakangas
Heikki Linnakangas wrote: Joe Conway wrote: We just came upon a crash bug in Postgres = 8.2. The attached standalone script (just needs a database with plpgsql installed) reproduces the crash for me on 32-bit machines (i686) but NOT on 64 bit machines (x86_64), for Postgres 8.2 and cvs-head,

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-25 Thread Joe Conway
Heikki Linnakangas wrote: Heikki Linnakangas wrote: Joe Conway wrote: We just came upon a crash bug in Postgres = 8.2. The attached standalone script (just needs a database with plpgsql installed) reproduces the crash for me on 32-bit machines (i686) but NOT on 64 bit machines (x86_64), for

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-25 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] 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

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-25 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas [EMAIL PROTECTED] 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

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-25 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] writes: I think I found it. The page splitting code didn't take into account that when the new item is the first one on the right page, it also becomes the high key of the left page. Good catch! This is something that would not make a difference with

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-25 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] writes: 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. But that patch has been there for ages too; the only new thing in 8.2 is that the fillfactor is configurable, but

Re: [HACKERS] crash on 8.2 and cvshead - failed to add item to the

2007-01-25 Thread Joe Conway
Tom Lane wrote: Heikki Linnakangas [EMAIL PROTECTED] writes: 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. But that patch has been there for ages too; the only new thing in 8.2 is that the fillfactor is