Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the sametransaction - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the sametransaction
Date
Msg-id 014d09d5-834f-3c43-a82a-f5e2b863920c@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the same transaction  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 9/12/17 15:51, Tom Lane wrote:
> ISTM the second of those (refuse to drop an in-use subscription) is
> by far the least surprising behavior.  However, I wonder if there aren't
> race conditions involved here.  What if we haven't yet committed a
> DROP SUBSCRIPTION, and some new worker starts up after we look for
> workers?

DROP SUBSCRIPTION takes an AccessExclusiveLock on pg_subscription to
prevent that.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the sametransaction
Next
From: Alexander Korotkov
Date:
Subject: Re: [HACKERS] Pluggable storage