Be sure to release LogicalRepLauncherLock in DROP SUBSCRIPTION command.
authorFujii Masao <[email protected]>
Fri, 3 Feb 2017 18:18:13 +0000 (03:18 +0900)
committerFujii Masao <[email protected]>
Fri, 3 Feb 2017 18:18:13 +0000 (03:18 +0900)
Previously DROP SUBSCRIPTION command forgot to release the lock at all.

Original patches by Kyotaro Horiguchi and Michael Paquier,
but I didn't use them.
Discussion: http://postgr.es/m/20170201.173623.66249355[email protected]

src/backend/commands/subscriptioncmds.c

index 3b7080756537687a26e6677f51fb9d0e23e4ab11..4353e14e1bdf2807b7a7ddd0c93bb2595d8c7a41 100644 (file)
@@ -514,6 +514,8 @@ DropSubscription(DropSubscriptionStmt *stmt)
        /* Kill the apply worker so that the slot becomes accessible. */
        logicalrep_worker_stop(subid);
 
+       LWLockRelease(LogicalRepLauncherLock);
+
        /* Remove the origin tracking if exists. */
        snprintf(originname, sizeof(originname), "pg_%u", subid);
        originid = replorigin_by_name(originname, true);