Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION,query cancellations and slot handling) - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION,query cancellations and slot handling)
Date
Msg-id 20170502211530.knjb72uo2lykuzxt@alvherre.pgsql
Whole thread Raw
In response to Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION,query cancellations and slot handling)  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION,query cancellations and slot handling)  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas wrote:
> On Tue, May 2, 2017 at 12:25 PM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
> > 2) don't drop because we know it won't work.  I see two options:
> >    c) ignore a drop slot failure, i.e. don't cause a transaction abort.
> >       An easy way to implement this is just add a PG_TRY block, but we
> >       dislike adding those and not re-throwing the error.
> 
> Dislike doesn't seem like the right word.  Unless you rollback a
> (sub)transaction, none of the cleanup that would normally do is done,

True.  So one possible implementation is that we open a subtransaction
before dropping the slot, and we abort it if things go south.  This is a
bit slower, but not critically so.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION,query cancellations and slot handling)
Next
From: Merlin Moncure
Date:
Subject: Re: [HACKERS] CTE inlining