Repository navigation
Commit 82ff679
[fix](test)(file-cache) sum file_cache_statistics metrics across cache paths to deflake hit/read count checks
information_schema.file_cache_statistics reports one row per (cache_path,
metric_name): the BE iterates every cache instance and a given data file is
routed to exactly ONE instance via hash(filename) % num_paths. The tests read
each metric with a bare `... limit 1`, so they inspect a single arbitrary path's
counter, which need not be the path the query's data file routed to. With >1
file_cache_path this made total_hit_counts/total_read_counts assertions flaky
(the inspected path never moved while the routed path did), e.g.
test_file_cache_statistics failing with "total_hit_counts did not increase"
(4499 -> 4499) on a 2-path backend.
- test_file_cache_statistics: read every metric via
SUM(CAST(METRIC_VALUE AS DOUBLE)) across all paths instead of `limit 1`, and
replace the fixed Thread.sleep loops with Awaitility polling (total_*_counts
are live bvar reads needing no wait; hits_ratio*/queue-curr are republished by
the background monitor and are polled up to a couple of intervals). The
counter-increase check re-runs the just-cached query inside the poll so a
transient miss/eviction self-heals.
- test_file_cache_query_limit: sum total_hit_counts/total_read_counts across
paths via a cacheMetricSum helper. Its normal_queue/queryCacheCapacity logic
is intentionally left per-instance, as file_cache_query_limit_percent is
derived from a single path's brpc file_cache_capacity.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>1 parent 0675e24 commit 82ff679
2 files changed
Lines changed: 152 additions & 122 deletions
File tree
- regression-test/suites/external_table_p0/cache
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
94 | 105 | | |
95 | 106 | | |
96 | 107 | | |
| |||
306 | 317 | | |
307 | 318 | | |
308 | 319 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
321 | 328 | | |
322 | 329 | | |
323 | 330 | | |
| |||
376 | 383 | | |
377 | 384 | | |
378 | 385 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
391 | 389 | | |
392 | 390 | | |
393 | 391 | | |
| |||
0 commit comments