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 4FAD1E18.7020205@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>)
Responses Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 11.05.2012 16:52, Tom Lane wrote:
> Heikki Linnakangas<heikki.linnakangas@enterprisedb.com>  writes:
>> I wonder if we should reserve a few of the lwlock "slots" for critical
>> sections, to make this less likely to happen. Not only in this case, but
>> in general. We haven't seen this problem often, but it would be quite
>> trivial to reserve a few slots.
>
> I'm against that: it would complicate a performance-critical and
> correctness-critical part of the code, in return for what exactly?
> IMO, no part of the system should ever get within an order of magnitude
> of holding 100 LWLocks concurrently.

I agree we should never get anywhere near that limit. But if we do -
because of another bug like this one - it would be nice if it was just
an ERROR, instead of a PANIC.

> For one thing, I don't believe
> it's possible to statically guarantee no deadlock once things get that
> messy; and for another, it'd surely be horrible from a concurrency
> standpoint.

Well, for example in the case of a gist page split that splits a page
into a hundred pages, all but one of the pages involved is previously
unused. It's quite easy to guarantee that's deadlock free. It's
nevertheless not a good idea in practice to do that, of course.

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

pgsql-bugs by date:

Previous
From: Simon Riggs
Date:
Subject: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"
Next
From: Heikki Linnakangas
Date:
Subject: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"