Commit db0acab
committed
fix(webapp,clickhouse): stop one un-ingestable JSON row dropping its whole ClickHouse batch
When a single run output, trace span, or payload contained JSON ClickHouse
could not ingest (for example nesting past its depth limit), the whole insert
batch was rejected and those runs and spans silently vanished from the runs
list, traces, and logs.
Recovery is now per-table:
- Runs: follow ClickHouse's failing-row hint to strip just the un-ingestable
JSON column(s) so the run still lands with its status, up to a configurable
limit (RUN_REPLICATION_MAX_POISON_STRIPS_PER_BATCH, default 1). Past the
limit, land the rest with allow_errors and skip the remainder, so recovery
cost stays flat on large flushes instead of re-sending the batch per row.
- Trace events and payloads: land the batch with allow_errors so the good rows
land in one pass and only the un-ingestable rows are skipped.
Reading the failing-row hint needs a patch to @clickhouse/client-common, whose
error parser otherwise discards the row number from the server response.1 parent c5f1734 commit db0acab
15 files changed
Lines changed: 730 additions & 273 deletions
File tree
- .server-changes
- apps/webapp
- app
- services
- v3/eventRepository
- test
- internal-packages/clickhouse/src/client
- patches
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1672 | 1672 | | |
1673 | 1673 | | |
1674 | 1674 | | |
| 1675 | + | |
1675 | 1676 | | |
1676 | 1677 | | |
1677 | 1678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
Lines changed: 24 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
1133 | 1134 | | |
1134 | 1135 | | |
1135 | 1136 | | |
1136 | | - | |
| 1137 | + | |
1137 | 1138 | | |
1138 | 1139 | | |
1139 | 1140 | | |
1140 | 1141 | | |
1141 | 1142 | | |
1142 | | - | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1143 | 1152 | | |
| 1153 | + | |
| 1154 | + | |
1144 | 1155 | | |
1145 | 1156 | | |
1146 | 1157 | | |
| |||
1176 | 1187 | | |
1177 | 1188 | | |
1178 | 1189 | | |
1179 | | - | |
| 1190 | + | |
1180 | 1191 | | |
1181 | 1192 | | |
1182 | 1193 | | |
1183 | 1194 | | |
1184 | 1195 | | |
1185 | | - | |
1186 | | - | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1187 | 1204 | | |
1188 | 1205 | | |
1189 | 1206 | | |
| |||
1587 | 1604 | | |
1588 | 1605 | | |
1589 | 1606 | | |
1590 | | - | |
1591 | | - | |
1592 | | - | |
1593 | | - | |
1594 | | - | |
1595 | | - | |
| |||
Lines changed: 17 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
| 348 | + | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
356 | 361 | | |
357 | 362 | | |
358 | 363 | | |
| |||
377 | 382 | | |
378 | 383 | | |
379 | 384 | | |
380 | | - | |
| 385 | + | |
381 | 386 | | |
382 | 387 | | |
383 | 388 | | |
384 | 389 | | |
385 | 390 | | |
386 | | - | |
387 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
388 | 398 | | |
389 | 399 | | |
390 | 400 | | |
| |||
2945 | 2955 | | |
2946 | 2956 | | |
2947 | 2957 | | |
2948 | | - | |
2949 | | - | |
2950 | | - | |
2951 | | - | |
| |||
0 commit comments