Re: 2PC support for pglogical - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: 2PC support for pglogical
Date
Msg-id CAMsr+YHAtXwN7FUH6qiE_D9zgwR4wSg84xkkrBWeKjLSDsnMZg@mail.gmail.com
Whole thread Raw
In response to Re: 2PC support for pglogical  (Stas Kelvich <s.kelvich@postgrespro.ru>)
List pgsql-hackers
On 24 March 2016 at 22:20, Stas Kelvich <s.kelvich@postgrespro.ru> wrote:
 

I think all the locking already handled properly by creating dummy backend in PGPROC, as it done in usual postgres 2pc implementation.


On the downstream, yes. But what about the decoding, reorder buffer and output plugin? They access the relcache etc. If you changed the structure of a table in a prepared xact you have to make sure you get that right.
 
Just checked DDL with following scenario:

* prepare tx that inserts a row in table on master
* execute DROP TABLE on pglogical slave
* commit prepared on master

Now it behaves as expected — slave blocks DROP TABLE until commit prepared on master.

Try doing DDL in the prepared xact on the upstream side, especially things that make structural changes to tables. Test both things that do full-table rewrites (alter table ... add column ... default not null) and things that don't (alter table ... drop column ; alter table ... add column ...; without not null or default).


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

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: NOT EXIST for PREPARE
Next
From: Robert Haas
Date:
Subject: Re: VS 2015 support in src/tools/msvc