Re: Gin page deletion bug - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Gin page deletion bug
Date
Msg-id 527D4A94.5050308@vmware.com
Whole thread Raw
In response to Re: Gin page deletion bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 08.11.2013 19:14, Tom Lane wrote:
> Heikki Linnakangas <hlinnakangas@vmware.com> writes:
>> I came up with the attached fix. In a nutshell, when walking along a
>> right-link, the new page is locked before releasing the lock on the old
>> one. Also, never delete the leftmost branch of a posting tree. I believe
>> these changes are sufficient to fix the problem, because of the way the
>> posting tree is searched:
>
> This seems reasonable, but I wonder whether the concurrency discussion
> shouldn't be in gist/README, rather than buried in a comment inside
> ginDeletePage (not exactly the first place one would think to look IMO).

Yeah, README is probably better. There's zero explanation of concurrency 
and locking issues there at the moment, so I added a new section there 
explaining why the page deletion is (now) safe. There's a lot more to 
say about locking in GIN, but I'll leave that for another day.

- Heikki



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: regclass error reports improperly downcased
Next
From: Alvaro Herrera
Date:
Subject: Re: Minmax indexes