You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add per-table write divergence detection to health check script
Compare origin vs target successful write counts per keyspace.table
using the new zdm_proxy_write_success_total metric. Alerts when:
- Target has zero writes for a table that origin is writing to (critical)
- Origin and target counts differ by more than the threshold (warning)
During normal dual-write operation, counts should be identical. Any
divergence indicates the target is missing writes and will need repair.
New config: --write-divergence-threshold / ZDM_WRITE_DIVERGENCE_THRESHOLD
(default: 0, meaning any divergence triggers an alert).
This counter tracks successful writes per cluster, keyspace, and table with labels `{cluster="origin|target", keyspace="...", table="..."}`. The script compares origin and target counts for each table.
53
+
54
+
- If origin has writes but target has zero for a table, the target may be completely down for that table — this is **critical**.
55
+
- If origin and target counts differ by more than the threshold, writes are succeeding on origin but failing on target for that table — data is diverging and will need repair after migration.
56
+
57
+
During normal dual-write operation, origin and target counts should be identical. Any divergence means the target is missing writes.
58
+
59
+
*Alert triggers when:* origin and target counts differ by more than `--write-divergence-threshold` (default: 0).
60
+
50
61
### Alert severity levels
51
62
52
63
| Severity | When | What it means |
53
64
|----------|------|---------------|
54
-
|**critical**| Origin failures, metrics endpoint unreachable | Production is impacted right now |
55
-
|**warning**| Target failures, connection problems | Migration data flow is degraded but origin (source of truth) is fine |
65
+
|**critical**| Origin failures, metrics endpoint unreachable, target has zero writes for a table that origin is writing to| Production is impacted right now |
66
+
|**warning**| Target failures, connection problems, origin/target write count divergence| Migration data flow is degraded but origin (source of truth) is fine |
56
67
57
68
### Why target failures matter even though origin is fine
58
69
@@ -96,6 +107,7 @@ Everything can be set via CLI flags or environment variables. CLI flags take pre
96
107
|`--interval`|`ZDM_CHECK_INTERVAL`|`0` (one-shot) | Seconds between checks |
97
108
|`--failed-writes-threshold`|`ZDM_FAILED_WRITES_THRESHOLD`|`5`| Alert if failed writes increase by more than this per interval |
98
109
|`--write-timeout-threshold`|`ZDM_WRITE_TIMEOUT_THRESHOLD`|`5`| Alert if target timeouts increase by more than this per interval |
110
+
|`--write-divergence-threshold`|`ZDM_WRITE_DIVERGENCE_THRESHOLD`|`0`| Alert if origin/target per-table write counts differ by more than this |
0 commit comments