Commit bea91a2
authored
clickhouse: prevent replicated tables from starting in read-only mode. (#9183)
On start, ClickHouse compares the local state of each distributed table
to its distributed state. If it finds a discrepancy, it starts the table
in read-only mode. When this happens, oximeter can't write new records
to the relevant table(s). In the past, we've worked around this by
manually instructing ClickHouse using the `force_restore_data` sentinel
file, but this requires manual detection and intervention each time a
table starts up in read-only mode. This patch sets the
`replicated_max_ratio_of_wrong_parts` flag to 1.0 so that ClickHouse
always accepts local state, and never starts tables in read-only mode.
As described in ClickHouse/ClickHouse#66527,
this appears to be a bug, or at least an ergonomic flaw, in ClickHouse.
One replica of a table can routinely fall behind the others, e.g. due to
restart or network partition, and shouldn't require manual intervention
to start back up.
Part of #8595.
Note: I'm not sure now best to test this. It sounds like we have
reasonably high confidence that the fix will work, so we could just
merge and deploy to dogfood, and revert if necessary. Or is clickhouse
cluster running on another rack that we can test?1 parent 8d75b60 commit bea91a2
File tree
2 files changed
+10
-2
lines changed- clickhouse-admin/types
- src
- testutils
2 files changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | 204 | | |
| 205 | + | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
207 | 211 | | |
208 | 212 | | |
209 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | 107 | | |
| 108 | + | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| |||
0 commit comments