-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
-
False
-
-
False
When the connector is configured with publication.autocreate.mode=filtered, it issues an ALTER PUBLICATION command on each restart to ensure the publication remains aligned with the tables being captured. Since the connector currently has no mechanism to detect whether the table inclusion list changed after the restart, it always executes ALTER PUBLICATION, even if the include list remains the same.
This can cause the connector to halt if the underlying tables configured in the publication are undergoing maintenance operations like VACUUM or are involved in long-running DDL statements. ALTER PUBLICATION, VACUUM and the DDLs require locks on the tables they operate on. When these locks conflict, PostgreSQL does not raise an error; instead, it queues the waiting statement until the blocking operation completes. Though this change introduced timeouts for the ALTER PUBLICATION command, it is still an issue as the connector has no way to progress even if there are no changes in the table include list and have to wait till the conflicting operation completes.
We propose having a check to compare the configured tables for the existing publication with the tables in the inclusion list. And only if they differ, the ALTER PUBLICATION command should run. Otherwise, the connector should continue using the same publication without altering.