Skip to content

Resolve text index stream names and sizes from the part's checksums - #120875

Merged
CurtizJ merged 8 commits into
ClickHouse:masterfrom
groeneai:groeneai/text-index-resolve-streams-from-checksums
Sep 21, 2026
Merged

CurtizJ merged 8 commits into
ClickHouse:masterfrom
groeneai:groeneai/text-index-resolve-streams-from-checksums

Conversation

@groeneai

@groeneai groeneai commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closes: #120672

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

A query that reads a text index no longer asks the filesystem for each index substream's on-disk name and size once per part; both are now taken from the part's checksums, which already hold them. On an 8M-row table split into 400 parts, SELECT count() FROM logs WHERE hasToken(message, 'needle') drops from a median 12 ms to 9 ms, with 42% less system time.

Description

Reported by @ snelheidai in #120672 with a candidate patch. The numbers here are my own re-measurement.

makeTextIndexInputStream takes a DataPartStoragePtr rather than the owning part, so it cannot see the loaded checksums and probes the filesystem: existsFile(name), on a miss existsFile(sipHash128String(name)), then getFileSize on the survivor. A text index has whole-part granularity, so this runs once per substream per part per query, about 1200 stream constructions for one count() over 400 parts. The skip index construction site makeIndexReaderStream already reads both facts from checksums.

This adds an overload taking const IMergeTreeDataPartInfoForReader &, which every part-holding call site already has. A stream with no checksums entry is still resolved and sized through the storage, and FILE_DOESNT_EXIST still fires when neither name resolves. The index merge keeps the storage overload, because a segment can be a temporary storage with no part. Sizes are equal by construction: MergeTreeDataPartChecksum::checkSize already verifies every checksums entry against storage.getFileSize, the call this replaces, so a part passing its consistency check cannot disagree, packed storage and encrypted disks included.

Two deliberate differences from the patch as filed: the branch is on the resolved name, not on size == 0, since a legitimately empty substream is 0 bytes and still listed in checksums (04654_text_index_merge_with_empty_part); and a text index is never bundled into skp_idx.packed (initSkipIndices excludes MergeTreeIndexText), so that identity argument does not apply. The stronger statement holds instead: for a materialized text index the checksums entry always exists, and the storage path is only a fallback.

On Cloud keeper-backed metadata these probes are Keeper round trips, the chain #115110 wrapped in a Keeper component; its guards are untouched.

Residual: if checksums list a stream the disk lacks, the failure now surfaces at open rather than here. That needs an already-corrupt part, and the sibling accepts the same.

Validation: release A/B and the size-equality check

Release pair from this branch, Build IDs asserted per server. Fixture: 8M rows in 400 parts,
count asserted after a restart; caches off, max_threads = 1, warm-ups discarded, timings from
system.query_log. 16 alternating base/fix blocks, 128 reps per arm: one block pair cannot clear its own
A/A null here (+-11..17% per block, -0.2% / +1.8% pooled).

arm base fix change 95% CI (ratio) rounds
count() + 1 hasToken 12.0 ms 9.0 ms -25.0% [0.750, 0.750] 16/16
count() + hasAllTokens, 8 needles 22.0 ms 18.0 ms -18.2% [0.818, 0.818]
max(ts) + hasToken (control) 56.0 ms 56.0 ms +0.0% [0.982, 1.036]
non-indexed predicate (control) 39.0 ms 39.0 ms +0.0% [1.000, 1.000]
250k-row read, reader path 160.0 ms 158.5 ms -0.9% [0.969, 1.013] 9/16

System time on the first arm drops 42.1% (5.1 -> 2.9 ms, CI [0.478, 0.600]): the removed stat/existsFile
calls. read_rows, result_rows and ProfileEvents['FileOpen'] are identical across arms, so the gain moves
no rows and opens no files.

An understated size would truncate a read rather than raise an error, so a throw-away build asserted that the
name and size from checksums equal the storage's: 1580 observations, 0 mismatches over
the text_index full_text skip_index skip_indices suite and this fixture, covering hashed
names, 0-byte substreams still in checksums, and packed storage, whose size comes from the archive index.

No stateless test is added: 142 of the 149 stateless tests that query a text index leave
replace_long_file_name_to_hash, max_file_name_length and min_bytes_for_full_part_storage to the runner
(tests/clickhouse-test:2098-2100), and max_file_name_length = 0 hashes every substream of a short-named text
index, so both shapes are already exercised there.


Workflow [PR]
Sync PR [sync-upstream/pr/120875]

Version info

  • Merged into: 26.10.1.383-master (included in 26.10 and later)

makeTextIndexInputStream took a DataPartStoragePtr rather than the owning part,
so it could not see the part's loaded checksums and resolved each index
substream by probing the filesystem: existsFile(name), on a miss
existsFile(sipHash128String(name)), then getFileSize on the survivor. A text
index has whole-part granularity, so this ran once per substream per part per
query, about 1200 stream constructions and 3600 metadata operations for one
count() over a 400-part table. On Cloud keeper-backed metadata each probe is a
Keeper round trip on a pipeline-execution thread, the chain ClickHouse#115110 had to wrap
in a Keeper component.

Add an overload taking const IMergeTreeDataPartInfoForReader &, the abstraction
f018a33 migrated this reader layer onto and which every part-holding call
site already has, and read the name and the size from its checksums. The branch
is on the resolved name rather than on size == 0, because getFileSizeOrZero
returns 0 both for "absent from checksums" and for a legitimately empty
substream, and the latter is a real state
(04654_text_index_merge_with_empty_part): a size-based branch would send exactly
the emptied parts back to the filesystem. A stream with no checksums entry is
still resolved and sized through the storage, and FILE_DOESNT_EXIST still fires
after both attempts fail. The index merge keeps the storage overload, since a
segment can be a temporary materialization storage with no part.

Measured on a release pair, 8M rows in 400 parts, 16 alternating base/fix
blocks: count() with one hasToken needle 12.0 -> 9.0 ms median (-25.0%, 16/16
rounds, system time -42.1%), 8 needles -18.2%, max(ts) with the same predicate
and a non-indexed predicate flat, a 250k-row read through the reader path flat;
read_rows, result_rows and FileOpen identical across arms. A throw-away build
asserted that the name and size from checksums equal the storage's over the
whole text-index and skip-index suite: 1580 observations, 0 mismatches,
including hashed names, 0-byte substreams still listed in checksums, and packed
part storage, whose size comes from the archive index rather than a stat.

Tests: 05227_text_index_hashed_stream_name covers a hashed text index stream
name and a text index on packed part storage, neither of which any test covered;
tests/performance/text_index_count_stream_resolution.xml ships the count shape
at 400 parts.

Closes: ClickHouse#120672
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-issue PR origin: picked up an external GitHub issue labels Sep 18, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (click to expand)

An independent cold review, then a second model re-reviewed the diff. Three findings, none needing a code
change; the reasoning is here so it can be checked rather than trusted.

# Finding Verdict
⚠️ The stateless test cannot detect a silent fall back to the filesystem path for a hashed or 0-byte stream Disagreed, with the residual conceded below
💡 The new resolve-and-size block duplicates the skip index sibling Noted, not blocking
💡 214 test lines against 64 source lines Noted, not blocking

⚠️ Test liveness. Conceded as literally true; the prescribed remedy is what I disagree with. It is not
expressible: no ProfileEvent counts local existsFile/getFileSize, so nothing can be asserted from SQL,
and adding one means a counter or a failpoint that exists only to serve a test. What is expressible ships:
the perf test reddens if the checksums lookup is deleted (-25.0%, 95% CI [0.692, 0.750] and -17.4%, 6/6
rounds each, control flat); mutation on the arm the finding names reddens 05227, with FILE_DOESNT_EXIST
on the hashed substream and again on a halved size, base and patched binaries green; and a throw-away
build asserting name and size equality inside the new overload saw 0 mismatches in 1580 observations,
including 0-byte substreams still in checksums and packed part storage. Stronger than any test, the equality
is enforced in-tree already: MergeTreeDataPartChecksum::checkSize throws BAD_SIZE_OF_FILE_IN_DATA_PART
when storage.getFileSize(name) != file_size, and checkConsistencyBase runs it over every checksums entry
through the same call this patch replaces.

Residual I concede rather than close, your call. The perf fixture uses a short index name, so a
regression breaking only the hashed-name fast path would be invisible to both tests: results stay correct
and the cost is losing the gain for long index names. I can switch the fixture to a hashed name and
re-measure if you would prefer that guarded.

💡 Duplication. Kept deliberately: makeIndexReaderStream is the in-tree pattern and this makes the
fourth checksums-first site, and the contracts differ, since this one must yield the resolved name and must
still throw when neither name resolves, where the *Resolved helpers return 0. Happy to factor it onto
IMergeTreeDataPartInfoForReader if that is preferred.

💡 Test size. One case per carrier rather than repetition: full and packed part storage, the count,
reader and positions paths, before and after a delete that empties a part, and a short-name control that
localises a failure to name hashing, every value cross-checked against use_skip_indexes = 0. Glad to trim.

@clickhouse-gh clickhouse-gh Bot closed this Sep 18, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Sep 18, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [34f93ff]

Summary: ❌

job_name test_name status info comment
Upgrade check (amd_release) FAIL
1 mutations could not be killed before the upgrade (see unkilled_mutations.txt) FAIL cidb IGNORED

AI Review

Summary

This PR switches text-index substream resolution in the ReadFromTextIndexCount and MergeTreeReaderTextIndex paths from filesystem probes to the part checksums, and adds a dedicated performance benchmark for the count path. The code change itself looks consistent, but the new benchmark still leaves one required parent gate of ReadFromTextIndexCount implicit, so it can silently stop exercising the optimized path and stop proving the claimed performance improvement.

Findings

⚠️ Majors

  • [tests/performance/text_index_count_stream_resolution.xml:11] query_plan_optimize_count_from_text_index is still ANDed with optimize_trivial_count_query in src/Processors/QueryPlan/Optimizations/QueryPlanOptimizationSettings.cpp:260-262. The existing regression tests/queries/0_stateless/02346_text_index_optimize_trivial_count.sql:41-42 already demonstrates that disabling that parent removes ReadFromTextIndexCount. As written, this perf test can keep passing while measuring the fallback Filter + ReadFromMergeTree plan instead of the stream-construction path changed by this PR.
    Suggested fix: pin <optimize_trivial_count_query>1</optimize_trivial_count_query> in the benchmark settings block.
Missing context / blind spots
  • ⚠️ The current PR CI was still running during this review, so I could not use the live performance-comparison shards on the latest head to validate the final 400-part fixture shape.
Final Verdict

Status: ⚠️ Request changes

Minimum required action: pin optimize_trivial_count_query = 1 in tests/performance/text_index_count_stream_resolution.xml so the new benchmark always measures ReadFromTextIndexCount.

LLVM Coverage Report

Measured on commit 34f93ff.

Metric Baseline Current Δ
Lines 88.00% 88.00% +0.00%
Functions 91.80% 91.70% -0.10%
Branches 79.30% 79.30% +0.00%

Changed lines: Changed C/C++ lines covered: 49/52 (94.23%) · Uncovered code

Full report · Diff report

@clickhouse-gh

clickhouse-gh Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 36 queries analysed

no significant changes detected. K_source=6 K_base=30 flagged=0/65

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 5741cda0-6a84-4f9b-8c6c-db5c38ac20d8
  • MIRAI run: 15481e69-5175-4baf-a149-33d58fbce407
  • PR check IDs:
    • clickbench_1144415_1789988491
    • clickbench_1144421_1789988490
    • clickbench_1144427_1789988490
    • tpch_adapted_1_official_1144438_1789988490
    • tpch_adapted_1_official_1144449_1789988490
    • tpch_adapted_1_official_1144485_1789988491

The test's two plan-shape probes assert that the text index count rewrite
and the reader path are really taken, so that the value assertions below
them are not vacuous. Parallel replicas disarm both:
optimizeTrivialCountFromTextIndex returns early when
Context::canUseParallelReplicasOnInitiator() holds, and with
parallel_replicas_local_plan = 0 the read query's plan carries no local
part read for EXPLAIN to inspect. The ParallelReplicas stateless flavour
enables parallel replicas in the default profile, so `count path taken`
read 0 there (deterministic, 3 of 3 reruns), and `read path taken` would
have flipped on the runner's 50/50 parallel_replicas_local_plan
randomization. Pinning the setting at session level, as many other
stateless tests do, keeps every assertion running in that flavour rather
than skipping the file with a no-parallel-replicas tag: with the pin the
count path is exercised there too, and both mutation arms still redden
the test.

