On 24 March 2016 at 22:20, Stas Kelvich <s.kelv...@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

Reply via email to