Repository navigation
Commit 4b2feaf
[fix](test) make test_temp_table replica detection robust (build #198126)
test_temp_table asserted `3 * replicaNum == show_tablets_result.size()`,
deriving replicaNum by regex-parsing force_olap_table_replication_allocation
with `/:(\d+)/`. That detection is wrong on clusters that force replication=3:
the canonical allocation string `tag.location.default: 3` has a space after
the colon so the regex never matches (replicaNum stuck at 1), and the separate
force_olap_table_replication_num config is never consulted. On the 3-replica
TeamCity cluster SHOW TABLETS returned 9 rows (3 tablets x 3 replicas) while
the test expected 3.
Keep verifying the real replica count (so a wrong/missing replica is still
caught) but fix the detection:
- assert there are exactly 3 distinct tablets (3 partitions x 1 bucket), and
- assert total rows == 3 * replicaNum, where replicaNum is derived robustly and
mirrors FE precedence (PropertyAnalyzer.analyzeReplicaAllocation): the
force_olap_table_replication_allocation per-tag counts are summed first with a
whitespace-tolerant regex `/:\s*(\d+)/`, falling back to
force_olap_table_replication_num.
Same defect exists on apache/master; forward-port there too.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>1 parent 45fb438 commit 4b2feaf
1 file changed
Lines changed: 23 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
278 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
279 | 287 | | |
| 288 | + | |
280 | 289 | | |
281 | | - | |
282 | | - | |
283 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
284 | 302 | | |
285 | 303 | | |
286 | 304 | | |
| |||
0 commit comments