The plain-name control had the same shape of hole. It relied on its index
name being short rather than on the setting, and the runner randomizes
max_file_name_length with a 30% weight on 0, which hashes a name of any
length when replace_long_file_name_to_hash is also randomized on. Roughly
one run in seven compared hashed names against hashed names, so a
hashing-specific failure would not have localised. Measured: with the
flag off and the threshold at 0 the part keeps skp_idx_idx.*; with the
flag on every index file is a sipHash128String name.

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 8b14a3d

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task whose
fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) / 05227_text_index_hashed_stream_name PR-caused, and deterministic: failed 3 of 3 reruns with one differing line, count path taken 1 expected against 0 observed. The test is added by this PR and asserts the count fast path is taken, which does not hold on this lane's ParallelReplicas plus s3 combination, so the assertion is not lane-safe as written #120875 (mine, this PR: the fix lands here)
Build profile diff infra: RuntimeError: CI logs cluster query failed, raised at ci/jobs/scripts/log_cluster.py:234; 243 distinct PRs carry the identical signature in 24h #118708 (mine, open)
Performance Comparison (arm_release, master_head, 5/6) measurement run reports 10 errors; the shard went from about 1 red/day to 163 reds on 2026-09-18, starting right after #120176 merged at 21:10Z, and it is red on master too #120923 (external, open)
Mergeable Check, PR praktika rollups of the three rows above, no independent failure #120875 (mine, this PR), #118708 (mine, open) and #120923 (external, open)

The Finish Workflow failure on this commit belongs to the superseded run 35368252845 (cancelled
16:26Z); on the live run 35368345524 it is green, and that run is 156 success / 14 skipped / 3 failures.
I am keeping this PR out of review until the first row is fixed here.

Session id: cron:our-pr-ci-monitor:20260919-020058

@groeneai

Copy link
Copy Markdown
Collaborator Author

Pushed 8ca613c: the red Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) was my own test's plan-shape probe, not the patch. optimizeTrivialCountFromTextIndex bails when Context::canUseParallelReplicasOnInitiator() holds, and that flavour enables parallel replicas in the default profile, so count path taken correctly read 0 while every value assertion passed.

I pinned enable_parallel_replicas = 0 in the test instead of tagging the file no-parallel-replicas, so all 34 reference lines keep running in that flavour and the count path is now exercised there too. Verified locally by reproducing the flavour: the same one-line diff before the pin, green after, and both mutation arms still redden the test, mut1 inside TextIndexCount. The same commit pins replace_long_file_name_to_hash = 0 on the plain-name control, which the runner's max_file_name_length randomization (30% weight on 0) could otherwise hash, making the control compare hashed names against hashed names in roughly one run in seven.

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 8ca613c

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Performance Comparison (arm_release, master_head, 5/6) perf-harness fixture failure, not a measurement of this diff: 10 errors, 4 too long, and the errors are iceberg_suite_tpch queries that never ran because ATTACH TABLE tpch_ice10.* fails with Code: 481 PATH_ACCESS_DENIED (.../perf_wd/left/db/user_files/tpch_ice_sf10/nation/ is not inside .../perf_wd/left/db/left/db/user_files/, the doubled left/db) on both the base server (port 9001) and the PR server (19001). Repo-wide: 215 perf-comparison reds over 163 distinct PRs and 36 master runs in the last 24 hours #120964 (mine, open) for the PATH_ACCESS_DENIED errors, #120923 (external, open) for the long-query rows
Build profile diff infra: RuntimeError: CI logs cluster query failed raised at ci/jobs/build_profile_diff_job.py:234 from compare_symbols (:1405), after repeated 60s ReadTimeouts against the CI logs cluster #118708 (mine, open)
Mergeable Check, PR praktika rollups of the row above (Failed: Performance Comparison (arm_release, master_head, 5/6)) #120964 (mine, open) and #120923 (external, open)

The lane-conditional failure of 05227_text_index_hashed_stream_name that this head fixes is gone: the test is now OK on amd_llvm_coverage, ParallelReplicas, s3 storage, parallel and on 50 of 50 runs in each of the five flaky check flavours.

Session id: cron:our-pr-ci-monitor:20260919-073140

@CurtizJ CurtizJ self-assigned this Sep 19, 2026
Review asks on ClickHouse#120875: 200 parts instead of 400, and remove the
`host = 'host7'` query.

