Re: [HACKERS] Logical replication in the same cluster
От | Petr Jelinek |
---|---|
Тема | Re: [HACKERS] Logical replication in the same cluster |
Дата | |
Msg-id | dcb5e17f-d5f7-9220-c4f9-2f9bf464a2a3@2ndquadrant.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] Logical replication in the same cluster (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>) |
Ответы |
Re: [HACKERS] Logical replication in the same cluster
|
Список | pgsql-hackers |
On 02/05/17 04:14, Peter Eisentraut wrote: > On 4/30/17 20:31, Andres Freund wrote: >> On 2017-04-26 23:41:51 +0200, Petr Jelinek wrote: >>> Yes that's result of how logical replication slots work, the transaction >>> that needs to finish is your transaction. It can be worked around by >>> creating the slot manually via the SQL interface for example and create >>> the subscription using WITH (NOCREATE SLOT, SLOT NAME = 'your slot') . >> >> Is there any chance the creation of the slot could be moved ahead, to >> before an xid has been assigned? > > The trend has rather been to do most of the stuff before creating the > slot, so that all the error checking is done. See for example > dcb39c37c1d3b90115e1501af8efb7af59c341c3. > Yes because otherwise we risk leaving slot on the upstream if the command fails downstream. We could move the slot creation outside of tx as I proposed, then we risk leaving subscription downstream without slot upstream though but I think that's less of a issues from user friendliness and mainly safety (slot reserves wal and global catalog xmin while subscription does not reserve anything except the name of the subscription). -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления: