postgresql/src/backend/commands
Fujii Masao 4eafdcc276 Prevent logical rep workers with removed subscriptions from starting.
Any logical rep workers must have their subscription entries in
pg_subscription. To ensure this, we need to prevent the launcher
from starting new worker corresponding to the subscription that
DROP SUBSCRIPTION command is removing. To implement this,
previously LogicalRepLauncherLock was introduced and held until
the end of transaction running DROP SUBSCRIPTION. But using
LWLock for that purpose was not valid.

Instead, this commit changes DROP SUBSCRIPTION so that it takes
AccessExclusiveLock on pg_subscription, in order to ensure that
the launcher cannot see any subscriptions being removed. Also this
commit gets rid of LogicalRepLauncherLock.

Patch by me, reviewed by Petr Jelinek

Discussion: https://www.postgresql.org/message-id/CAHGQGwHPi8ky-yANFfe0sgmhKtsYcQLTnKx07bW9S7-Rn1746w@mail.gmail.com
2017-03-09 01:44:23 +09:00
..
aggregatecmds.c Use the new castNode() macro in a number of places. 2017-01-26 16:47:03 -08:00
alter.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
amcmds.c Fix typos in comments. 2017-02-06 11:33:58 +02:00
analyze.c Fix relcache reference leak. 2017-03-07 11:27:21 -05:00
async.c Use the new castNode() macro in a number of places. 2017-01-26 16:47:03 -08:00
cluster.c In rebuild_relation(), don't access an already-closed relcache entry. 2017-03-04 16:09:33 -05:00
collationcmds.c Add CREATE COLLATION IF NOT EXISTS clause 2017-02-15 10:01:28 -05:00
comment.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
constraint.c Allow index AMs to cache data across aminsert calls within a SQL command. 2017-02-09 11:52:12 -05:00
conversioncmds.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
copy.c Avoid dangling pointer to relation name in RLS code path in DoCopy(). 2017-03-06 16:50:47 -05:00
createas.c Use castNode() in a bunch of statement-list-related code. 2017-01-26 22:09:34 -05:00
dbcommands.c Remove useless duplicate inclusions of system header files. 2017-02-25 16:12:55 -05:00
define.c Logical replication 2017-01-20 09:04:49 -05:00
discard.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
dropcmds.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
event_trigger.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
explain.c Support XMLTABLE query expression 2017-03-08 12:40:26 -03:00
extension.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
foreigncmds.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
functioncmds.c Replace LookupFuncNameTypeNames() with LookupFuncWithArgs() 2017-03-06 13:31:47 -05:00
indexcmds.c Ignore tablespace ACLs when ignoring schema ACLs. 2017-02-12 16:03:41 -05:00
lockcmds.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
Makefile Logical replication 2017-01-20 09:04:49 -05:00
matview.c Tweak catalog indexing abstraction for upcoming WARM 2017-01-31 18:42:24 -03:00
opclasscmds.c Replace LookupFuncNameTypeNames() with LookupFuncWithArgs() 2017-03-06 13:31:47 -05:00
operatorcmds.c Replace LookupFuncNameTypeNames() with LookupFuncWithArgs() 2017-03-06 13:31:47 -05:00
policy.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
portalcmds.c Use castNode() in a bunch of statement-list-related code. 2017-01-26 22:09:34 -05:00
prepare.c Consistently declare timestamp variables as TimestampTz. 2017-02-23 15:57:08 -05:00
proclang.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
publicationcmds.c Fix typos in comments. 2017-02-06 11:33:58 +02:00
schemacmds.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
seclabel.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
sequence.c Add CREATE SEQUENCE AS <data type> clause 2017-02-10 15:34:35 -05:00
subscriptioncmds.c Prevent logical rep workers with removed subscriptions from starting. 2017-03-09 01:44:23 +09:00
tablecmds.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
tablespace.c Remove useless duplicate inclusions of system header files. 2017-02-25 16:12:55 -05:00
trigger.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
tsearchcmds.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
typecmds.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
user.c Support SCRAM-SHA-256 authentication (RFC 5802 and 7677). 2017-03-07 14:25:40 +02:00
vacuum.c Don't uselessly rewrite, truncate, VACUUM, or ANALYZE partitioned tables. 2017-03-02 17:23:44 +05:30
vacuumlazy.c Allow vacuums to report oldestxmin 2017-03-03 19:18:25 +05:30
variable.c Remove now-dead code for !HAVE_INT64_TIMESTAMP. 2017-02-23 14:04:43 -05:00
view.c Use the new castNode() macro in a number of places. 2017-01-26 16:47:03 -08:00