pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
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 14:32:48 -0400
Message-ID: <9944.1336761168@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+U5nMLNXk0YCVqby-4=QHcrp_OJaSsC1u+tvw7CarathBUXaw@mail.gmail.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>
	<CA+U5nM+QzrhLM9V2Lwk2zqDEbTjwN-Y8nT6=kMDWibBwyiW_gg@mail.gmail.com>
	<4FAD1EC1.2000502@enterprisedb.com>
	<CA+U5nMK29jWExz52_3QoetJLmO1+Gz9__3SjZG=4P3nFh1qPJg@mail.gmail.com>
	<4FAD42F5.9060706@enterprisedb.com>
	<CA+U5nMLNXk0YCVqby-4=QHcrp_OJaSsC1u+tvw7CarathBUXaw@mail.gmail.com>

Simon Riggs <simon@2ndQuadrant.com> writes:
> OK, I agree.

I still think this is about solving a non-problem.

> The implementation I would prefer would be to put the check in
> START_CRIT_SECTION(); so we actually fail before we enter the section.

... and this is proposing adding significant overhead to solve a
non-problem.

The suggested warning can be added without any new cycles in the normal
case, ie, where we currently have

	if (lockcount >= 100)
		elog(ERROR, ...);

we can do something like

	if (lockcount >= 20)
	{
		if (lockcount >= 100)
			elog(ERROR, ...);
		else
			elog(WARNING, ...);
	}

I think that's more than sufficient.  We've had the LWLock mechanism
for umpteen years now, and this hasn't come up before, and now that
it has come up it was because of a locking usage that needed to be
rewritten anyway.  That is *not* good evidence for adding complexity
and cycles to the mechanism to make it more failsoft.  It shouldn't
need to be failsoft.

			regards, tom lane



view thread (18+ messages)

Message-ID: <9944.1336761168@sss.pgh.pa.us>
Permalink:  ../9944.1336761168@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9944.1336761168@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, simon@2ndQuadrant.com, heikki.linnakangas@enterprisedb.com, rpkelly22@gmail.com, tom@tomforb.es
  Subject: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"
  In-Reply-To: <9944.1336761168@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> <CA+U5nM+QzrhLM9V2Lwk2zqDEbTjwN-Y8nT6=kMDWibBwyiW_gg@mail.gmail.com> <4FAD1EC1.2000502@enterprisedb.com> <CA+U5nMK29jWExz52_3QoetJLmO1+Gz9__3SjZG=4P3nFh1qPJg@mail.gmail.com> <4FAD42F5.9060706@enterprisedb.com> <CA+U5nMLNXk0YCVqby-4=QHcrp_OJaSsC1u+tvw7CarathBUXaw@mail.gmail.com> <9944.1336761168@sss.pgh.pa.us>

* 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