Repository navigation
Backport #110710 to 26.3: Fix text-index direct-read double-registration over Merge/Distributed - #111094
Conversation
…ion over Merge/Distributed
|
Workflow [BackportPR], commit [90b50c9] Summary: ✅ |
… for 26.3 The backported optimization in `optimizeDirectReadFromTextIndex.cpp` uses `ReadFromMergeTree::getIndexReadTasks`, which exists on master but not on the 26.3 branch, so all builds failed: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111094&sha=f2e8343e5602f40c6465fd466eea1a33b61a0c6e&name_0=BackportPR PR: #111094 Add the same read-only accessor to 26.3. Co-Authored-By: Claude Fable 5 <[email protected]>
26.3 does not have #109188, which makes `StorageMerge` and `StorageDistributed` opt out of the `optimize_functions_to_subcolumns` rewrite. When the test runner randomizes that setting to 1, `mapValues(attributes)` in PREWHERE is rewritten to the subcolumn `attributes.values`, which `Merge` rejects with `ILLEGAL_PREWHERE`. Pin the setting to 0 so the predicate keeps the function form that matches the text-index expression, as in the original repro. Same fix as on backport/26.4/110710 (PR #111095), where it was verified against the PR's arm_release binary: the unpinned test fails with `ILLEGAL_PREWHERE` under `optimize_functions_to_subcolumns = 1`, the pinned test matches the reference. Co-Authored-By: Claude Fable 5 <[email protected]>
On 26.3 (unlike master and 26.4+) the direct-read-from-text-index optimization is additionally gated on `use_skip_indexes_on_data_read` (see `QueryPlanOptimizationSettings`). The test runner randomizes that setting, and with 0 the optimization is disabled, so the EXPLAIN visibility check returned 0 instead of 1: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111094&sha=c0d34f6c3f0541798b82274dadacf4d815a466bd&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan%2C%20distributed%20plan%2C%20parallel%2C%201%2F2%29 A session-level SET is not enough on 26.3: it does not reach the plan optimization of a query explained via SELECT ... FROM (EXPLAIN ...), so the setting is also pinned in the SETTINGS clause of every query that needs direct read engaged (the trigger query, both EXPLAIN checks, and the direct-read-on comparison query). Verified against the CI-built arm_release 26.3 binary: the unpinned test reproduces the CI diff under use_skip_indexes_on_data_read=0, the pinned test matches the reference under all adverse setting combinations. Co-Authored-By: Claude Fable 5 <[email protected]>
|
The remaining CI red on commit c0d34f6 is addressed in 90b50c9: on 26.3 (unlike master and 26.4+) the direct-read-from-text-index optimization is additionally gated on The other two failures in that run are unrelated to this backport:
|
CTE/AN/QP: same text-index predicate in PREWHERE and WHERE, Merge over Distributed -> exc LOGICAL_ERROR. Effect in the production build a394e92: its upstream test(s) 04549_text_index_prewhere_where_dup_over_merge_distributed fail on it and pass on official 26.8.8.8, run on isolated servers (evidence/fix_ci_20260925/upstream_repro/server_triage_PROD263_vs_UP2688.tsv). Upstream patch unchanged, with its test(s): 04549_text_index_prewhere_where_dup_over_merge_distributed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Original pull-request #110710
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Version info
26.3.17.61