Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: tom(at)tomforb(dot)es, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"
Date: 2012-05-11 09:42:22
Message-ID: 4FACDEFE.4020901@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 07.05.2012 18:51, Tom Lane wrote:
> Heikki Linnakangas<heikki(dot)linnakangas(at)enterprisedb(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2012-05-11 10:07:03 Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"
Previous Message Tom Lane 2012-05-11 01:50:06 Re: BUG #6624: Tab completion of identifier containing single backslash triggers warnings