pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ryan Kelly <rpkelly22@gmail.com>
Cc: tom Tom <tom@tomforb.es>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"
Date: Fri, 11 May 2012 17:11:36 +0300
Message-ID: <4FAD1E18.7020205@enterprisedb.com> (raw)
In-Reply-To: <2941.1336744377@sss.pgh.pa.us>
References: <E1SQkyu-0004nP-IW@wrigleys.postgresql.org>
	<4FA7EC37.5070703@enterprisedb.com>
	<CAFNZOJM4OpDN562BDS5g6iJX+NOjTwPUXtfQg91ALVH60td5vg@mail.gmail.com>
	<20120508011540.GA28140@llserver.lakeliving.com>
	<4FACE4C7.6070306@enterprisedb.com>
	<2941.1336744377@sss.pgh.pa.us>

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



view thread (18+ messages)  latest in thread

Message-ID: <4FAD1E18.7020205@enterprisedb.com>
Permalink:  ../4FAD1E18.7020205@enterprisedb.com/
Also on:    postgresql.org/message-id/4FAD1E18.7020205@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, tgl@sss.pgh.pa.us, rpkelly22@gmail.com, tom@tomforb.es
  Subject: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"
  In-Reply-To: <4FAD1E18.7020205@enterprisedb.com>
  References: <E1SQkyu-0004nP-IW@wrigleys.postgresql.org> <4FA7EC37.5070703@enterprisedb.com> <CAFNZOJM4OpDN562BDS5g6iJX+NOjTwPUXtfQg91ALVH60td5vg@mail.gmail.com> <20120508011540.GA28140@llserver.lakeliving.com> <4FACE4C7.6070306@enterprisedb.com> <2941.1336744377@sss.pgh.pa.us> <4FAD1E18.7020205@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox