Re: Failed to re-find parent key

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Failed to re-find parent key
Date: 2005-03-22 14:57:13
Message-ID: 20050322145713.GA32038@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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[(at)]dcc(dot)uchile(dot)cl>)
"Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-03-22 15:05:40 Re: Failed to re-find parent key
Previous Message Tom Lane 2005-03-22 14:54:59 Re: Failed to re-find parent key