Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZ1K6-0008AP-Fs for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Feb 2017 20:16:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cZ1K4-0002xN-Om for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Feb 2017 20:16:08 +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 1cZ1K2-0002vj-JD for pgsql-hackers@postgresql.org; Wed, 01 Feb 2017 20:16:06 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZ1Ju-0002rC-D4 for pgsql-hackers@postgresql.org; Wed, 01 Feb 2017 20:16:05 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 5507321C2A98; Wed, 1 Feb 2017 23:15:56 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Message-ID: <589241FB.8060509@postgrespro.ru> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1485980156; bh=1iTJr5QGtnQp6BxGkLjpPsnvGuKEgy29C/ERI37Avp8=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=XKUdlX/4mZIxgMv4lNR0LAwW3MfgQMf71+P2B75Kl+IFBBm5xjxlUILHg96hnMoP8 k7KLQjIIamYY+wCk9ieu0INZK/928NUSA0aHpXeyrLHqPwHVvhH6oyJyMyklR8AoK8 qD16rg0gbzyIx86lVAD6e61L7UurvvFHAnRrSro0= Date: Wed, 01 Feb 2017 23:15:55 +0300 From: Konstantin Knizhnik User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Tom Lane , Robert Haas CC: Michael Paquier , Craig Ringer , PostgreSQL Hackers , Stas Kelvich , Simon Riggs Subject: Re: logical decoding of two-phase transactions References: <02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru> <89073436-925E-4299-A9AF-88D04E55C231@postgrespro.ru> <3477E635-F590-4432-BD20-C59142B65CD3@postgrespro.ru> <19628.1485977554@sss.pgh.pa.us> In-Reply-To: <19628.1485977554@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 02/01/2017 10:32 PM, Tom Lane wrote: > Robert Haas writes: >> Also, including the GID in the WAL for each COMMIT/ABORT PREPARED >> doesn't seem inordinately expensive to me. > I'm confused ... isn't it there already? If not, how do we handle > reconstructing 2PC state from WAL at all? > > regards, tom lane > > Right now logical decoding ignores prepare and take in account only "commit prepared": /* * Currently decoding ignores PREPARE TRANSACTION and will just * decode the transaction when the COMMIT PREPARED is sent or * throw away the transaction's contents when a ROLLBACK PREPARED * is received. In the future we could add code to expose prepared * transactions in the changestream allowing for a kind of * distributed 2PC. */ For some scenarios it works well, but if we really need prepared state at replica (as in case of multimaster), then it is not enough. -- Konstantin Knizhnik 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