Repository navigation
Conversation
When a query uses two or more text indexes that are each only partially materialized (added via `ALTER ... ADD INDEX` after data was inserted, so older parts lack the index files), direct read from the text index could throw `Code 107 FILE_DOESNT_EXIST`, e.g. "File for text index stream skp_idx_usert_text_idx.idx does not exist". Each text index gets its own PREWHERE read step holding only its virtual column. For a part where the index is not materialized and the predicate uses Hint mode (e.g. `equals` on a `sparseGrams` index), the virtual column's default expression is the literal `1`, so `injectRequiredColumns` appends the part's minimum-size physical column purely as a row-count anchor. The presence of that physical column is also what made `getIndexReadTaskForReadStep` route the step to the main reader instead of to the text index reader. However, the anchor is the same column for every step, and `getReadTaskColumns` deduplicates columns already read by earlier steps, so only the first index step kept it. The remaining index steps degenerated into pure virtual-column steps and were routed to `MergeTreeReaderTextIndex`, which threw because the index file is absent in that part. Decide the routing based on actual per-part materialization instead: in `getIndexReadTaskForReadStep`, route a step to the text index reader only when `getDeserializedFormat` reports the index is present in the part, otherwise fall back to the main reader (which fills the virtual column from its default expression). The behavior is unchanged for materialized parts. Closes: ClickHouse#108530 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [0cc9bd3] Summary: ✅
AI ReviewSummary
Missing context / blind spots
Final Verdict
|
Contributor
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 15/15 (100.00%) | Lost baseline coverage: none · Uncovered code |
robot-clickhouse-ci-1
added a commit
that referenced
this pull request
Jun 26, 2026
Cherry pick #108607 to 26.3: Fix direct read from multiple partially materialized text indexes
robot-clickhouse
added a commit
that referenced
this pull request
Jun 26, 2026
…erialized text indexes
robot-clickhouse-ci-1
added a commit
that referenced
this pull request
Jun 26, 2026
Cherry pick #108607 to 26.4: Fix direct read from multiple partially materialized text indexes
robot-clickhouse
added a commit
that referenced
this pull request
Jun 26, 2026
…erialized text indexes
robot-clickhouse-ci-1
added a commit
that referenced
this pull request
Jun 26, 2026
Cherry pick #108607 to 26.5: Fix direct read from multiple partially materialized text indexes
robot-clickhouse
added a commit
that referenced
this pull request
Jun 26, 2026
…erialized text indexes
robot-clickhouse-ci-1
added a commit
that referenced
this pull request
Jun 26, 2026
Cherry pick #108607 to 26.6: Fix direct read from multiple partially materialized text indexes
robot-clickhouse
added a commit
that referenced
this pull request
Jun 26, 2026
…erialized text indexes
clickhouse-gh Bot
added a commit
that referenced
this pull request
Jun 27, 2026
Backport #108607 to 26.6: Fix direct read from multiple partially materialized text indexes
CurtizJ
added a commit
that referenced
this pull request
Jun 29, 2026
The cherry-pick of #108607 calls `IMergeTreeIndex::getDeserializedFormat` with a third `const IDataPartStorage *` argument, which exists only on master (for packed index substreams via the `skp_idx.packed` overlay). On this release branch the method takes two arguments, so the build failed with "too many arguments to function call". On master, passing `storage == nullptr` disables the archive check, making the call equivalent to the two-argument form used everywhere else on this branch, so dropping the argument is behavior-preserving here. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
CurtizJ
added a commit
that referenced
this pull request
Jun 29, 2026
The cherry-pick of #108607 calls `IMergeTreeIndex::getDeserializedFormat` with a third `const IDataPartStorage *` argument, which exists only on master (for packed index substreams via the `skp_idx.packed` overlay). On this release branch the method takes two arguments, so the build failed with "too many arguments to function call". On master, passing `storage == nullptr` disables the archive check, making the call equivalent to the two-argument form used everywhere else on this branch, so dropping the argument is behavior-preserving here. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
CurtizJ
added a commit
that referenced
this pull request
Jun 29, 2026
The cherry-pick of #108607 calls `IMergeTreeIndex::getDeserializedFormat` with a third `const IDataPartStorage *` argument, which exists only on master (for packed index substreams via the `skp_idx.packed` overlay). On this release branch the method takes two arguments, so the build failed with "too many arguments to function call". On master, passing `storage == nullptr` disables the archive check, making the call equivalent to the two-argument form used everywhere else on this branch, so dropping the argument is behavior-preserving here. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
CurtizJ
added a commit
that referenced
this pull request
Jun 29, 2026
Backport #108607 to 26.5: Fix direct read from multiple partially materialized text indexes
CurtizJ
added a commit
that referenced
this pull request
Jun 29, 2026
Backport #108607 to 26.4: Fix direct read from multiple partially materialized text indexes
CurtizJ
added a commit
that referenced
this pull request
Jun 29, 2026
Backport #108607 to 26.3: Fix direct read from multiple partially materialized text indexes
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…x-partial-materialization Fix direct read from multiple partially materialized text indexes
bytehalo-infra
added a commit
to sentioxyz/ClickHouse
that referenced
this pull request
Sep 25, 2026
STOR: direct read from several partially materialized text indexes -> wrong/exc. Effect in the production build a394e92: its upstream test(s) 04411_text_index_multiple_partially_materialized 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): 04411_text_index_multiple_partially_materialized. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bytehalo-infra
added a commit
to sentioxyz/ClickHouse
that referenced
this pull request
Sep 25, 2026
…ustom settings prefixes, reviewed dispatch sites, two open defects) The CAND4 (e7432ca) release gate reported, besides the open KD-D512-MIXED-GROUPBY-NULLABLE: - 3 skipped tests (04303, 04305, 04357: "no shard"): run_checks.sh passed --no-shard, a leftover from before the isolated server listened on 127.0.0.1-3 with the test clusters. Dropped, so clickhouse-test detects shard support from the server config as the triage runs do. - 05023 (ClickHouse#115334's test): the isolated server allowed only the custom_ settings prefix; it now allows SQL_,custom_ like the upstream test config (tests/config/config.d/custom_settings_prefixes.xml). isolated_ch.sh is vendored from the skill draft; VENDORED.sha256 updated. - 2 dispatch-scan candidates: the Int512 fast path of 7581066 (bothFitInt256/mulInt256Range); reviewed, not a gap. - 04411 (ClickHouse#108607's test): its three-index section recurses in equals() on every 26.3 build, including production and builds without the backport (FILE_DOESNT_EXIST, the bug ClickHouse#108607 fixes, is gone). New open KD-UP-TEXTINDEX-DIRECTREAD-3IDX (pre-existing upstream 26.3 bug, upstream fix not identified; workaround query_plan_direct_read_from_text_index = 0). - 04881 (ClickHouse#114624's test): its only differing line is the reference with the host name 'build' replaced by 'localhost' by clickhouse-test; the output is otherwise identical. New open KD-ENV-HOSTNAME-SUBSTITUTION (environment); the test and its reference are not edited. The fifth failure, 04409, is the missing dependency ClickHouse#106905 (previous commit). Registry: 147 entries, 3 open. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bytehalo-infra
added a commit
to sentioxyz/ClickHouse
that referenced
this pull request
Sep 25, 2026
…ion comes with the ClickHouse#108607 backport) Correction of 4d9f96f, whose message and registry entry said that the three-index section of 04411 recursed on every 26.3 build, including production and builds without the backport. That came from reproduction runs capped at TasksMax=512: ClickHouse could not start its threads there and dumped core. Rerun with TasksMax=8192: - production a394e92, hotfix cd0d608, CAND3 7581066: FILE_DOESNT_EXIST (107), the bug ClickHouse#108607 fixes; - CAND4 e7432ca: TOO_DEEP_RECURSION (306), only for the query that uses all three indexes; one- and two-index queries (and a cross-column check) are correct; official 26.8.8.8 is correct. The entry stays open with the corrected root cause; the backport is kept (it fixes the one- and two-index cases). Evidence: evidence/fix_ci_20260925/textindex_recursion_26_3/results.txt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bytehalo-infra
added a commit
to sentioxyz/ClickHouse
that referenced
this pull request
Sep 25, 2026
text index prewhere fix) STOR: with query_plan_direct_read_from_text_index and use_skip_indexes_on_data_read, each text index read is a None-type PREWHERE step. IndexReadTasks/IndexReadColumns were std::unordered_map: the map is copied into the read pool and iterated again in getPrewhereActions and getReadTaskColumns, and a copy need not iterate in the same order, so the PREWHERE readers and the PREWHERE actions of the index steps could be paired differently. In addition MergeTreeRangeReader executed the actions of None-type steps on its sample block although executePrewhereActionsAndFilterColumns skips them at run time, so the sample block and the data diverged. Upstream switches both maps to std::map and skips None-type steps on the sample block (26.3 backport ClickHouse#107758 of 1c1c031 from ClickHouse#98882; 26.4+ have it through ClickHouse#98882). Effect in the fork: with three partially materialized text indexes in one query (04411, third section) the backport of ClickHouse#108607 (a6ab685) ran equals(a, 'alpha') on a column that was not the String column a and failed with TOO_DEEP_RECURSION (KD-UP-TEXTINDEX-DIRECTREAD-3IDX); with a row policy on a String column the upstream test 04332 fails with ILLEGAL_TYPE_OF_COLUMN_FOR_FILTER. Upstream patch unchanged (applies cleanly), with its test 04332_text_index_direct_read_row_policy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed direct read from multiple partially materialized text indexes.
Fixes #108530.
Version info
26.7.1.123(included in26.7and later)26.6.2.4,26.5.5.4,26.4.5.82,26.3.17.5