Обсуждение: logical replication slot and publication alter

Поиск
Список
Период
Сортировка

logical replication slot and publication alter

От
Jinhua Luo
Дата:
Hi All,

There is an interesting issue: I created one replication slot,
specifying pgouput plugin and one publication "foobar". The
publication "foobar" was set to tables "foo1, foo2".

The slot was left unread, while the tables foo1 and foo2 get changed.
Then, I alter the publication "foobar" to remove table "foo2" and
start logical replication.

The changes from foo2 still be sent from the slot!

Another try is even if I drop the publication "foobar", the slot still
find the original publication definition and send the changes without
problem.

I check the source codes, and I think it's due to the snapshot, when
pgoutput load the publication, it would use the catalog tuples from
the snapshot instead of current version, so even if the publication
get altered or get dropped, the original version is still there in the
snapshot.

Is it expected or it's a bug? Anyways, alter publication would not
affect the replication stream is unexpected.

Regards,
Jinhua Luo