pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stas Kelvich <s.kelvich@postgrespro.ru>
To: Andres Freund <andres@anarazel.de>
Cc: Craig Ringer <craig@2ndquadrant.com>
Cc: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: logical decoding of two-phase transactions
Date: Tue, 28 Mar 2017 04:12:41 +0300
Message-ID: <A434797D-1283-42C5-8CE5-7F1CD0B68F36@postgrespro.ru> (raw)
In-Reply-To: <20170327212528.cwf4aotytwrsowwx@alap3.anarazel.de>
References: <E6112EA9-2949-4E4A-8FE4-1C6A2096379D@postgrespro.ru>
	<CAMsr+YFsN5D=dPjoyXN33OBTGJgfYn3rrh-BH3GX5Qfbg-3VRA@mail.gmail.com>
	<EFF3D2BF-05BD-4EBA-A254-27EED342CD22@postgrespro.ru>
	<CAMsr+YHwPAeMrD2HEnQFy5dQr8CR=fwVjnokZNFua_K+QmMhBA@mail.gmail.com>
	<F5187EFB-8907-4D73-B961-9AC8B45B03CD@postgrespro.ru>
	<CAMsr+YGkEtwcsvQSU_6w2hnoY=oGEAxdK_ApYs3e-iwqSm06qg@mail.gmail.com>
	<CAMsr+YF0FDNjstkKzByeyG3G66SWf_mbH+cr3qhKAK3UYaZzaA@mail.gmail.com>
	<DFC9E270-4554-4E46-B2F8-FD864C29610D@postgrespro.ru>
	<CAMsr+YGm-pft3CtxbzP0SOFj6rN62Loh43hj2oYjuYCVbDLXFg@mail.gmail.com>
	<1A2E98FB-7705-43A0-B625-3F55A8FFE5D1@postgrespro.ru>
	<20170327212528.cwf4aotytwrsowwx@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


> On 28 Mar 2017, at 00:25, Andres Freund <andres@anarazel.de> wrote:
> 
> Hi,
> 
> On 2017-03-28 00:19:29 +0300, Stas Kelvich wrote:
>> Ok, here it is.
> 
> 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_class,
including inability to connect to database and bricking database if you accidentally
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 explicit lock
on catalog table? Alters on catalogs seems to be prohibited.

Stas Kelvich
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company




-- 
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 (644+ messages)  latest in thread

Message-ID: <A434797D-1283-42C5-8CE5-7F1CD0B68F36@postgrespro.ru>
Permalink:  ../A434797D-1283-42C5-8CE5-7F1CD0B68F36@postgrespro.ru/
Also on:    postgresql.org/message-id/A434797D-1283-42C5-8CE5-7F1CD0B68F36@postgrespro.ru

 · 

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: s.kelvich@postgrespro.ru, andres@anarazel.de, craig@2ndquadrant.com, petr.jelinek@2ndquadrant.com, robertmhaas@gmail.com
  Subject: Re: logical decoding of two-phase transactions
  In-Reply-To: <A434797D-1283-42C5-8CE5-7F1CD0B68F36@postgrespro.ru>
  References: <E6112EA9-2949-4E4A-8FE4-1C6A2096379D@postgrespro.ru> <CAMsr+YFsN5D=dPjoyXN33OBTGJgfYn3rrh-BH3GX5Qfbg-3VRA@mail.gmail.com> <EFF3D2BF-05BD-4EBA-A254-27EED342CD22@postgrespro.ru> <CAMsr+YHwPAeMrD2HEnQFy5dQr8CR=fwVjnokZNFua_K+QmMhBA@mail.gmail.com> <F5187EFB-8907-4D73-B961-9AC8B45B03CD@postgrespro.ru> <CAMsr+YGkEtwcsvQSU_6w2hnoY=oGEAxdK_ApYs3e-iwqSm06qg@mail.gmail.com> <CAMsr+YF0FDNjstkKzByeyG3G66SWf_mbH+cr3qhKAK3UYaZzaA@mail.gmail.com> <DFC9E270-4554-4E46-B2F8-FD864C29610D@postgrespro.ru> <CAMsr+YGm-pft3CtxbzP0SOFj6rN62Loh43hj2oYjuYCVbDLXFg@mail.gmail.com> <1A2E98FB-7705-43A0-B625-3F55A8FFE5D1@postgrespro.ru> <20170327212528.cwf4aotytwrsowwx@alap3.anarazel.de> <A434797D-1283-42C5-8CE5-7F1CD0B68F36@postgrespro.ru>

* 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