Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpws6-000401-4H for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Mar 2017 12:57:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cpws5-0006jP-NF for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Mar 2017 12:57:13 +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 1cpws4-0006fW-2J for pgsql-hackers@postgresql.org; Mon, 20 Mar 2017 12:57:12 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpws1-0006em-9m for pgsql-hackers@postgresql.org; Mon, 20 Mar 2017 12:57:11 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 1DA0A21C2593; Mon, 20 Mar 2017 15:57:08 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1490014627; bh=twPilpClOGUk0FBPfIejx1XYGOsgLGheX6swfxv7lp4=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=IA3NrnS0KZ8eHr8b8MPt6UAu3qM3NgpYEvSh0LqkaoHynl0+Rmn691E4XwPN3evMZ 4zviTldmpWjlcb5de7fEylChr8TJhP2zXPNkEIerCcQ4UzrHoAh1PHaaGhcPh20BCJ x4+hryfS69yZwYuOhRRdIix0zb5sn3Or2rStwz0U= 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: Date: Mon, 20 Mar 2017 15:57:07 +0300 Cc: Petr Jelinek , PostgreSQL Hackers , Robert Haas Content-Transfer-Encoding: quoted-printable Message-Id: References: <02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru> <89073436-925E-4299-A9AF-88D04E55C231@postgrespro.ru> <3477E635-F590-4432-BD20-C59142B65CD3@postgrespro.ru> <1FE466EA-7058-484D-B0DB-42CD81FA59F0@postgrespro.ru> <46ebc39d-82a0-e59f-2552-2ea8911a64e7@2ndquadrant.com> <25A09FA8-5B0E-447D-97FB-F37F3B0E34E9@postgrespro.ru> <8217d096-3641-8022-09e4-4e625633b278@2ndquadrant.com> To: Craig Ringer 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 20 Mar 2017, at 15:17, Craig Ringer wrote: >=20 >> I thought about having special field (or reusing one of the existing fie= lds) >> in snapshot struct to force filtering xmax > snap->xmax or xmin =3D 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 i= t right now. >=20 > 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? >=20 > 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=E2=80=99ll try today/tomorrow to proceed with this tw= o scan approach. If I=E2=80=99ll fail to do that during this time then I=E2=80=99ll just upd= ate this patch to decode only non-ddl 2pc transactions as you suggested. >> Just as before I marking this transaction committed in snapbuilder, but = after >> decoding I delete this transaction from xip (which holds committed trans= actions >> in case of historic snapshot). >=20 > That seems kind of hacky TBH. I didn't much like marking it as > committed then un-committing it. >=20 > I think it's mostly an interface issue though. I'd rather say > SnapBuildPushPrepareTransaction and SnapBuildPopPreparedTransaction or > something, to make it clear what we're doing. Yes, that will be less confusing. However there is no any kind of queue, so SnapBuildStartPrepare / SnapBuildFinishPrepare should work too. > --=20 > Craig Ringer http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Training & Services 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