pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Cc: Thomas Munro <thomas.munro@gmail.com>
Subject: We're leaking predicate locks in HEAD
Date: Tue, 07 May 2019 13:46:54 -0400
Message-ID: <16170.1557251214@sss.pgh.pa.us> (raw)

After running the core regression tests with installcheck-parallel,
the pg_locks view sometimes shows me apparently-orphaned SIReadLock
entries.  They accumulate over repeated test runs.  Right now,
for example, I see

regression=# select * from pg_locks;
  locktype  | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid | virtualtransaction | pid  |      mode       | granted | fastpath 
------------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+------+-----------------+---------+----------
 relation   |   130144 |    12137 |      |       |            |               |         |       |          | 3/7977             | 8924 | AccessShareLock | t       | t
 virtualxid |          |          |      |       | 3/7977     |               |         |       |          | 3/7977             | 8924 | ExclusiveLock   | t       | t
 relation   |   130144 |   136814 |      |       |            |               |         |       |          | 22/536             | 8076 | SIReadLock      | t       | f
 relation   |   111195 |   118048 |      |       |            |               |         |       |          | 19/665             | 6738 | SIReadLock      | t       | f
 relation   |   130144 |   134850 |      |       |            |               |         |       |          | 12/3093            | 7984 | SIReadLock      | t       | f
(5 rows)

after having done a couple of installcheck iterations since starting the
postmaster.

The PIDs shown as holding those locks don't exist anymore, but digging
in the postmaster log shows that they were session backends during the
regression test runs.  Furthermore, it seems like they usually were the
ones running either the triggers or portals tests.

I don't see this behavior in v11 (though maybe I just didn't run it
long enough).  In HEAD, a run adds one or two new entries more often
than not.

This is a pretty bad bug IMO --- quite aside from any ill effects
of the entries themselves, the leak seems fast enough that it'd run
a production installation out of locktable space before very long.

I'd have to say that my first suspicion falls on bb16aba50 ...

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <16170.1557251214@sss.pgh.pa.us>
Permalink:  ../16170.1557251214@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16170.1557251214@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org, thomas.munro@gmail.com
  Subject: Re: We're leaking predicate locks in HEAD
  In-Reply-To: <16170.1557251214@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