Re: Failed to re-find parent key - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Failed to re-find parent key
Date
Msg-id 20050322145713.GA32038@dcc.uchile.cl
Whole thread Raw
In response to Failed to re-find parent key  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Failed to re-find parent key  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Mar 22, 2005 at 12:31:55PM +0100, Peter Eisentraut wrote:
> What does the error message
> 
> failed to re-find parent key in "tablename_pkey"
> 
> mean?  This happens reproducibly during VACUUM on a certain table.

This has been reported before, but no one has been able to reproduce it
(not the VACUUM, but the steps that led the index to that state).  This
is probably a very subtle bug introduced after the page-reusing code was
introduced in nbtree.  I don't think it has been corrected in later
releases.

There are two ocurrences of this error message in the code: one is while
trying to split a page, inserting the pointer to the new page in its
parent.  This one is not what you are seeing, because during vacuum no
splitting takes place.

The other ocurrence is at the first pass of page recovery, which happens
at VACUUM.  The code tries to find the parent page to delete the pointer
that leads to the page being unlinked; if it can't find said pointer,
the error you see is issued.  I think it takes a lot of concurrency for
the situation to arise.

> Would REINDEX fix it?  Anything else we should check?

Maybe you could see exactly what page is causing the problem,
pg_filedump it, and see what's the exact problem.  Yes, a REINDEX fixes
it (at least it did in Gaetano's case.)

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Failed to re-find parent key
Next
From: Tom Lane
Date:
Subject: Re: Failed to re-find parent key