Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken" - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"
Date
Msg-id 4FACDEFE.4020901@enterprisedb.com
Whole thread Raw
In response to Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 07.05.2012 18:51, Tom Lane wrote:
> Heikki Linnakangas<heikki.linnakangas@enterprisedb.com>  writes:
>> We could rearrange the page splitting algorithm to release locks
>> earlier, before traversing to the next parent level.
>
> That seems like a good idea just on concurrency grounds; I'm worried
> about both the performance implications and the risk of deadlock.

Ok, committed a patch to release locks earlier when recursing up the tree.

This still doesn't completely eliminate the problem: when a page is
split into more than two halves, the downlinks are inserted separately
for each of the extra right pages. While that's done, the rest of the
siblings are kept locked. So in effect, we still have the same issue
when all the splits are 3 (or more)-way splits. I'm not going to try
fixing that now, because it's an exceedingly rare corner-case, and would
be rather difficult to fix.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #6624: Tab completion of identifier containing single backslash triggers warnings
Next
From: Heikki Linnakangas
Date:
Subject: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"