CDC apply certification¶
dpone ops cdc-apply-certification generates deterministic CDC apply evidence
from a credential-free fixture. It is the recommended producer for
cdc_apply_correctness, delete_semantics, and typed_cdc_hash artifacts
before running dpone ops cdc-handoff.
The command does not open live database connections. It applies a bounded event window in memory, compares the final rows with the expected sink state, writes handoff-compatible evidence files, and embeds a CDC handoff report.
User workflow¶
Use this command when promoting a route from fast snapshot load to replication-grade CDC apply:
- Export or generate a bounded CDC window fixture.
- Include the snapshot boundary, CDC window, retention boundary, initial rows, CDC events, expected final rows, and unique key.
- Run
dpone ops cdc-apply-certification. - Review
cdc_apply_certification.json. - Review the embedded
handoff/cdc_handoff.json. - Use the generated evidence artifacts in release review.
The first profiled route is mssql -> clickhouse.
Fixture contract¶
The fixture is a JSON object:
{
"unique_key": ["order_id"],
"snapshot_boundary": "0x00000010",
"window_start": "0x00000011",
"window_end": "0x00000014",
"retention_min": "0x00000001",
"initial_rows": [
{"order_id": 1, "status": "new", "amount": "10.00"},
{"order_id": 2, "status": "new", "amount": "20.00"}
],
"events": [
{
"operation": "insert",
"position": "0x00000011",
"sequence": 1,
"key": {"order_id": 3},
"after": {"order_id": 3, "status": "new", "amount": "30.00"}
},
{
"operation": "update",
"position": "0x00000012",
"sequence": 2,
"key": {"order_id": 1},
"after": {"order_id": 1, "status": "paid", "amount": "11.00"}
},
{
"operation": "delete",
"position": "0x00000013",
"sequence": 3,
"key": {"order_id": 2},
"before": {"order_id": 2, "status": "new", "amount": "20.00"}
}
],
"expected_rows": [
{"order_id": 1, "status": "paid", "amount": "11.00"},
{"order_id": 3, "status": "new", "amount": "30.00"}
]
}
operation supports insert, update, and delete. Replayed duplicate events
with the same deterministic event id are counted as duplicates and skipped by
the idempotent apply strategy.
CLI examples¶
Generate certification and embedded handoff evidence for mssql -> clickhouse:
dpone ops cdc-apply-certification \
--source mssql \
--sink clickhouse \
--strategy cdc \
--source-dataset dbo.orders \
--target-dataset analytics.orders \
--fixture-json test_artifacts/cdc/orders/fixture.json \
--output-dir test_artifacts/cdc_apply/mssql_to_clickhouse/orders \
--format json
Then inspect the embedded handoff report:
dpone ops cdc-handoff \
--source mssql \
--sink clickhouse \
--strategy cdc \
--source-dataset dbo.orders \
--target-dataset analytics.orders \
--artifact cdc_snapshot_boundary=test_artifacts/cdc_apply/mssql_to_clickhouse/orders/evidence/cdc_snapshot_boundary.json \
--artifact cdc_window=test_artifacts/cdc_apply/mssql_to_clickhouse/orders/evidence/cdc_window.json \
--artifact retention_preflight=test_artifacts/cdc_apply/mssql_to_clickhouse/orders/evidence/retention_preflight.json \
--artifact cdc_apply_correctness=test_artifacts/cdc_apply/mssql_to_clickhouse/orders/evidence/cdc_apply_correctness.json \
--artifact delete_semantics=test_artifacts/cdc_apply/mssql_to_clickhouse/orders/evidence/delete_semantics.json \
--artifact typed_cdc_hash=test_artifacts/cdc_apply/mssql_to_clickhouse/orders/evidence/typed_cdc_hash.json \
--artifact schema_drift_governance=test_artifacts/cdc_apply/mssql_to_clickhouse/orders/evidence/schema_drift_governance.json \
--format md
Generated artifacts¶
The command writes:
| Artifact | Purpose |
|---|---|
cdc_apply_certification.json |
Stable schema dpone.cdc_apply_certification.v1, metrics, blockers, generated evidence paths, and embedded handoff paths. |
cdc_apply_certification.md |
Human-readable certification summary. |
evidence/cdc_apply_correctness.json |
Final-row correctness evidence. |
evidence/delete_semantics.json |
Delete handling evidence. |
evidence/typed_cdc_hash.json |
Typed source/sink hash evidence. |
evidence/cdc_snapshot_boundary.json |
Snapshot boundary evidence derived from the fixture. |
evidence/cdc_window.json |
Window boundary evidence derived from the fixture. |
evidence/retention_preflight.json |
Retention coverage evidence derived from the fixture. |
evidence/schema_drift_governance.json |
Schema drift governance evidence. |
handoff/cdc_handoff.json |
Embedded CDC handoff go/no-go report. |
Runbook¶
If certification fails:
- Open
cdc_apply_certification.json. - Fix
cdc_apply_correctness.mismatchby checking event order, unique keys, expected rows, and duplicate replay behavior. - Fix
typed_cdc_hash.mismatchby checking type normalization and expected final rows. - Fix
delete_semantics.mismatchby checking delete events and target tombstone or physical-delete policy. - Fix
retention_preflight.window_not_availablebefore retrying the window. - Re-run
dpone ops cdc-apply-certification. - Promote the durable CDC offset only after the embedded
dpone ops cdc-handoffreport is green.