logical replication slot and publication alter - Mailing list pgsql-hackers

From Jinhua Luo
Subject logical replication slot and publication alter
Date
Msg-id CAAc9rOzcgE_1ZFtcU1p=zFRVmkaGcYZ-gLhknCpC+qrC975=1g@mail.gmail.com
Whole thread Raw
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Psql patch to show access methods info
Next
From: Etsuro Fujita
Date:
Subject: Re: [HACKERS] advanced partition matching algorithm forpartition-wise join