Skip to content

v0.3.3 CDC reliability validation

This milestone extends the existing Python acceptance utilities and source_e2e.py. It adds no providers, warehouse stateful modes, migrations or production deployment changes. Results are scoped to actual executed assertions; historical v0.3.2/source-extension reports are not current evidence.

Reproduce

Build the existing pinned runtime images, then execute the owned fixture runner:

docker build -f infrastructure/docker/api.Dockerfile -t cluecdc-reliability-api:local .
docker build -f infrastructure/docker/connect.Dockerfile -t cluecdc-reliability-connect:local .
docker build -f infrastructure/docker/minio-test.Dockerfile -t cluecdc-reliability-minio:local .
python scripts/cdc_reliability.py --execute --chaos --extra-sources
python scripts/cdc_reliability.py --execute --pairs postgresql:POSTGRESQL --snapshot-interruption --source-history-expiration

The default command without --execute generates a NOT RUN matrix and starts no services. Select pairs with --pairs postgresql:CLICKHOUSE,mysql:CLICKHOUSE. Use --pairs none --extra-sources for the optional-source suite alone. Each run copies the existing Compose fixture configuration into an independently named project, uses available loopback ports that remain stable across restarts, and checks both project and run-ownership labels before stopping any container. It never reads the local .env; public example fixture settings are isolated from an existing deployment. Host images are operator-selectable and immutable image IDs plus Connect plugin versions are recorded in the evidence.

Artifacts default to a unique run directory under artifacts/cdc-reliability/; --output PATH selects an explicit directory. Outputs include summary, compatibility, correctness, recovery, checkpoint and regression JSON, plus sanitized failure diagnostics. A nonzero exit means a failed assertion or unavailable infrastructure; missing cloud resources do not fail an unrelated local run. Every scenario has bounded operations. Shutdown runs in finally, without deleting durable volumes. --retain-fixtures explicitly keeps containers for debugging; the generated Compose file lives in the OS temporary directory under the reported project name. Stop retained services with docker compose -p PROJECT -f COMPOSE_FILE down. Do not add shared volumes or external networks to these fixtures.

Assertions and semantics

The PostgreSQL/MySQL runner signs in, creates source/destination connections, tests connectivity/readiness, discovers the table, previews and deploys capture and delivery, and exercises pause/resume/restart and audit through existing APIs. It compares deterministic composite keys, a non-PK unique column, Vietnamese text, decimal(30,9), nulls, booleans, dates, timestamps, binary and large text. The non-PK unique column is fixture data, not live verification of selecting a non-PK Effective Row Key. Existing effective-key regression tests remain required.

Snapshot success requires snapshot events plus persisted source offsets that have left snapshot-in-progress. RUNNING alone does not satisfy the check. INSERT/UPDATE/DELETE are checked in Kafka and at the destination. Current-state delivery checks deletion and bounded final equality; append-only delivery checks immutable history, never claims a materialized delete. Warehouse history compares topic/partition/offset, key, operation, source and before/after JSON to real Kafka events. Tombstones are inspected in Kafka; warehouse transforms may omit them.

Ordered fixture replay republishes the original wire envelopes to this run's owned topic, preserving per-partition ordering and assigning new Kafka offsets. It does not reset Connect or consumer offsets. JDBC final state must remain equal; history retains deliberate logical repeats and reports coordinate duplicates separately. Arbitrary out-of-order replay is not certified. Restart success alone is not replay proof. No path gains an exactly-once claim.

MariaDB and MongoDB reuse the existing real adapter/config-builder/Connect runner. MariaDB also checks PostgreSQL stateful CRUD; both check MinIO raw events, including MongoDB BSON/patch preservation. Their full API/browser orchestration journeys remain unverified. Their source outages explicitly use existing task restart and are reported as operator-assisted recovery. SQL Server uses the real API connection/readiness/preview/deployment/lifecycle path and Linux runtime driver; its two final short outages recovered without a test-issued restart.

For browser coverage, first build the existing root Dockerfile as cluecdc-reliability-web:local, install the existing web/Playwright dependencies, then pass --browser. This reuses the existing demos and all 33 browser tests, with real session authentication. --sources mariadb mongodb narrows the optional-source suite without changing capability guards.

Optional real cloud execution

No cloud dataset, bucket, Redshift cluster, Azure pool, storage account or Oracle database is provisioned. Missing infrastructure is NOT RUN — Real cloud infrastructure unavailable. Use dedicated pre-existing resources and a private JSON file containing authorize_test_writes: true plus provider entries:

{
  "authorize_test_writes": true,
  "BIGQUERY": {"config": {}, "credentials": {}},
  "REDSHIFT": {"config": {}, "credentials": {}},
  "AZURE_SYNAPSE": {"config": {}, "credentials": {}}
}

Populate each entry using the existing connection API schema and the destination guides. Include only configured providers. Use dedicated datasets/schemas and staging prefixes with least-privilege credentials, not shared production targets. The normal API validates TLS and supported modes. Query verification uses the existing authenticated SDK connection helpers inside the fixture API image; credentials travel on stdin and are redacted from artifacts. SQL identifiers are validated by connection/mapping APIs. Test tables are unique; staging prefixes are suffixed by the run ID. Shared cloud infrastructure is never stopped.

python scripts/cdc_reliability.py --execute --cloud-config /private/cloud.json --pairs postgresql:BIGQUERY,mysql:BIGQUERY
python scripts/cdc_reliability.py --execute --cloud-config /private/cloud.json --pairs postgresql:REDSHIFT,mysql:REDSHIFT
python scripts/cdc_reliability.py --execute --cloud-config /private/cloud.json --pairs postgresql:AZURE_SYNAPSE,mysql:AZURE_SYNAPSE

Dedicated cloud datasets/schemas must already exist. Test tables, marker tables and staged objects are retained for evidence; the operator applies the dedicated test retention policy. Cloud execution may incur charges and requires the explicit configuration flag. Service-principal/password credentials must be reachable from the test containers; host managed identity is not forwarded.

CI tiers

Existing fast API/web/security/deployment gates remain intact. The separate cdc-reliability.yml runs local services weekly or by dispatch, with optional disposable outages and additional sources. Cloud execution is dispatch-only, requires CDC_RELIABILITY_CLOUD_CONFIG, and reports missing configuration as unexecuted. It never turns a skipped cloud test into a pass. Reports and failure logs upload on both success and failure. Existing source CDC and browser gates remain in place.

Current execution results

Executed on 2026-11-02 against base commit f904ac3ffc70aec50355f4e0d079b50f31a4d8c6 plus the working implementation. Final reporting checks were repeated on 2026-11-03. The initial baseline is recorded separately in the baseline audit.

Gate Executed result Evidence
Full API regression, including formerly optional worker lease/migration cases on owned PostgreSQL 581 passed, zero failed/skipped; one pre-existing empty-regex pytest warning artifacts/final-api-with-postgres.log, artifacts/cdc-reliability/regression-api-postgres.xml
Frontend unit regression 93 passed, 23 files artifacts/final-web.log
Existing Playwright operator/security suites against fresh UI and session auth 33 passed artifacts/cdc-reliability-browser-session/playwright.json
Final local CDC evidence Ten source/destination pairs passed within the matrix's stated scopes artifacts/cdc-reliability/compatibility-matrix.json
Interrupted PostgreSQL snapshot with concurrent INSERT/UPDATE 50,001 rows verified by key/value digest, then streaming marker verified artifacts/cdc-reliability-snapshot-final/summary.json
Expired PostgreSQL WAL Actionable nonretryable recovery-required state; offsets/configuration unchanged artifacts/cdc-reliability-history-final/summary.json
Python lint/format and mypy Passed; 104 application source files type checked Final local commands below
Web lint/type/format and fresh Docker build Passed artifacts/final-web-lint.log, artifacts/final-web-typecheck.log, artifacts/final-format.log, artifacts/reliability-web-build.log
Compose render, Kubernetes/deployment checks, repository safety, workflow actionlint, strict MkDocs build Passed Final local checks; artifacts/final-docs.log

The selected machine report contains 684 records: 677 PASS, seven NOT RUN, zero FAIL. Of these, 581 are API regression assertions and 96 are passing scenario records; a scenario may contain many assertions or an entire browser suite. These counts are not 677 independent live CDC tests. The seven NOT RUN records are the six PostgreSQL/MySQL cloud pairs and Oracle. Unit/local-metadata checkpoint tests are explicitly tagged regression, never cloud E2E.

Final primary reconciliation found ten equal current-state rows for each JDBC pair; MinIO contained all 20 PostgreSQL and 21 MySQL event values with no additional delivery occurrences. Each ClickHouse pair contained 20 rows with 20 distinct Kafka coordinates and zero observed coordinate duplicates. Deliberately replayed logical changes are included; zero observed duplicates does not establish exactly-once behavior. No silent data loss was observed in passing scenarios.

The six primary pairs completed in artifacts/cdc-reliability-release-validation/summary.json. Final post-fault reconciliation is in artifacts/cdc-reliability-final-correctness/summary.json. Final additional sources are recorded in artifacts/cdc-reliability-maria-mongo-final/summary.json and artifacts/cdc-reliability-sqlserver-final/summary.json.

