Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION
Date
Msg-id CAHGQGwHROm3=XuiT3O_BJn8e4WrohGpoK29+5t03+3yAxUgThQ@mail.gmail.com
Whole thread Raw
In response to [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Wed, Feb 1, 2017 at 5:36 PM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:
> Hello, while looking another bug, I found that standby cannot
> shutdown after DROP SUBSCRIPTION.
>
> standby=# CREATE SUBSCRPTION sub1 ...
> standby=# ....
> standby=# DROP SUBSCRIPTION sub1;
>
> Ctrl-C to the standby fails to work. ApplyLauncherMain is waiting
> LogicalRepLauncherLock forever.
>
> The culprit is DropSbuscription. It acquires
> LogicalRepLauncherLock but never releases.
>
> The attached patch fixes it. Most part of the fucntion is now
> enclosed by PG_TRY-CATCH since some functions can throw
> exceptions.

The lwlock would be released when an exception occurs, so I don't think
that TRY-CATCH is necessary here. Or it's necessary for another reason?

Regards,

-- 
Fujii Masao



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] parallelize queries containing subplans
Next
From: David Fetter
Date:
Subject: [HACKERS] Re: [COMMITTERS] pgsql: Make psql's \set display variables inalphabetical order.