Re: [HACKERS] DROP SUBSCRIPTION, query cancellations and slot handling - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] DROP SUBSCRIPTION, query cancellations and slot handling
Date
Msg-id CAB7nPqQfU51NwM3W7fJSSR1cK9UGRgi=4MnVSepHOwh3OkiJ=g@mail.gmail.com
Whole thread Raw
In response to [HACKERS] DROP SUBSCRIPTION, query cancellations and slot handling  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] DROP SUBSCRIPTION, query cancellations and slothandling  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
List pgsql-hackers
On Thu, Apr 20, 2017 at 4:22 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> I am adding an open item.

Just adding something... When a subscription is created, if the step
synchronizing tables fails then CREATE SUBSCRIPTION fails but the slot
remains present on the publisher side, so trying to re-create the same
subscription results in an error:

=# CREATE SUBSCRIPTION mysub CONNECTION 'port=5432' PUBLICATION mypub,
insert_only;
NOTICE:  00000: Sleeping now...
NOTICE:  00000: created replication slot "mysub" on publisher
LOCATION:  CreateSubscription, subscriptioncmds.c:411
ERROR:  42P01: relation "public.aa" does not exist
LOCATION:  RangeVarGetRelidExtended, namespace.c:400
Time: 1033.739 ms (00:01.034)
=# CREATE SUBSCRIPTION mysub CONNECTION 'port=5432 user=mpaquier
dbname=mpaquier' PUBLICATION mypub, insert_only;
NOTICE:  00000: Sleeping now...
LOCATION:  CreateSubscription, subscriptioncmds.c:376
ERROR:  XX000: could not create replication slot "mysub": ERROR:
replication slot "mysub" already exists
LOCATION:  libpqrcv_create_slot, libpqwalreceiver.c:776

I have created a simple table aa (a int) on the publisher first, where
a publication with ALL TABLES has been created:
CREATE PUBLICATION mypub FOR ALL TABLES;
-- 
Michael



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: [HACKERS] DROP SUBSCRIPTION, query cancellations and slot handling
Next
From: Tatsuo Ishii
Date:
Subject: Re: [HACKERS] pgbench - allow to store select results intovariables