Re: BUG #5157: Hash index not concurrency safe - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5157: Hash index not concurrency safe
Date
Msg-id 6751.1257090750@sss.pgh.pa.us
Whole thread Raw
In response to BUG #5157: Hash index not concurrency safe  ("Jeff Janes" <jeff.janes@gmail.com>)
Responses Re: BUG #5157: Hash index not concurrency safe
List pgsql-bugs
"Jeff Janes" <jeff.janes@gmail.com> writes:
> Hash index is not concurrency safe, starting in REL8_4_0 and up to HEAD.

Ouch.  This used to be okay, because adding new entries to a hash page
always added them at the end.  The 8.4 changes to keep individual hash
pages sorted by hashcode broke it :-(.

I think we could recover by having the hashgettuple code path
re-synchronize by looking for the heap TID it previously returned.
That must be at the same or higher index TID as we had stopped at.
(Deletions are not possible, so we only have to search forward,
and the TID must be there someplace.)

            regards, tom lane

pgsql-bugs by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Postmaster hangs
Next
From: Jeff Janes
Date:
Subject: Re: BUG #5157: Hash index not concurrency safe