Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drnhQ-0007xy-BI for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Sep 2017 16:06:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1drnhP-0004BZ-Nd for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Sep 2017 16:06:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1drnQE-0000fg-Gs for pgsql-hackers@postgresql.org; Tue, 12 Sep 2017 15:48:22 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drnQB-0002hr-Jy for pgsql-hackers@postgresql.org; Tue, 12 Sep 2017 15:48:22 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 70E0421C1D11; Tue, 12 Sep 2017 18:48:18 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from ars-thinkpad (unknown [192.168.27.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 4911321C1D0F; Tue, 12 Sep 2017 18:48:18 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1505231298; bh=nb+e6igV0VxS0uby/LOoBQgtnoBElrlohE/GVpD37FM=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=oJWr4+EMuktQCAf+CLwKQ/dfr+PI4dcbiBZTsNsRwe3dN3+GTeqslI5TP+Rwjnmkq 7d9/PvJaedCS9HCodtq1TJCfyBfWKwA5cgLbhRjnJajym1AmD3llsyLHRzDePMbr2b 3NVnyvq7qJcqMTkXNFJ8N+mtzNsMf3BWQmYmRVxQ= From: Arseny Sher To: Masahiko Sawada Cc: PostgreSQL-development Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction References: <87mv6av84w.fsf@ars-thinkpad> <87ingyv81u.fsf@ars-thinkpad> Date: Tue, 12 Sep 2017 18:48:18 +0300 In-Reply-To: (Masahiko Sawada's message of "Wed, 13 Sep 2017 00:29:56 +0900") Message-ID: <87bmmfuddp.fsf@ars-thinkpad> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 Masahiko Sawada writes: > 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. I don't think this is reliable -- what if worker suddenly dies without accomplishing the job? It is enough to kill the worker during execution of (possibly long) transaction with DROP SUBSCRIPTION to meet such situation. Dropping replication origin in one transaction with DROP SUBSCRIPTION seems natural to me. -- Arseny Sher -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers