[COMMITTERS] pgsql: Prevent logical rep workers with removed subscriptions fromstar - Mailing list pgsql-committers

From Fujii Masao
Subject [COMMITTERS] pgsql: Prevent logical rep workers with removed subscriptions fromstar
Date
Msg-id E1cleiy-0001jI-Fo@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/4eafdcc27608dfb8a3afa3155d6ae07f66179782

Modified Files
--------------
src/backend/commands/subscriptioncmds.c    | 12 ++++++------
src/backend/replication/logical/launcher.c | 10 ----------
src/backend/storage/lmgr/lwlocknames.txt   |  3 +--
3 files changed, 7 insertions(+), 18 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: [COMMITTERS] pgsql: Fix XMLTABLE on older libxml2
Next
From: Robert Haas
Date:
Subject: [COMMITTERS] pgsql: Support parallel bitmap heap scans.