Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYUxR-0008D9-0Y for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Jan 2017 09:42:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cYUxQ-000517-1g for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Jan 2017 09:42:36 +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 1cYUxN-0004zZ-Q4 for pgsql-hackers@postgresql.org; Tue, 31 Jan 2017 09:42:33 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYUxG-00078E-8v for pgsql-hackers@postgresql.org; Tue, 31 Jan 2017 09:42:33 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id A684721C2980 for ; Tue, 31 Jan 2017 12:42:24 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Subject: Re: logical decoding of two-phase transactions DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1485855744; bh=CIFgUjKzx9RHfeqPhsK0uSj399wBa68ooPjoZcF/9xA=; h=To:References:From:Date:In-Reply-To; b=HmHKf1EqCkQiRAoZS3qPiCt9h8sqIZ9BNe0LwdUlh71XswCbe6Alod119ToKvcd9q hDoW6VXfIqrOwmTjV3440FVKAOMZVGJd3IGmeEl16nDpYLj8n0oWgS7D8MD+ifa7Fp yZGxqj7SVzh28sgRt2jIls5XJdZZICsE45cax4oU= To: pgsql-hackers@postgresql.org References: <02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru> <89073436-925E-4299-A9AF-88D04E55C231@postgrespro.ru> <3477E635-F590-4432-BD20-C59142B65CD3@postgrespro.ru> From: Konstantin Knizhnik Message-ID: Date: Tue, 31 Jan 2017 12:42:31 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed 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 31.01.2017 09:29, Michael Paquier wrote: > On Fri, Jan 27, 2017 at 8:52 AM, Craig Ringer wrote: >> Now, if it's simpler to just xlog the gid at COMMIT PREPARED time when >> wal_level >= logical I don't think that's the end of the world. But >> since we already have almost everything we need in memory, why not >> just stash the gid on ReorderBufferTXN? > I have been through this thread... And to be honest, I have a hard > time understanding for which purpose the information of a 2PC > transaction is useful in the case of logical decoding. The prepare and > commit prepared have been received by a node which is at the root of > the cluster tree, a node of the cluster at an upper level, or a > client, being in charge of issuing all the prepare queries, and then > issue the commit prepared to finish the transaction across a cluster. > In short, even if you do logical decoding from the root node, or the > one at a higher level, you would care just about the fact that it has > been committed. Sorry, may be I do not completely understand your arguments. Actually our multimaster is completely based now on logical replication and 2PC (more precisely we are using 3PC now:) State of transaction (prepared, precommitted, committed) should be persisted in WAL to make it possible to perform recovery. Recovery can involve transactions in any state. So there three records in the WAL: PREPARE, PRECOMMIT, COMMIT_PREPARED and recovery can involve either all of them, either PRECOMMIT+COMMIT_PREPARED either just COMMIT_PREPARED. -- 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