Re: [HACKERS] A patch for FATAL 1:btree: BTP_CHAIN flag was expected - Mailing list pgsql-hackers

From Vadim Mikheev
Subject Re: [HACKERS] A patch for FATAL 1:btree: BTP_CHAIN flag was expected
Date
Msg-id 372B28C7.D0C9656D@krs.ru
Whole thread Raw
In response to Re: [HACKERS] A patch for FATAL 1:btree: BTP_CHAIN flag was expected  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-hackers
Tatsuo Ishii wrote:
> 
> >
> >There exists the bug that causes elog()  FATAL 1:btree:
> >BTP_CHAIN flag was expected.
> >The following patch would solve the bug partially.
> >
> >It seems that the bug is caused by _bt_split() in nbtinsert.c.
> >BTP_CHAIN flags of buf/rbuf are always off immediately after
> >_bt_split(),so the pages may be in inconsistent state.
> >Though the flags are chagned correctly before _bt_relbuf(),
> >buf/rbuf are not _bt_wrt(norel)buf()'d after the change
> >(buf/rbuf are already _bt_wrtnorelbuf()'d in _bt_split() ).

Exactly! If left/right pages would be flushed by other transaction
before setting BTP_CHAIN flag then this flag would be lost!
Where were my eyes! -:)

Thanks, Hiroshi!
Committed.

All versions >= 6.1 are affected by this bug...

I'll make patch for 6.4.2 in a few days if no one else...

Vadim


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] A select with aggretion is failing, still subtle problems with aggregation
Next
From: Oleg Bartunov
Date:
Subject: 6.5 cvs ERROR: copyObject: don't know how to copy 604