Both queries keep the effect. Halving the fixture also moves the
`hasAnyTokens` query from 24 ms to 14 ms, i.e. under the harness's
--fast-query-seconds boundary of 20 ms, so it is measured with the
30-run fast-query cap instead of 5-7 runs. Measured A/B on this
branch's base and head, 3 replicates each, medians and the report's
own stat_threshold:

  200 parts  hasToken     8.1 -> 6.2 ms  -23%  (30 runs, th 0.13-0.16)
  200 parts  hasAnyTokens 13.3 -> 11.7 ms -12% (30 runs, th 0.07-0.11)
  400 parts  hasAnyTokens 24.0 -> 21.1 ms -12% (5-7 runs, th 0.07-0.17)

The 400-part `hasAnyTokens` row fell under its own noise threshold in
1 of 3 replicates; the 200-part one cleared it in 3 of 3.
…nchmark

query_plan_optimize_count_from_text_index is ANDed with
query_plan_direct_read_from_text_index in QueryPlanOptimizationSettings.cpp, so
pinning only the child leaves the benchmark depending on the parent gate's
default. With the parent off, the two count() queries fall back to
Filter + ReadFromMergeTree, which never constructs the text index substream
readers this PR changes: the test would keep running and quietly stop measuring
the effect it exists for.

Measured on this branch's release binary: the settings block as shipped plans
ReadFromTextIndexCount, the same block with query_plan_direct_read_from_text_index
= 0 plans Filter + ReadFromMergeTree, and the block with the pin plans exactly
what the shipped one does on current defaults, so the pin changes no timing. The
other text index performance tests, text_index_trivial_count.xml among them,
already pin the parent gate.
@clickhouse-gh

