From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: exclusion@gmail.com
Subject: BUG #18988: DROP SUBSCRIPTION locks not-yet-accessed database
Date: Wed, 16 Jul 2025 19:00:01 +0000
Message-ID: <18988-7312c868be2d467f@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18988
Logged by: Alexander Lakhin
Email address: exclusion@gmail.com
PostgreSQL version: 18beta1
Operating system: Ubuntu 24.04
Description:
The following script:
createdb ndb
echo "
CREATE SUBSCRIPTION testsub CONNECTION 'dbname=ndb' PUBLICATION testpub WITH
(connect = false);
" | psql
echo "
DROP SUBSCRIPTION testsub
" | psql &
sleep 1
timeout 30 psql ndb -c "SELECT 1" || echo "TIMEOUT"
makes DROP SUBSCRIPTION stuck on waiting for a connection to drop a slot,
while this connection is waiting for a lock for relation 6100
(pg_subscription), locked by DROP SUBSCRIPTION:
law 1545967 1545946 0 21:10 ? 00:00:00 postgres: law regression
[local] DROP SUBSCRIPTION
law 1545968 1545946 0 21:10 ? 00:00:00 postgres: walsender law
ndb [local] startup waiting
With debug_discard_caches = 1 or under some lucky circumstances (I
encountered these), this leads to inability to connect to any database.
Reproduced on REL_13_STABLE .. master.
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-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, exclusion@gmail.com
Subject: Re: BUG #18988: DROP SUBSCRIPTION locks not-yet-accessed database
In-Reply-To: <18988-7312c868be2d467f@postgresql.org>
* 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