On Tue, Feb 9, 2021 at 10:38 AM Peter Smith <smithpb2...@gmail.com> wrote:
> PSA an alternative patch. This one adds a new member to > WalRcvExecResult and so is able to detect the "slot does not exist" > error. This patch also applies on top of V28, if you want it. Did some testing with this patch on top of v29. I could see that now, while dropping the subscription, if the tablesync slot does not exist on the publisher, then it gives a warning but the command does not fail. postgres=# CREATE SUBSCRIPTION tap_sub CONNECTION 'host=localhost dbname=postgres port=6972' PUBLICATION tap_pub WITH (enabled = false); NOTICE: created replication slot "tap_sub" on publisher CREATE SUBSCRIPTION postgres=# ALTER SUBSCRIPTION tap_sub enable; ALTER SUBSCRIPTION postgres=# ALTER SUBSCRIPTION tap_sub disable; ALTER SUBSCRIPTION === here, the tablesync slot exists on the publisher but I go and === manually drop it. postgres=# drop subscription tap_sub; WARNING: could not drop the replication slot "pg_16401_sync_16389_6927117142022745645" on publisher DETAIL: The error was: ERROR: replication slot "pg_16401_sync_16389_6927117142022745645" does not exist NOTICE: dropped replication slot "tap_sub" on publisher DROP SUBSCRIPTION I have a minor comment on the error message, the "The error was:" seems a bit redundant here. Maybe remove it? So that it looks like: WARNING: could not drop the replication slot "pg_16401_sync_16389_6927117142022745645" on publisher DETAIL: ERROR: replication slot "pg_16401_sync_16389_6927117142022745645" does not exist regards, Ajin Cherian Fujitsu Australia