Re: 2PC support for pglogical

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: 2PC support for pglogical
Дата
Msg-id CAMsr+YHAtXwN7FUH6qiE_D9zgwR4wSg84xkkrBWeKjLSDsnMZg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: 2PC support for pglogical  (Stas Kelvich <s.kelvich@postgrespro.ru>)
Список 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 по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: NOT EXIST for PREPARE
Следующее
От: Robert Haas
Дата:
Сообщение: Re: VS 2015 support in src/tools/msvc