Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtCcC-00084A-HI for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Sep 2017 12:54:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dtCcB-0006nH-OS for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Sep 2017 12:54:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dtCad-00044v-Vo for pgsql-hackers@postgresql.org; Sat, 16 Sep 2017 12:52:56 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dtCaW-0000wt-O2 for pgsql-hackers@postgresql.org; Sat, 16 Sep 2017 12:52:54 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B93EA223AD; Sat, 16 Sep 2017 08:52:47 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Sat, 16 Sep 2017 08:52:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=pnBePPfN2EtlMwkOhXJ3s7ueGd2YifiuOrfUeflGB0k=; b=obb6Y5Zo 0yWM6uqVY4evLpJZKUy6FZcSN2wWOk91ESWUgA8b8OR9QX9VCz4ZY4poNI1cFWJp IrSEwtlJO0bXbUXMwqVaNARsI+SJ1MXkheS5tQ2NxFu9IlxHU/j1/6YvRiumxfmn oRM6Oa9PZZeRl5Cj0LOYgqxV4gTMEsr+RAR8XjaOOkHoPM3aq4WKc7TXYHAlr0C0 bNL9pMJIzzaCE7zTo+pVzcJHN0l2xfPHhCuoaVUiUtgiPteSWfojyakOUZlMBmBh 6H5vwYFiZAitrq6e/SLFHYObNFsQY5IdbBdFN5M4iVoJvyaBSXou1PDOu2y/LOAu WFhf+9V++c6sdw== X-ME-Sender: X-Sasl-enc: 30o6xujRvSLJCmJuzkFUPlJu8YGauiXI9YAatB2V9fN4 1505566367 Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 698752459C; Sat, 16 Sep 2017 08:52:47 -0400 (EDT) Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction To: Arseny Sher References: <87mv6av84w.fsf@ars-thinkpad> <48b251c6-0652-c131-975a-835d8cdb003c@2ndquadrant.com> <10937.1505245906@sss.pgh.pa.us> <87shfqsw22.fsf@ars-thinkpad> <87o9qd6p13.fsf@ars-thinkpad> <4a3d7e55-1f57-f501-d5ac-2adff9256878@2ndquadrant.com> <87mv5v50gt.fsf@ars-thinkpad> Cc: Tom Lane , pgsql-hackers@postgresql.org, Masahiko Sawada From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Sat, 16 Sep 2017 08:52:46 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <87mv5v50gt.fsf@ars-thinkpad> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 9/15/17 13:35, Arseny Sher wrote: > Peter Eisentraut writes: > >> Here is a simple patch that fixes this, based on my original proposal >> point #4. > > I checked, it passes the tests and solves the problem. However, isn't > this > > + if (slotname || !subenabled) > > is a truism? Is it possible that subscription has no slot but still > enabled? Yeah, we could just remove the _at_commit() branch entirely. That would effectively undo the change in 7e174fa793a2df89fe03d002a5087ef67abcdde8, but I don't see any other choice for now. And the practical impact would be quite limited. > Besides, we can avoid stopping the workers if subscription has no > associated replication origin, though this probably means that > subscription was broken by user and is not worth it. Right, it seems not worth addressing this case separately. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers