Re: BUG #5157: Hash index not concurrency safe

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jeff Janes" <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5157: Hash index not concurrency safe
Date: 2009-11-01 15:52:30
Message-ID: 6751.1257090750@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Jeff Janes" <jeff(dot)janes(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Janes 2009-11-01 17:17:50 Re: BUG #5157: Hash index not concurrency safe
Previous Message Craig Ringer 2009-11-01 10:27:25 Re: Postmaster hangs