Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvMVq-0002Zm-7H for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Sep 2017 11:52:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dvMVp-0007BL-P0 for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Sep 2017 11:52:53 +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 1dvMVn-000790-Qu for pgsql-hackers@postgresql.org; Fri, 22 Sep 2017 11:52:51 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvMVl-0002GF-Hz for pgsql-hackers@postgresql.org; Fri, 22 Sep 2017 11:52:51 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id E944E21C1E45; Fri, 22 Sep 2017 14:52:48 +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 B8FB421C091B; Fri, 22 Sep 2017 14:52:48 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1506081168; bh=kUHwCh01ufkjFrcdgoXHpBP4ySaJ3mDhLyR2ncuscIg=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=iq8U2be2dJUOs5YWLICigl0wb1wYNC8x1H9vjlHU6KlKIWeOZjK39ZICeNNZT/qRr uT6fs58cIGnsZ8n/q1ASGtGo4q0K22EsxHRftJnk5IVkB1CJ1GHYhAC5GyuTqorL6S DTZpgAl1D7zTzagZKHvDLFuNJ9VVsBGuZznCM2Go= From: Arseny Sher To: Masahiko Sawada Cc: Peter Eisentraut , Tom Lane , PostgreSQL-development Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction 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> Date: Fri, 22 Sep 2017 14:52:48 +0300 In-Reply-To: (Masahiko Sawada's message of "Thu, 21 Sep 2017 17:43:03 +0900") Message-ID: <871smzeyr3.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: > On Sun, Sep 17, 2017 at 2:01 AM, Masahiko Sawada wrote: >> + >> + Since dropping a replication slot is not transactional, we cannot run >> + DROP SUBSCRIPTION inside a transaction block if dropping >> + the replication slot. Also, DROP SUBSCRIPTOIN stops the >> + workers if the subscription got disabled in a transaction block even if >> + the transaction rolls back. >> + > > Hmm, isn't there necessary to care and mention about this kind of > inconsistent behavior in docs? Well, docs already say that dropping sub with replication slot is non-transactional, see 'Description' section of DROP SUBSCRIPTION. As for the second sentence, normally launcher will restart the worker immediately after ABORT: old worker wakes up the launcher on exit, the launcher waits on pg_subscription lock and restarts the worker instantly after the rollback. If we tell users that the workers are stopped after DROP SUBSCRIPTION rollback, we should also say that they will be restarted soon. -- 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