Repository navigation
CON-589: postgres_cdc: allow an externally managed publication - #5000
Conversation
…blications (CON-589)
…, and require every partition for coverage
…e, validate publish operations and filters, and watch external publications
Connect docs checkThe docs build passed with this PR's generated docs. This PR changes 2 published pages (6 generated files: 6 changed, 0 added, 0 removed). Review the rendered pages, not only the Go strings.
Per-file diffs and the rendered-HTML findings are in the job summary. Checked at 4484b27. |
… read publication tables without re-reading the publication
Leward
left a comment
There was a problem hiding this comment.
This PR does two things: it adds the external mode, and it changes the default mode.
The changes to the default mode are real behavior changes. The publication sync works differently, and the dedup check now rejects more tables.
The changelog is generated from the commit message. After a squash, these changes ship under "allow an externally managed publication". Users of the default mode will not see that their behavior changed.
Can you move the default-mode changes to their own PR, and stack the external mode on top of it? Then each part gets its own commit message, and we can revert one without the other.
… FOR ALL TABLES publication when tables is set, and only backfill tables published as themselves
…xternal publication branch
Split: the default-mode changes (publication sync from pg_publication_rel, the FOR ALL TABLES error, and the backfill check for tables published as themselves) are now in #5080. This PR is stacked on it and only adds self_manage_publication: false. Once #5080 merges, this one retargets to main. |
…res_publication_missing_tables, and say changes to a table out of the publication are lost
# Conflicts: # internal/impl/postgresql/input_pg_stream.go
# Conflicts: # internal/impl/postgresql/input_pg_stream.go
…lf on PostgreSQL 12, 14 and 17
…d note the publication check in pg_wal_monitor_interval
# Conflicts: # internal/impl/postgresql/input_pg_stream.go # internal/impl/postgresql/pglogicalstream/incremental_snapshot.go # internal/impl/postgresql/pglogicalstream/pglogrepl.go # internal/impl/postgresql/pglogicalstream/pglogrepl_test.go # internal/impl/postgresql/pglogicalstream/publication_test.go
Replaced with #5080. |
# Conflicts: # internal/impl/postgresql/pglogicalstream/pglogrepl.go
Adds a
self_manage_publicationoption topostgres_cdc(defaulttrue). Whenfalse, the input validates a DBA-owned publication and never alters it: on every connect it checks that the publication exists, publishes inserts, updates and deletes, and covers every configured table and the signal table, and fails naming whatever is missing. A partitioned table counts as covered only when every leaf partition is published, directly or through an ancestor. The check needs PostgreSQL 12 or later, and the input fails fast on older servers in this mode.While the input runs, the monitor repeats the coverage check every
wal_monitor_interval, logs an error when a table leaves the publication, and reports the count inpostgres_publication_missing_tables. Tables streamed with a row filter or column list are logged as a warning at connect. Incremental snapshots against an external publication re-check that the table is still published as itself on every signal, on resume and before every chunk, and abort the backfill if it no longer is.Stacked on #5080, which carries the changes to the default (
self_manage_publication: true) behaviour: the publication sync frompg_publication_rel, theFOR ALL TABLESandFOR TABLES IN SCHEMAerrors whentablesis set, and the published-as-itself backfill check. Review and merge that one first; this PR's diff against it is the external mode only.Jira: https://redpandadata.atlassian.net/browse/CON-589
Test evidence
End to end: a source container, the connector built from this branch, and a checker for loss, duplicates, per-key order and content.
f6aa669fe(an earlier commit)Integration tests at
f6aa669fe: pglogicalstream ITs pass on both heads; postgresql package ITs pass on #5000Updated 2026-11-05.