pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arseny Sher <a.sher@postgrespro.ru>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction
Date: Fri, 22 Sep 2017 14:52:48 +0300
Message-ID: <871smzeyr3.fsf@ars-thinkpad> (raw)
In-Reply-To: <CAD21AoDByUZXU0ha10UEmSU_FzYTjeb0323iAq3_ckpV8aOW0A@mail.gmail.com>
References: <87mv6av84w.fsf@ars-thinkpad>
	<48b251c6-0652-c131-975a-835d8cdb003c@2ndquadrant.com>
	<10937.1505245906@sss.pgh.pa.us>
	<87shfqsw22.fsf@ars-thinkpad>
	<c523d4e6-d082-a8b2-e728-7ede1f2fef3a@2ndquadrant.com>
	<87o9qd6p13.fsf@ars-thinkpad>
	<4a3d7e55-1f57-f501-d5ac-2adff9256878@2ndquadrant.com>
	<87mv5v50gt.fsf@ars-thinkpad>
	<b4c42958-e67f-fb12-28b1-2da55f3ef97d@2ndquadrant.com>
	<CAD21AoCbEqLD48N+k5Z+1xB+amh7+Z7G8D-DyOkE7q0n6CYWpw@mail.gmail.com>
	<CAD21AoDByUZXU0ha10UEmSU_FzYTjeb0323iAq3_ckpV8aOW0A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Masahiko Sawada <sawada.mshk@gmail.com> writes:

> On Sun, Sep 17, 2017 at 2:01 AM, Masahiko Sawada <sawada.mshk@gmail.com> wrote:

>> +  <para>
>> +   Since dropping a replication slot is not transactional, we cannot run
>> +   <command>DROP SUBSCRIPTION</command> inside a transaction block if dropping
>> +   the replication slot. Also, <command>DROP SUBSCRIPTOIN</command> stops the
>> +   workers if the subscription got disabled in a transaction block even if
>> +   the transaction rolls back.
>> +  </para>
>
> 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



view thread (32+ messages)  latest in thread

Message-ID: <871smzeyr3.fsf@ars-thinkpad>
Permalink:  ../871smzeyr3.fsf@ars-thinkpad/
Also on:    postgresql.org/message-id/871smzeyr3.fsf@ars-thinkpad

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: a.sher@postgrespro.ru, sawada.mshk@gmail.com, peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us
  Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction
  In-Reply-To: <871smzeyr3.fsf@ars-thinkpad>
  References: <87mv6av84w.fsf@ars-thinkpad> <48b251c6-0652-c131-975a-835d8cdb003c@2ndquadrant.com> <10937.1505245906@sss.pgh.pa.us> <87shfqsw22.fsf@ars-thinkpad> <c523d4e6-d082-a8b2-e728-7ede1f2fef3a@2ndquadrant.com> <87o9qd6p13.fsf@ars-thinkpad> <4a3d7e55-1f57-f501-d5ac-2adff9256878@2ndquadrant.com> <87mv5v50gt.fsf@ars-thinkpad> <b4c42958-e67f-fb12-28b1-2da55f3ef97d@2ndquadrant.com> <CAD21AoCbEqLD48N+k5Z+1xB+amh7+Z7G8D-DyOkE7q0n6CYWpw@mail.gmail.com> <CAD21AoDByUZXU0ha10UEmSU_FzYTjeb0323iAq3_ckpV8aOW0A@mail.gmail.com> <871smzeyr3.fsf@ars-thinkpad>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox