Debezium Embedded Storage And Snapshot Correctness Notes


Debezium is a CDC platform for turning database changes into ordered event streams. The review window covers 77 commits and 397 changed files, but the operator facing thread is narrower. Recent work in the Debezium repository reduces Kafka coupling in the embedded engine, changes how snapshot boundaries are queried, and makes several connector contracts more explicit.

The most direct fix changes schema.history.internal from a Kafka CLASS field to a STRING field. Before the configuration change, building the connector configuration could load the default Kafka schema history class immediately. An embedded deployment without the optional Kafka storage module could therefore fail with ConfigException before it had selected or used a history implementation.

The default class name remains in the configuration. What changes is when the classpath must satisfy it. That is a small type change with a useful operational result: an optional module no longer becomes mandatory while Debezium merely constructs its configuration definition. The added test reproduces an embedded classpath without the Kafka storage module.

This fix lands beside a larger storage separation. The frequently changed AsyncEmbeddedEngine source now uses Debezium owned offset reader, writer, store, and provider interfaces, with Kafka behavior isolated behind adapters. The KafkaFileOffsetProvider is one concrete part of that boundary. A later BOM update exposes the new modules through the Debezium BOM.

For standard embedded users, this is mostly internal refactoring. For anyone implementing a custom offset store, it is an API boundary worth checking before testing 3.7.0.Alpha1. The cleaner separation reduces Kafka Connect configuration leakage, but custom provider code may need to follow the Debezium SPI rather than Kafka worker types.

The snapshot work changes both query cost and correctness. The boundary calculation rewrite stops asking for boundaries at offsets that grow as i * chunkSize. Each query now carries the previous key as a lower bound and uses an offset of one chunk. That gives the database a key predicate and caps the requested offset at chunkSize.

No benchmark accompanies this series, so the change does not justify a throughput claim. The result depends on index coverage, key width, null distribution, and the database planner. The measurable structural change is narrower: later boundary queries no longer carry an ever growing absolute offset from the start of the table.

Composite and nullable keys make this harder than it sounds. AbstractChunkQueryBuilder builds ordered lower and upper predicates, including database specific null ordering. A correction to inclusive bounds replaced an extra equality branch with the correct final comparison. A separate fallback binding fix makes row value builders use the general parameter binder when a database or column layout cannot use row value syntax.

Resource ownership also moved to the caller. The statement cleanup change creates the prepared statement inside the caller’s resource scope before binding chunk parameters. If binding fails, the statement is now already covered by cleanup. This matters during repeated snapshot failures, where a small leak can become pool exhaustion.

Not every visible change alters runtime behavior. Some of the useful work documents or removes assumptions that operators could previously miss.

The Cassandra 3 cleanup removes its connector artifact from the BOM and from both snapshot and release plugin lists. It leaves Cassandra 4 and 5 entries in place. A build that still expects debezium-connector-cassandra-3 should treat that removal as a concrete migration signal, not routine documentation churn.

For CockroachDB, the binary mapping update clarifies that changefeed hexadecimal literals are decoded before binary.handling.mode determines the event representation. The documented choices are byte arrays, Base64, URL safe Base64, and hexadecimal, with bytes as the default. This is documentation of an existing contract, but it gives schema registry and sink owners a precise setting to verify.

Ingres receives a fuller incremental snapshot contract in the connector guide. The documentation addition covers SQL and Kafka signaling, additional conditions, stopping a snapshot, and custom snapshotters. The important constraint is blunt: schema changes are not supported while an Ingres incremental snapshot is running.

  • Test custom offset providers against the new Debezium storage interfaces and module layout before adopting the alpha build.

  • Exercise chunked snapshots with composite keys, nullable key columns, and interrupted queries. Watch query plans, open statements, duplicate records, and missing boundaries.

  • Remove Cassandra 3 connector coordinates from managed builds, and pin binary.handling.mode wherever downstream consumers depend on a specific CockroachDB binary representation.