pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Lumby <johnlumby@hotmail.com>
Cc: pgsql bugs <pgsql-bugs@postgresql.org>
Subject: Re: Re: BUG #14098: misleading message "out of shared memory" when lock table space exhausted
Date: Tue, 19 Apr 2016 12:42:47 -0400
Message-ID: <15172.1461084167@sss.pgh.pa.us> (raw)
In-Reply-To: <COL131-W47CA8FA5A2B204766E905AA36C0@phx.gbl>
References: <20160418164648.26012.40241@wrigleys.postgresql.org>
	<320.1461001031@sss.pgh.pa.us>
	<COL131-W47A45853021C2B3DDBEC12A36B0@phx.gbl>
	<COL131-W47CA8FA5A2B204766E905AA36C0@phx.gbl>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

John Lumby <johnlumby@hotmail.com> writes:
> Firstly, the documentation (Server Configuration, Lock Management) is very clear :

> _____________________________________________________
> max_locks_per_transaction (integer)

> The shared lock table tracks locks on
> max_locks_per_transaction * (max_connections + max_prepared_transactions) objects (e.g., tables);

> hence, *no more* than this many distinct objects can be locked at any one time.

You're mistaking a guarantee for a hard limit.

What actually happens is that enough shared memory is reserved for at
least max_locks_per_transaction * (max_connections +
max_prepared_transactions) lock entries, plus a bunch of unrelated stuff,
plus some slop.  The other uses of shared memory are pretty static, so the
end result is that only the lock table is likely to eat up the slop.
max_locks_per_transaction is thus more of a floor than a ceiling.

I'm not sure if that documentation wording needs improvement or not.
Other references to max_locks_per_transaction don't seem to imply that
it's an exact bright line, but I can see where if you read only that
line in this para and not the rest of the para, you might come away
with such a conclusion.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (7+ messages)  latest in thread

Message-ID: <15172.1461084167@sss.pgh.pa.us>
Permalink:  ../15172.1461084167@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15172.1461084167@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, johnlumby@hotmail.com
  Subject: Re: BUG #14098: misleading message "out of shared memory" when lock table space exhausted
  In-Reply-To: <15172.1461084167@sss.pgh.pa.us>
  References: <20160418164648.26012.40241@wrigleys.postgresql.org> <320.1461001031@sss.pgh.pa.us> <COL131-W47A45853021C2B3DDBEC12A36B0@phx.gbl> <COL131-W47CA8FA5A2B204766E905AA36C0@phx.gbl> <15172.1461084167@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