Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the same transaction - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the same transaction
Date
Msg-id CAD21AoBACUhhSNVO+oxueJ9CKbKrfgqqRgMvfgntMjjsf+VkUg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the same transaction  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the same transaction  (Arseny Sher <a.sher@postgrespro.ru>)
List pgsql-hackers
On Wed, Sep 6, 2017 at 3:28 PM, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> On Mon, Sep 4, 2017 at 11:43 PM, Arseny Sher <a.sher@postgrespro.ru> wrote:
>> Arseny Sher <a.sher@postgrespro.ru> writes:
>>
>>> Attached patch fixes this by stopping workers before RO drop, as
>>> already done in case when we drop replication slot.
>>
>> Sorry, here is the patch.
>>
>
> I could reproduce this issue, it's a bug. Added this to the open item.
> The cause of this is commit 7e174fa7 which make subscription ddls kill
> the apply worker only when transaction commit. I didn't look the patch
> deeply yet but I'm not sure the approach that kills apply worker
> before commit would be good.
>

FWIW, perhaps we can change the replication origin management so that
DROP SUBSCRIPTION doesn't drop the replication origin and the apply
worker itself removes it when exit. When an apply worker exits it
removes the replication origin if the corresponding subscription had
been removed.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] More efficient truncation of pg_stat_activity query strings
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Automatic testing of patches in commit fest