Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hO4BD-0006PG-Ot for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2019 17:47:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hO4BA-0003Bw-DU for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2019 17:47:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hO4BA-0003Bp-1k for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2019 17:47:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hO4B7-00012d-Nm for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2019 17:46:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x47Hks1j016171; Tue, 7 May 2019 13:46:54 -0400 From: Tom Lane To: pgsql-hackers@lists.postgresql.org cc: Thomas Munro Subject: We're leaking predicate locks in HEAD MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16169.1557251214.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 07 May 2019 13:46:54 -0400 Message-ID: <16170.1557251214@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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=3D# select * from pg_locks; locktype | database | relation | page | tuple | virtualxid | transactio= nid | classid | objid | objsubid | virtualtransaction | pid | mode = | granted | fastpath = ------------+----------+----------+------+-------+------------+-----------= ----+---------+-------+----------+--------------------+------+------------= -----+---------+---------- relation | 130144 | 12137 | | | | = | | | | 3/7977 | 8924 | AccessShare= Lock | t | t virtualxid | | | | | 3/7977 | = | | | | 3/7977 | 8924 | ExclusiveLo= ck | 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