pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stas Kelvich <s.kelvich@postgrespro.ru>
To: 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: Mon, 20 Mar 2017 16:47:50 +0300
Message-ID: <F5187EFB-8907-4D73-B961-9AC8B45B03CD@postgrespro.ru> (raw)
In-Reply-To: <CAMsr+YHwPAeMrD2HEnQFy5dQr8CR=fwVjnokZNFua_K+QmMhBA@mail.gmail.com>
References: <02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru>
	<CAMsr+YH0aRgnk8XwyYypV1E10DNXwgGpWTLq_P2MGjACpiwMpA@mail.gmail.com>
	<89073436-925E-4299-A9AF-88D04E55C231@postgrespro.ru>
	<CAMsr+YGX6Q-VNXEhu3sriCf0wCS6hjQ0Lhj4rJ8VueVuuka+fg@mail.gmail.com>
	<3477E635-F590-4432-BD20-C59142B65CD3@postgrespro.ru>
	<CAMsr+YHos95GFyfd2Gk61-66wpxFTgXJh=sBV3Rtfhe3xzG1HQ@mail.gmail.com>
	<CAB7nPqQogmPYRkb=wwA4veeAWZXwDXQA64vw7fO_mHuDhAOHoA@mail.gmail.com>
	<CAMsr+YHQzGxnR-peT4SbX2-xiG2uApJMTgZ4a3TiRBM6COyfqg@mail.gmail.com>
	<1FE466EA-7058-484D-B0DB-42CD81FA59F0@postgrespro.ru>
	<CAMsr+YHVNW-Lh-XnYnkfhGL2QT8kK9kM4zkZ4+Sv=fszhujj-g@mail.gmail.com>
	<46ebc39d-82a0-e59f-2552-2ea8911a64e7@2ndquadrant.com>
	<DFE91C41-1410-4D89-B7D6-819F5FDC1437@postgrespro.ru>
	<CAMsr+YHbvCtVetrtJ1_LCKen98d3cG8zmHP_-nSm=aDj6yc0vQ@mail.gmail.com>
	<25A09FA8-5B0E-447D-97FB-F37F3B0E34E9@postgrespro.ru>
	<EEBD82AA-61EE-46F4-845E-05B94168E8F2@postgrespro.ru>
	<CAMsr+YE5UC7MeZFt7+rhNrcacAne8bogftJH3GtqGQwMN4a1Gg@mail.gmail.com>
	<8217d096-3641-8022-09e4-4e625633b278@2ndquadrant.com>
	<CAMsr+YFKAw2Cc5Z+Jbw72FeLDBzUhs0drECxG4pmgkTH7LsoJg@mail.gmail.com>
	<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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


> On 20 Mar 2017, at 16:39, Craig Ringer <craig@2ndquadrant.com> wrote:
> 
> On 20 March 2017 at 20:57, Stas Kelvich <s.kelvich@postgrespro.ru> wrote:
>> 
>>> On 20 Mar 2017, at 15:17, Craig Ringer <craig@2ndquadrant.com> wrote:
>>> 
>>>> I thought about having special field (or reusing one of the existing fields)
>>>> in snapshot struct to force filtering xmax > snap->xmax or xmin = snap->xmin
>>>> as Petr suggested. Then this logic can reside in ReorderBufferCommit().
>>>> However this is not solving problem with catcache, so I'm looking into it right now.
>>> 
>>> OK, so this is only an issue if we have xacts that change the schema
>>> of tables and also insert/update/delete to their heaps. Right?
>>> 
>>> So, given that this is CF3 for Pg10, should we take a step back and
>>> impose the limitation that we can decode 2PC with schema changes or
>>> data row changes, but not both?
>> 
>> Yep, time is tight. I’ll try today/tomorrow to proceed with this two scan approach.
>> If I’ll fail to do that during this time then I’ll just update this patch to decode
>> only non-ddl 2pc transactions as you suggested.
> 
> I wasn't suggesting not decoding them, but giving the plugin the
> option of whether to proceed with decoding or not.
> 
> As Simon said, have a pre-decode-prepared callback that lets the
> plugin get a lock on the 2pc xact if it wants, or say it doesn't want
> to decode it until it commits.
> 
> That'd be useful anyway, so we can filter and only do decoding at
> prepare transaction time of xacts the downstream wants to know about
> before they commit.

Ah, got that. Okay.

> -- 
> Craig Ringer                   http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services



-- 
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: <F5187EFB-8907-4D73-B961-9AC8B45B03CD@postgrespro.ru>
Permalink:  ../F5187EFB-8907-4D73-B961-9AC8B45B03CD@postgrespro.ru/
Also on:    postgresql.org/message-id/F5187EFB-8907-4D73-B961-9AC8B45B03CD@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, craig@2ndquadrant.com, petr.jelinek@2ndquadrant.com, robertmhaas@gmail.com
  Subject: Re: logical decoding of two-phase transactions
  In-Reply-To: <F5187EFB-8907-4D73-B961-9AC8B45B03CD@postgrespro.ru>
  References: <02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru> <1FE466EA-7058-484D-B0DB-42CD81FA59F0@postgrespro.ru> <CAMsr+YHVNW-Lh-XnYnkfhGL2QT8kK9kM4zkZ4+Sv=fszhujj-g@mail.gmail.com> <46ebc39d-82a0-e59f-2552-2ea8911a64e7@2ndquadrant.com> <DFE91C41-1410-4D89-B7D6-819F5FDC1437@postgrespro.ru> <CAMsr+YHbvCtVetrtJ1_LCKen98d3cG8zmHP_-nSm=aDj6yc0vQ@mail.gmail.com> <25A09FA8-5B0E-447D-97FB-F37F3B0E34E9@postgrespro.ru> <EEBD82AA-61EE-46F4-845E-05B94168E8F2@postgrespro.ru> <CAMsr+YE5UC7MeZFt7+rhNrcacAne8bogftJH3GtqGQwMN4a1Gg@mail.gmail.com> <8217d096-3641-8022-09e4-4e625633b278@2ndquadrant.com> <CAMsr+YFKAw2Cc5Z+Jbw72FeLDBzUhs0drECxG4pmgkTH7LsoJg@mail.gmail.com> <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>

* 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