clickhouse-gh Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 34f93ff6a with master 2ee0ab46f (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 295f03a88; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

12 translation units recompiled, 88 s compile time in total, 12 of them have a recent master baseline.

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 964f572

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task whose
fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Performance Comparison (amd_release, master_head, 3/6) / iceberg_suite_tpch run error, not PR-caused: the measurement loop raises when one query overruns the harness max_query_seconds cap (perf.py:1067 -> :473), and the report publishes that traceback's head as "10 errors" for the single failing test. Onset 2026-09-18 00:32:42Z, right after #120176 merged (2026-09-17T21:10:53Z); 1620 error rows over 120 distinct PRs in 24h, 240 of them true-master rows #120923 (external, merged 2026-09-19T18:34:47Z), merged master @ 3e48a10b8ee5a
Mergeable Check, PR praktika rollups of the row above, no independent failure #120923 (external, merged), merged master @ 3e48a10b8ee5a

The tested tree predates that fix, measured rather than inferred: the failing job's confirmed
checkout 4ca6ee97922a does not contain the revert, while this branch after the merge does.
So I merged master into the branch (3e48a10b8ee5a, no conflicts, no source or test change) and CI
is re-running with the revert present.

4 too long, 2 faster and 1 unstable in the same status string do not red a shard: shards 1/6,
2/6, 4/6, 5/6 and 6/6 of this run carry the same classes and are green.

Session id: cron:our-pr-ci-monitor:20260919-203235

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 3e48a10

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Performance Comparison (amd_release, master_head, 6/6) / sparse_column_index_runs #5 the dashboard-verdict gate merged on 2026-09-19 (#120927) reds a master_head shard on a dashboard confirmed_regression even when the shard's own report does not call the query changed: client_time 0.0318 -> 0.0368 (+15.6%) is confirmed_regression, while the same run reports only 2 too long, 2 faster and no slower. Not reachable from this diff, which resolves text index stream names from part checksums and touches no sparse-column or index-run code. Measured over the last 24 hours: 178 rows carrying this signature across 130 distinct pull requests and 134 distinct heads, onset 2026-09-19 14:02:31Z #121090 (mine, open)
Build profile diff job-level RuntimeError: CI logs cluster query failed traceback out of ci/jobs/build_profile_diff_job.py, so a non-ok CI logs cluster response aborts the job instead of degrading to "no baseline". The job only reads build_time_trace on the logs cluster and neither builds nor runs the server, so it is not reachable from this diff. Measured over the last 24 hours: 389 rows across 348 distinct pull requests #118708 (mine, open)
Mergeable Check, PR praktika rollups of the two rows above, no independent failure #121090 (mine, open) and #118708 (mine, open)

Session id: cron:our-pr-ci-monitor:20260920-110135

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 13073ea

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_debug, parallel) and (arm_binary, parallel) / 05227_storage_settings_unknown_name Not from this PR, which touches text index stream resolution only. Trunk-wide: the test is mine (added by merged #120898) and three of its expected lines pinned, through a full SHOW CREATE TABLE echo, where an accepted name = DEFAULT query-setting reset is stored; #118423 deliberately moved that. Deterministic, not randomization (the job's own diagnosis reproduces it with and without randomized settings), 801 CIDB rows over 76 pull requests since 05:31Z today, 257 of them on true master. It is a different test from this PR's own 05227_text_index_hashed_stream_name, which passes #121163 (mine, open)
Build profile diff Not from this PR. The job's own read of the CI logs cluster fails, so no binary comparison is produced at all: 332 of 830 runs in 24 hours end error, across 361 distinct pull requests #118708 (mine, open) and #121048 (external, open)

Mergeable Check and PR are rollups of the rows above.

Session id: cron:our-pr-ci-monitor:20260920-160237

Review ask on ClickHouse#120875: a .sql test does not earn its place next to the perf
test here. Measured, its premise does not hold.

The stateless runner randomizes replace_long_file_name_to_hash,
max_file_name_length and min_bytes_for_full_part_storage
(tests/clickhouse-test:2098-2100), and max_file_name_length = 0 hashes every
substream of a text index whose name is short: an `INDEX idx` text index writes
skp_idx_idx.idx, .dct.idx and .pst.idx under three sipHash128 names, and the
hasToken answer through the index still matches use_skip_indexes = 0. 146 of the
151 stateless tests that query a text index leave all three settings to the
runner, so hashed stream names and packed part storage are already exercised
there, rather than being uncovered as the deleted file claimed.

Index name length does not select a resolution path in this change either:
getStreamNameOrHash probes the plain and the hashed name against the same
checksums map, and a part emptied by a mutation never reaches
makeTextIndexInputStream (measured with strace earlier in this PR). What the
change adds is the checksums lookup itself, which every one of those 151 tests
exercises, and sizes cannot disagree with the storage because
MergeTreeDataPartChecksum::checkSize already verifies each entry against the
call this replaces.
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 34f93ff

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task whose
fixing-PR link will be posted here when it opens. CH Inc sync passed on this head, so nothing here is ownerless.

Check / test Reason Owner / fixing PR
Upgrade check (amd_release) / 1 mutations could not be killed before the upgrade not from this diff: the stress phase left test_5.t_lwu_on_fly (UPDATE b = 20 WHERE a = 2) unfinished (parts_to_do: 1, empty latest_fail_reason) and it survived the pre-upgrade KILL MUTATION loop that #120978 added on 2026-09-20. That assertion is two days old: its passing counterpart has 299 OK rows over 229 pull requests since 2026-09-19 21:18Z, while the failing form has 3 rows on 3 unrelated pull requests, on 3 different leftover tables, with 0 true-master rows. This PR changes text index stream resolution and one performance test, not the upgrade harness, the mutation code or the 03100_lwu_* tests a fix task is created (investigating at full effort, fixing-PR link to follow on this PR)
Mergeable Check, PR aggregator statuses mirroring the row above same owner as above: a fix task is created

Gates (a) to (d): 0 of 176 check runs queued or running, Config Workflow, Style check and Finish Workflow all success, 54 min since the last job finished (anchor 2026-09-21T13:20:06Z), and every failing row above has an owner.

Session id: cron:our-pr-ci-monitor:20260921-140539

@alexey-milovidov alexey-milovidov mentioned this pull request Sep 21, 2026
1 task done
@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the Upgrade check (amd_release) row 1 mutations could not be killed before the upgrade in the ledger above: #121409.

Root cause, measured on v26.8.10.6-lts: the stress phase's TRUNCATE ALL TABLES leaves the leftover replicated tables permanently read-only on the previous release, so the pre-upgrade killMutation throws Code: 242 TABLE_IS_READ_ONLY and ||: discards it. That PR reports the error and restarts the affected replicas before killing again, so this row is not from this branch.

@CurtizJ
CurtizJ added this pull request to the merge queue Sep 21, 2026
Merged via the queue into ClickHouse:master with commit e033cea Sep 21, 2026
175 of 177 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-text-index Full-text search: inverted/text index in MergeTree (tokenizers, posting lists, GIN-style index bu... groeneai-origin-issue PR origin: picked up an external GitHub issue pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

5 participants