From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: 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 12:42:22 +0300
Message-ID: <4FACDEFE.4020901@enterprisedb.com> (raw)
In-Reply-To: <27017.1336405902@sss.pgh.pa.us>
References: <E1SQkyu-0004nP-IW@wrigleys.postgresql.org>
<4FA7EC37.5070703@enterprisedb.com>
<27017.1336405902@sss.pgh.pa.us>
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
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, tom@tomforb.es
Subject: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"
In-Reply-To: <4FACDEFE.4020901@enterprisedb.com>
References: <E1SQkyu-0004nP-IW@wrigleys.postgresql.org> <4FA7EC37.5070703@enterprisedb.com> <27017.1336405902@sss.pgh.pa.us> <4FACDEFE.4020901@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