The report merger selects the last supplied result for each source/destination/ mode/scenario scope; an unexecuted result cannot replace an executed result. Earlier attempts remain in superseded-results.json, including five failed records. They exposed fixture sequencing/readiness issues and the native SQL driver defect; the corresponding final reruns passed. inputs.json records SHA-256 provenance for every input. Development failures are not relabeled as passes, and unrelated old artifacts are not counted in the final selection.

Commands and implementation map

The real-service commands use the builds shown above. During this execution, existing Connect/MinIO images were selected explicitly with --connect-image cluecdc-kafka-connect:latest --minio-image cluecdc-minio:latest; their immutable image IDs and plugin versions are recorded per result. The final additional-source rerun used --pairs none --extra-sources --sources mariadb mongodb. SQL Server, snapshot, WAL expiration and final reconciliation were also invoked through the same reusable Python helpers in separately owned projects. Per-run environment IDs identify these executions; this is combined evidence, not a claim that every scenario ran in one uninterrupted invocation.

python -m pytest apps/api/tests -q --junitxml=artifacts/cdc-reliability/regression-api-postgres.xml
python -m pytest apps/api/tests/test_reliability_harness.py -q
python -m ruff check apps/api scripts
python -m ruff format --check apps/api scripts
python -m mypy --config-file apps/api/pyproject.toml apps/api/app
npm.cmd run test:web
npm.cmd run format:check
npm.cmd run lint
npm.cmd run typecheck
python -m mkdocs build --strict

The full API run supplied WORKER_TEST_DATABASE_URL pointing to a newly created, ownership-labeled PostgreSQL fixture. It was removed in finally; no existing database was used. The focused reporting regression rerun passed all seven cases. The final Connect/warehouse/source-position/harness regression rerun passed 62 cases (artifacts/cdc-reliability/final-focused-regression.xml); these are subsets of the full suite and are not added again to the merged counts. The full API evidence above predates only the final matrix presentation change, which is covered by that rerun. npm.cmd is the Windows launcher; CI uses npm. artifacts/cdc-reliability/implementation-sha256.json identifies the final changed source files separately from the immutable per-run input hashes.

Files Purpose
scripts/cdc_reliability.py, cdc_reliability_support.py, cdc_reliability_images.json Existing-harness extension, isolated fixtures, deterministic data, API orchestration, comparison, faults, pinned images and sanitized evidence
scripts/cdc_reliability_sqlserver.py, cdc_reliability_browser.py, cdc_reliability_report.py Native/API SQL Server path, existing operator UI suites and evidence merging
scripts/cdc_acceptance_support.py, scripts/source_e2e.py Reused helpers, isolated port/project overrides and strengthened existing source assertions
apps/api/app/services/warehouses/staged.py, azure_synapse/runtime.py Recover oldest durable batch before new polling; preserve original bounds, manifests, consumer groups and checkpoint authority
apps/api/app/adapters/connect.py, postgres.py, services/pipeline.py Source-history diagnostics and read-only exact-slot PostgreSQL health observation
infrastructure/docker/api.Dockerfile Install and eagerly validate the native SQL driver's runtime libraries
API tests for Connect, warehouse runtime, source position and reliability harness Regression protection for the discovered defects and fixture safety
.github/workflows/cdc-reliability.yml Separate scheduled/dispatch local E2E and explicit cloud tier
Capability description, warehouse/source reports, four development reports, mkdocs.yml, CHANGELOG.md Accurate current verification boundaries and reproducible evidence

No release was merged, tagged, pushed, published or deployed. No providers, stateful warehouse modes, API contract or product UI changes were introduced. Task-owned service containers were removed after execution; test volumes were retained for inspection. The nine pre-existing services were healthy and untouched at execution cleanup. On the final reporting day Docker was unavailable, so no new live-service rerun or fresh container-state assertion was made.

Remaining work

Real BigQuery, Redshift and Synapse verification requires dedicated configured resources and least-privilege credentials; Oracle requires approved database and logging infrastructure. The optional runners do not provision billable resources. Remaining local qualification includes MariaDB/MongoDB API/browser orchestration, additional-source replay and interrupted snapshots, non-PostgreSQL history expiration, independent JDBC destination-only outages, HA/multi-broker failures, arbitrary out-of-order replay, schema-change faults and long-duration operation. Unsupported combinations remain blocked rather than being enabled for testing. See the per-provider production assessment and recovery limits; this scope is not blanket production certification.