Repository navigation
Conversation
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-1:20260702-084400 |
|
cc @alexey-milovidov — this is the separate fix for the |
… tests The stress runner enables use_query_cache=1 as a global per-runner client option (ci/jobs/scripts/stress/stress.py, probability 1/3). This is mutually exclusive with a non-throw *_overflow_mode: the server refuses the combination with QUERY_CACHE_USED_WITH_NON_THROW_OVERFLOW_MODE (a non-throw mode can truncate the result, which must never be cached). Stateless tests that set such a mode (e.g. group_by_overflow_mode='any' in 00107_totals_after_having) then fail deterministically, and three consecutive failures trip --max-failures-chain and abort the stress runner. Detect tests that set a non-throw overflow mode and turn the forced query cache back off for exactly those tests, in both the .sql and .sh execution paths. --allow_repeated_settings makes the trailing use_query_cache=0 win; query-level SETTINGS in tests still override it, so intentional coverage such as 02494_query_cache_bugs is preserved, and query-cache stress coverage for all other tests is unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
48ae4a3 to
74de0be
Compare
Master's add_effective_settings gained a feature_tag_overrides() block that returns early, at the same site as the forced-query-cache override. The override is ordered before it: 3 stateless tests set a non-throw overflow mode and also carry a feature tag (03711_top_k_by_skip_index, 03928_sharded_aggregation_negative_explain, 04201_inverse_dictionary_lookup_edge_cases), so the reverse order would skip the fix for exactly those tests. Verified by exercising add_effective_settings directly with an injected use_query_cache=1 across three arms. Effective use_query_cache, for a test with both an overflow mode and a feature tag / overflow only / neither: pristine master 1,1,1; this merge 0,0,1; an order-swapped mutant 1,0,1. The mutant reddens only on the first case, so the ordering is load-bearing, and the third case shows query-cache coverage is retained where it is valid. Also trimmed the two comment blocks to the local invariant.
The previous matcher required the value to follow `_overflow_mode` directly, so it missed `read_overflow_mode_leaf`, which the server guards as well: 04210_skip_index_on_data_read_leaf_limit sets it to 'break' and still failed with QUERY_CACHE_USED_WITH_NON_THROW_OVERFLOW_MODE. It also matched raw text, so 04214_trivial_group_by_limit_threads lost query-cache coverage on the strength of a mention in its header comment alone. Name the ten settings from the guard in executeQuery.cpp, accept the command line spelling (which may separate the value with a space, as in `--timeout_overflow_mode break`), and ignore comments. `--` is only treated as a comment when it does not begin a flag, otherwise `--result_overflow_mode=break` in a .sh test reads as a comment and the test starts failing again. Effective use_query_cache under an injected use_query_cache=1, over: an overflow-mode test with a feature tag, overflow-mode only, no overflow mode, read_overflow_mode_leaf='break', a comment-only mention, and three .sh tests passing the mode as a flag. Master 1,1,1,1,1,1,1,1; this commit 0,0,1,0,1,0,0,0. Across the 13740-file corpus the detector set moves by exactly these two tests.
In cloud mode --client-option values are also appended to CLICKHOUSE_URL_PARAMS, so a .sh test issuing its query over HTTP kept use_query_cache=1 and still hit QUERY_CACHE_USED_WITH_NON_THROW_OVERFLOW_MODE. Measured against a local server: a query with group_by_overflow_mode=any and use_query_cache=1 in the URL returns error 731, and appending &use_query_cache=0 makes it succeed, so a repeated parameter takes its last value like the command line does.
|
Workflow [PR], commit [29440ad] Summary: ✅ AI ReviewSummaryThis PR disables stress-forced query caching for tests that assign non-throw overflow modes, applying the override to SQL clients, shell clients, and HTTP parameters. Reviewed PR head Final Verdict✅ Approve. Focused harness checks passed for detection, override precedence, feature tags, and environment cleanup. Live server tests were not rerun locally. |
The detector only recognised the literal spellings `any` and `break`, so a
value held in a shell variable slipped through: `05141_hypothetical_projection_verdict_rules.sh`
runs `read_overflow_mode = '${mode}'` for `mode in throw break`, and under the
stress runner's forced `use_query_cache=1` its `break` iteration fails with
QUERY_CACHE_USED_WITH_NON_THROW_OVERFLOW_MODE.
Now every value except a literal `throw` or `DEFAULT` counts. The bare
space-separated form is only accepted after `--`, i.e. as a command line flag,
so prose such as `echo "timeout_overflow_mode throw OK"` is not matched.
Over the 15902 case files the detected set grows by exactly 05141 and loses
nothing. With the forced query cache, 05141 fails 3/3 with error 731 on the
previous detector and passes 3/3 with this one.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #107907
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
The stress runner enables
use_query_cache=1as a global per-runner client option (ci/jobs/scripts/stress/stress.py, probability1/15). The server refuses that together with a non-throw*_overflow_modeand raisesQUERY_CACHE_USED_WITH_NON_THROW_OVERFLOW_MODE(error 731), because such a mode can truncate the result, which must never be cached (Bug 67476, guarded inexecuteQuery.cpp).Tests that set such a mode then fail.
00107_totals_after_havingsetsgroup_by_overflow_mode = 'any', and three consecutive failures trip--max-failures-chain, aborting the runner. 90 stateless tests set a non-throw overflow mode. Reported by @ alexey-milovidov while triaging aStress test (amd_msan)failure on #107907 (report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=107907&sha=f7e21726f54a9&name_0=PR).That block now also pins the overflow modes to
'throw', but only as a client option, so it does not cover this: a test's ownSEToverrides a client option. Verified against a local server: withuse_query_cache=1and every mode pinned to'throw'on the command line, a query afterSET group_by_overflow_mode = 'any'still returns 731.Fix: detect tests that set a non-throw overflow mode and turn the forced query cache back off for exactly those, on the command line and on the HTTP carrier used in cloud mode. The trailing value wins in both. The detected settings are the ten the server guards, so
read_overflow_mode_leafis covered; any value other than a literal'throw'orDEFAULTcounts, so a mode held in a shell variable is caught; comment-only mentions are ignored. Query-levelSETTINGSstill override the override, so the intentional 731 coverage in02494_query_cache_bugsis preserved, and the query-cache coverage of every other test is unchanged.Treating 731 as benign in the runner was rejected: it would let a test's queries silently abort and could mask real 731 regressions.
Workflow [PR]
Sync PR [sync-upstream/pr/109130]