Skip to content

cdc: migrate CDC inputs to canonical config field names (CON-493)#4566

Open
twmb wants to merge 7 commits into
mainfrom
cdc-config-naming
Open

cdc: migrate CDC inputs to canonical config field names (CON-493)#4566
twmb wants to merge 7 commits into
mainfrom
cdc-config-naming

Conversation

@twmb

@twmb twmb commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Migrates the CDC inputs to the canonical config field names defined in CONTRIBUTING.md §5.3.1, using the non-breaking pattern from §5.3.2 (precedent: postgres_cdc's snapshot_memory_safety_factor): add the canonical-named field, keep the old name accepted, mark the old one Deprecated(). Nothing is removed.

Mechanism

A shared helper (internal/cdcfield) resolves each renamed field: prefer the canonical name, fall back to the deprecated name, error if both are set to conflicting values, and apply the default in code. Both the canonical and deprecated fields are declared Optional() with no Default() — benthos hydrates declared defaults into the parsed config, so a defaulted field is otherwise indistinguishable (via Contains) from an explicitly-set one, which would defeat conflict detection.

Per-connector (canonical ← current)

  • postgres_cdc: snapshot_max_batch_sizesnapshot_batch_size. Native replication-slot checkpointing left as-is (permanent exemption).
  • aws_dynamodb_cdc: checkpoint_cachecheckpoint_table; max_parallel_snapshot_tablessnapshot_segments; snapshot_max_batch_sizesnapshot_batch_size. The snapshot_mode enum is left unchanged — §5.3.1 permits an enum where more than two snapshot modes genuinely exist, and dynamodb has three.
  • mongodb_cdc: max_parallel_snapshot_tablessnapshot_parallelism; plus a new canonical snapshot_max_batch_size that now drives the snapshot read batch size (previously implicitly tied to read_batch_size), defaulting to 1000 to preserve behavior.
  • salesforce_cdc: max_parallel_snapshot_tablesmax_parallel_snapshot_objects.
  • cockroachdb_changefeed: checkpoint_cachecursor_cache.

Conformance

The now-satisfied entries were removed from knownNonConformant in internal/plugins/cdctest. Legitimate waivers remain (dynamodb stream_snapshot uses the permitted snapshot_mode enum; postgres checkpoint_cache uses native slot checkpointing; cockroach/gcp_spanner/tigerbeetle untouched). go test -run '^TestCDCConformance$' ./internal/plugins/cdctest/ passes.

Each connector has a unit test asserting both the old and new field names parse and that conflicting values are rejected. task docs regenerated the affected component doc pages.

🤖 Generated with Claude Code

twmb and others added 7 commits June 25, 2026 12:35
The CDC Connector Standard (CONTRIBUTING.md §5.3) defines canonical config
field names. Several CDC inputs use legacy names. §5.3.2 prescribes a
non-breaking migration: add the canonical field, keep the old name accepted,
and mark the old one Deprecated().

Add a small shared helper so each connector can resolve a renamed field
consistently: prefer the canonical name, fall back to the deprecated name,
error when both are set to conflicting values. Both fields must be declared
Optional() (no Default()) because benthos hydrates declared defaults into the
parsed config, which would otherwise make Contains unable to tell an
explicitly-set field from a defaulted one.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Renames snapshot_batch_size to the canonical snapshot_max_batch_size
(CONTRIBUTING.md §5.3.1) using the non-breaking pattern from §5.3.2: the old
name is still accepted and now marked Deprecated(), the canonical name is
preferred, and setting both to conflicting values is rejected. Drops the
now-satisfied conformance waiver; the native replication-slot checkpoint
waiver remains.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Renames max_parallel_snapshot_objects to the canonical
max_parallel_snapshot_tables (CONTRIBUTING.md §5.3.1) via the non-breaking
pattern in §5.3.2: the old name is still accepted and now Deprecated(), the
canonical name is preferred, and conflicting values are rejected. Removes the
now-satisfied salesforce_cdc conformance waiver.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Renames cursor_cache to the canonical checkpoint_cache (CONTRIBUTING.md
§5.3.1) via the non-breaking pattern in §5.3.2: the old name is still
accepted and now Deprecated(), the canonical name is preferred, and
conflicting values are rejected. Drops the now-satisfied checkpoint_cache
conformance waiver; the remaining changefeed waivers stay.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…max_batch_size

Renames snapshot_parallelism to the canonical max_parallel_snapshot_tables
(CONTRIBUTING.md §5.3.1) via the non-breaking pattern in §5.3.2: the old name
is still accepted and now Deprecated(), the canonical name is preferred, and
conflicting values are rejected. Also adds the canonical snapshot_max_batch_size
field controlling the per-batch document count of snapshot reads (previously
implicitly tied to read_batch_size), defaulting to 1000 to preserve behavior.
Removes the now-satisfied mongodb_cdc conformance waiver.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ot_tables, snapshot_max_batch_size

Renames checkpoint_table, snapshot_segments, and snapshot_batch_size to the
canonical names from CONTRIBUTING.md §5.3.1 via the non-breaking pattern in
§5.3.2: the old names are still accepted and now Deprecated(), the canonical
names are preferred, and conflicting values are rejected. The snapshot_mode
enum is intentionally left unchanged (§5.3.1 permits an enum where more than
two snapshot modes exist; dynamodb has three), so the stream_snapshot waiver
remains. Drops the three now-satisfied conformance waivers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Output of `task docs` after migrating aws_dynamodb_cdc, cockroachdb_changefeed,
mongodb_cdc, postgres_cdc, and salesforce_cdc to the canonical CDC config field
names.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant