Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-03-08 Thread Fujii Masao
On Wed, Mar 8, 2017 at 9:05 PM, Masahiko Sawada wrote: > On Wed, Feb 8, 2017 at 12:04 AM, Fujii Masao wrote: >> On Tue, Feb 7, 2017 at 2:13 AM, Petr Jelinek >> wrote: >>> On 06/02/17 17:33, Fujii Masao wrote: On Sun, Feb 5, 2017 at 5:11 AM, Petr Jelinek wrote: > On 03/02/17 19:38,

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-03-08 Thread Masahiko Sawada
On Wed, Feb 8, 2017 at 12:04 AM, Fujii Masao wrote: > On Tue, Feb 7, 2017 at 2:13 AM, Petr Jelinek > wrote: >> On 06/02/17 17:33, Fujii Masao wrote: >>> On Sun, Feb 5, 2017 at 5:11 AM, Petr Jelinek >>> wrote: On 03/02/17 19:38, Fujii Masao wrote: > On Sat, Feb 4, 2017 at 12:49 AM, Fujii

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-08 Thread Robert Haas
On Sat, Feb 4, 2017 at 3:11 PM, Petr Jelinek wrote: > That was the reason why DropSubscription didn't release the lock in the > first place. It was supposed to be released at the end of the > transaction though. Holding an LWLock until end-of-transaction is a phenomenally bad idea, both because y

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-07 Thread Fujii Masao
On Tue, Feb 7, 2017 at 2:13 AM, Petr Jelinek wrote: > On 06/02/17 17:33, Fujii Masao wrote: >> On Sun, Feb 5, 2017 at 5:11 AM, Petr Jelinek >> wrote: >>> On 03/02/17 19:38, Fujii Masao wrote: On Sat, Feb 4, 2017 at 12:49 AM, Fujii Masao wrote: > On Fri, Feb 3, 2017 at 10:56 AM, Kyotaro

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-06 Thread Petr Jelinek
On 06/02/17 17:33, Fujii Masao wrote: > On Sun, Feb 5, 2017 at 5:11 AM, Petr Jelinek > wrote: >> On 03/02/17 19:38, Fujii Masao wrote: >>> On Sat, Feb 4, 2017 at 12:49 AM, Fujii Masao wrote: On Fri, Feb 3, 2017 at 10:56 AM, Kyotaro HORIGUCHI wrote: > At Fri, 3 Feb 2017 01:02:47 +09

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-06 Thread Fujii Masao
On Sun, Feb 5, 2017 at 5:11 AM, Petr Jelinek wrote: > On 03/02/17 19:38, Fujii Masao wrote: >> On Sat, Feb 4, 2017 at 12:49 AM, Fujii Masao wrote: >>> On Fri, Feb 3, 2017 at 10:56 AM, Kyotaro HORIGUCHI >>> wrote: At Fri, 3 Feb 2017 01:02:47 +0900, Fujii Masao wrote in > On

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-04 Thread Petr Jelinek
On 03/02/17 19:38, Fujii Masao wrote: > On Sat, Feb 4, 2017 at 12:49 AM, Fujii Masao wrote: >> On Fri, Feb 3, 2017 at 10:56 AM, Kyotaro HORIGUCHI >> wrote: >>> At Fri, 3 Feb 2017 01:02:47 +0900, Fujii Masao >>> wrote in >>> On Thu, Feb 2, 2017 at 2:36 PM, Michael Paquier wrote: >>>

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-03 Thread Fujii Masao
On Sat, Feb 4, 2017 at 12:49 AM, Fujii Masao wrote: > On Fri, Feb 3, 2017 at 10:56 AM, Kyotaro HORIGUCHI > wrote: >> At Fri, 3 Feb 2017 01:02:47 +0900, Fujii Masao wrote >> in >>> On Thu, Feb 2, 2017 at 2:36 PM, Michael Paquier >>> wrote: >>> > On Thu, Feb 2, 2017 at 2:13 PM, Tom Lane wrote:

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-03 Thread Fujii Masao
On Fri, Feb 3, 2017 at 10:56 AM, Kyotaro HORIGUCHI wrote: > At Fri, 3 Feb 2017 01:02:47 +0900, Fujii Masao wrote > in >> On Thu, Feb 2, 2017 at 2:36 PM, Michael Paquier >> wrote: >> > On Thu, Feb 2, 2017 at 2:13 PM, Tom Lane wrote: >> >> Kyotaro HORIGUCHI writes: >> >>> Then, the reason for

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-02 Thread Kyotaro HORIGUCHI
At Fri, 3 Feb 2017 01:02:47 +0900, Fujii Masao wrote in > On Thu, Feb 2, 2017 at 2:36 PM, Michael Paquier > wrote: > > On Thu, Feb 2, 2017 at 2:13 PM, Tom Lane wrote: > >> Kyotaro HORIGUCHI writes: > >>> Then, the reason for the TRY-CATCH cluase is that I found that > >>> some functions calle

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-02 Thread Fujii Masao
On Thu, Feb 2, 2017 at 2:36 PM, Michael Paquier wrote: > On Thu, Feb 2, 2017 at 2:13 PM, Tom Lane wrote: >> Kyotaro HORIGUCHI writes: >>> Then, the reason for the TRY-CATCH cluase is that I found that >>> some functions called from there can throw exceptions. >> >> Yes, but all LWLocks should be

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 2:13 PM, Tom Lane wrote: > Kyotaro HORIGUCHI writes: >> Then, the reason for the TRY-CATCH cluase is that I found that >> some functions called from there can throw exceptions. > > Yes, but all LWLocks should be released by normal error recovery. > It should not be necessar

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-01 Thread Tom Lane
Kyotaro HORIGUCHI writes: > Then, the reason for the TRY-CATCH cluase is that I found that > some functions called from there can throw exceptions. Yes, but all LWLocks should be released by normal error recovery. It should not be necessary for this code to clean that up by hand. If it were neces

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-01 Thread Kyotaro HORIGUCHI
At Thu, 2 Feb 2017 08:46:11 +0900, Michael Paquier wrote in > On Thu, Feb 2, 2017 at 2:14 AM, Fujii Masao wrote: > > 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? > > +PG_CATCH(); > +{

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 2:14 AM, Fujii Masao wrote: > 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? +PG_CATCH(); +{ +LWLockRelease(LogicalRepLauncherLock); +PG_RE_THROW(); +

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-01 Thread Fujii Masao
On Wed, Feb 1, 2017 at 5:36 PM, Kyotaro HORIGUCHI 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. Apply