[HACKERS] DROP SUBSCRIPTION and ROLLBACK

Поиск
Список
Период
Сортировка
От Masahiko Sawada
Тема [HACKERS] DROP SUBSCRIPTION and ROLLBACK
Дата
Msg-id CAD21AoD+VO93zZ4ZQtZQb-jZ_wMko3OgGdx1MXO4T+8q_zHDDA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [HACKERS] DROP SUBSCRIPTION and ROLLBACK  (Fujii Masao <masao.fujii@gmail.com>)
Re: [HACKERS] DROP SUBSCRIPTION and ROLLBACK  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
Список pgsql-hackers
Hi all,

While testing logical replciation I found that if the transaction
issued DROP SUBSCRIPTION rollbacks then the logical repliation stops
and the subscription can never be removed later. The document says
that the replication worker associated with the subscription will not
stop until after the transaction that issued this command has
committed but it doesn't work.

The cause of this is that DropSubscription stops the apply worker and
drops corresponding replication slot on publisher side without waiting
for commit or rollback. The launcher process launches the apply worker
again but the launched worker will fail to start logical replication
because corresponding replication slot is already removed. And the
orphan subscription can not be removed later.

I think the logical replication should not stop and the corresponding
replication slot and replication origin should not be removed until
the transaction commits.

The solution for this I came up with is that the launcher process
stops the apply worker after DROP SUBSCRIPTION is committed rather
than DropSubscription does. And the apply worker drops replication
slot and replication origin before exits. Attached draft patch fixes
this issue.

Please give me feedback.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavan Deolasee
Дата:
Сообщение: Re: [HACKERS] [COMMITTERS] pgsql: Release note updates.
Следующее
От: Bernd Helmle
Дата:
Сообщение: Re: [HACKERS] LWLock optimization for multicore Power machines