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.horiguchi.kyotaro@lab.ntt.co.jp
/* 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);