Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWej1-0000v3-Ub for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Jan 2017 07:44:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cWej0-0005pH-U7 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Jan 2017 07:44:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cWeiz-0005oW-7s for pgsql-hackers@postgresql.org; Thu, 26 Jan 2017 07:44:05 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWeiv-0003Oj-HK for pgsql-hackers@postgresql.org; Thu, 26 Jan 2017 07:44:04 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id BA1CC21C2A4D; Thu, 26 Jan 2017 10:43:58 +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=1485416638; bh=+mmtZiovoMOOybc/iGaTWZGGAW6+3P2AjUUpjbXiQp4=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=mzKpS5f6zD1o+Gy48Q+tWVPn89vhr47PLVTGm9G5oP6ACtUnKrDR1q1dISlEsxTP1 6h4zHfo0DuSlBAuiI7h4IWcj+p+jxnojic6uHnZ576kdeeSPlB7TaO0fTSHII2sZph HUJu+8Pl69/MCNj/0jQL11Ny627Z4myNgmxAnvPw= 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: Thu, 26 Jan 2017 10:43:58 +0300 Cc: Simon Riggs , PostgreSQL mailing lists Content-Transfer-Encoding: quoted-printable Message-Id: <89073436-925E-4299-A9AF-88D04E55C231@postgrespro.ru> References: <02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru> To: Craig Ringer X-Mailer: Apple Mail (2.3259) X-Pg-Spam-Score: -5.2 (-----) 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 >>=20 >> Yes, that=E2=80=99s also possible but seems to be less flexible restrict= ing us to some >> specific GID format. >>=20 >> Anyway, I can measure WAL space overhead introduced by the GID=E2=80=99s= inside commit records >> to know exactly what will be the cost of such approach. >=20 > Stas, >=20 > Have you had a chance to look at this further? Generally i=E2=80=99m okay with Simon=E2=80=99s approach and will send send= updated patch. Anyway want to perform some test to estimate how much disk space is actually wasted by ext= ra WAL records. > I think the approach of storing just the xid and fetching the GID > during logical decoding of the PREPARE TRANSACTION is probably the > best way forward, per my prior mail. I don=E2=80=99t think that=E2=80=99s possible in this way. If we will not p= ut GID in commit record, than by the time when logical decoding will happened transaction will be already committed/a= borted and there will be no easy way to get that GID. I thought about several possibilities: * Tracking xid/gid map in memory also doesn=E2=80=99t help much =E2=80=94 i= f server reboots between prepare=20 and commit we=E2=80=99ll lose that mapping.=20 * We can provide some hooks on prepared tx recovery during startup, but tha= t approach also fails if reboot happened between commit and decoding of that commit. * Logical messages are WAL-logged, but they don=E2=80=99t have any redo fun= ction so don=E2=80=99t helps much. So to support user-accessible 2PC over replication based on 2PC decoding we= should invent something more nasty like writing them into a table. > That should eliminate Simon's > objection re the cost of tracking GIDs and still let us have access to > them when we want them, which is the best of both worlds really. Having 2PC decoding in core is a good thing anyway even without GID trackin= g =3D) -- 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