Re: Logical replication and multimaster - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Logical replication and multimaster
Date
Msg-id CAMsr+YGUMJ_w6E-bjJ0exZ80iaBPr16F6FRrB+RsZAvOE9KRUw@mail.gmail.com
Whole thread Raw
In response to Re: Logical replication and multimaster  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 3 December 2015 at 01:30, Robert Haas <robertmhaas@gmail.com> wrote:
 
1. Do the transaction.
2. PREPARE.
3. Replay the transaction.

As Konstantin noted they aren't using Pg's 2PC. They actually couldn't if they wanted to because logical decoding does not support decoding an xact at PREPARE TRANSACTION time, without COMMIT PREPARED.

I'd love to change that and allow decoding at PREPARE TRANSACTION time - or streaming the xact from the start, as discussed in the prior mail. This would be a huge help for doing consensus operations on an otherwise asynchronous cluster, like making table structure changes. You'd decode the prepared xact, replay it, prepare it on all nodes, then commit prepared when all nodes confirm successful prepare.

IIRC the main issue with this is that the prepared xact continues to hold locks so logical decoding can't acquire the locks it needs to decode the xact.

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

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Logical replication and multimaster
Next
From: Peter Eisentraut
Date:
Subject: Re: Removing Functionally Dependent GROUP BY Columns