mirror of
https://github.com/postgres/postgres.git
synced 2025-11-28 11:44:57 +03:00
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
This commit is contained in:
@@ -48,5 +48,4 @@ ReplicationOriginLock 40
|
||||
MultiXactTruncationLock 41
|
||||
OldSnapshotTimeMapLock 42
|
||||
BackendRandomLock 43
|
||||
LogicalRepLauncherLock 44
|
||||
LogicalRepWorkerLock 45
|
||||
LogicalRepWorkerLock 44
|
||||
|
||||
Reference in New Issue
Block a user