Re: [HACKERS] ERROR: btree scan list trashed ?? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] ERROR: btree scan list trashed ??
Date
Msg-id 18242.933782347@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] ERROR: btree scan list trashed ??  (Adriaan Joubert <a.joubert@albourne.com>)
List pgsql-hackers
Adriaan Joubert <a.joubert@albourne.com> writes:
>> After some digging around in backend/access/nbtree/nbtscan.c, which is
>> producing the error, I notice that the routine in question is searching
>> a list that does not get cleared properly at transaction abort.  It's
>> not clear that that's the cause of the error message, though.

> BTW, I've installed 6.5.1 and still have the same problems.

No surprise, really.

> Vacuuming hung up everything, and I had to shut the whole thing down
> and restart it to get it working again. Dropping the indices and
> rebuilding them all fixed the problem.

Hmm, that suggests that your indexes are actually getting corrupted.

> How difficult is it to clear the list at transaction abort? Is this
> something I could patch and try out?

The BTScans variable in nbtscan.c needs to be reset to NULL during
xact abort.  I don't see how this would *directly* cause the
observed symptom, but failing to do it should lead to misbehavior in
_bt_adjscans() during later transactions, so it might be related
somehow.  If you want to patch it, make a subroutine that clears the
variable (no need to free the list; since it's palloc'd it'll go
away anyway) and call it from transaction cleanup in
backend/access/transam/xact.c.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Adriaan Joubert
Date:
Subject: Re: [HACKERS] ERROR: btree scan list trashed ??
Next
From: eem21@cam.ac.uk
Date:
Subject: Re: [INTERFACES] Re: [HACKERS] Threads