Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csfiL-0000VN-Pk for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 01:14:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1csfiL-0003e4-4m for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 01:14:25 +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 1csfgq-0000yA-6l for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 01:12:52 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csfgi-0007PJ-I8 for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 01:12:51 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 624D621C2522; Tue, 28 Mar 2017 04:12:43 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1490663563; bh=lYscjQvo2OTTebOw3gv8P8wJ1kXTf/oWQGK44zEaqt0=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=kozxPM6ujfD2hPfnZuxnGxtPWNL2WDDMUeVhWpmHiFpk8VVHZ5iuK1I0grngo5BMi zQ4IwrRc4QVh2sMR4iC3LR7tZCZ1K17bbuaAxgeBsbgB8QSK76gmtEGaoqf3zLdI29 +QlXgvxQv+DRv406lfzJ1K/amsxdjQ2D86RdlFCY= Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: logical decoding of two-phase transactions From: Stas Kelvich In-Reply-To: <20170327212528.cwf4aotytwrsowwx@alap3.anarazel.de> Date: Tue, 28 Mar 2017 04:12:41 +0300 Cc: Craig Ringer , Petr Jelinek , PostgreSQL Hackers , Robert Haas Content-Transfer-Encoding: quoted-printable Message-Id: References: <1A2E98FB-7705-43A0-B625-3F55A8FFE5D1@postgrespro.ru> <20170327212528.cwf4aotytwrsowwx@alap3.anarazel.de> To: Andres Freund X-Mailer: Apple Mail (2.3259) X-Pg-Spam-Score: -2.0 (--) 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 28 Mar 2017, at 00:25, Andres Freund wrote: >=20 > Hi, >=20 > On 2017-03-28 00:19:29 +0300, Stas Kelvich wrote: >> Ok, here it is. >=20 > On a very quick skim, this doesn't seem to solve the issues around > deadlocks of prepared transactions vs. catalog tables. What if the > prepared transaction contains something like LOCK pg_class; (there's a > lot more realistic examples)? Then decoding won't be able to continue, > until that transaction is committed / aborted? But why is that deadlock? Seems as just lock. In case of prepared lock of pg_class decoding will wait until it committed = and then continue to decode. As well as anything in postgres that accesses pg_c= lass, including inability to connect to database and bricking database if you acc= identally disconnected before committing that tx (as you showed me some while ago :-). IMO it is issue of being able to prepare such lock, than of decoding. Is there any other scenarios where catalog readers are blocked except expli= cit lock on catalog table? Alters on catalogs seems to be prohibited. Stas Kelvich Postgres Professional: http://www.postgrespro.com The Russian Postgres Company --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers