Skip to content

Revert "Avoid building stream names and substreams cache keys for every block in MergeTreeReaderWide" - #127836

Merged
Avogar merged 3 commits into
masterfrom
revert-124816
Nov 3, 2026
Merged

Avogar merged 3 commits into
masterfrom
revert-124816

Conversation

@Avogar

@Avogar Avogar commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Reverts #124816, see #124816 (comment): the memo of stream names in MergeTreeReaderWide copies into SubstreamKey the fields of ISerialization::Substream that a stream name depends on today, an invariant between the serializations and the MergeTree reader that nothing checks and that the next name-bearing field would break silently, and the optimization pays off only with max_block_size of about 16 or below.

The revert is not automatic because #127000 changed the same code since: the rendering of the cache keys of SHARED paths of JSON and the sub-column sizes in getAllColumnsSubstreams. Their behaviour is kept over the pre-#124816 mechanics: stream names are built per call again and the substreams caches are keyed by strings again. The performance test merge_tree_small_blocks added by #124816 goes with it.

Related: #124816
Related: #127000

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Version info

  • Merged into: 26.11.1.1219-master (included in 26.11 and later)

This reverts commit 46a479e, reversing
changes made to 1e6f88e.

The conflicts with the later changes of #127000 to the same code (the
cache-key rendering of the SHARED paths of JSON and the sub-column sizes
in getAllColumnsSubstreams) are resolved by keeping their behaviour over
the pre-#124816 mechanics: stream names built per call and string keys
of the substreams caches.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [481fa5b]

Summary: ✅


AI Review

Summary

The PR manually reverts #124816, restoring per-call stream-name construction, string substream-cache keys, and per-read cache clearing in MergeTreeReaderWide. It preserves the later SHARED JSON path identities and subcolumn-size accounting from #127000. No actionable findings at commit 481fa5bcc34d6862eebcea31ab5665d870751ae7.

Missing context / blind spots
  • ⚠️ Broader CI, including sanitizer builds and full stateless tests, is still pending. Fast tests include a passing 05427_json_shared_typed_paths_cache_key_collision; concurrent-reader and columns-cache tests were skipped there. Completion of the corresponding full CI jobs would close this validation gap. No local build or runtime tests were run.
Final Verdict

Status: ✅ Approve. No code changes requested; normal CI completion remains necessary before merging.

LLVM Coverage Report

Measured on commit 481fa5b.

Metric Baseline Current Δ
Lines 88.80% 88.80% +0.00%
Functions 91.60% 91.50% -0.10%
Branches 80.50% 80.50% +0.00%

Changed lines: Changed C/C++ lines covered: 181/192 (94.27%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Oct 26, 2026
@Avogar Avogar added the ci-force-all Do not skip any jobs when running label Oct 26, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-mergetree MergeTree* family: parts, merges, primary index, column statistics, background data transformation. label Oct 26, 2026
@Avogar Avogar self-assigned this Nov 2, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 481fa5bcc with master 77fcf30c9 (stripped binary size, per-symbol sizes and ThinLTO time; 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.

Object file sizes

76 object files changed (-23.94 KiB total), 0 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/Storages/MergeTree/MergeTreeReaderWide.cpp.o 422.76 KiB 403.25 KiB -19.51 KiB (-4.62%)

719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

3242 translation units recompiled, 17892 s compile time in total, 3241 of them have a recent master baseline.

Translation units without a recent master baseline:

  • programs/keeper/Keeper.cpp (clickhouse-keeper): 7.7 s

Job report

@Avogar
Avogar added this pull request to the merge queue Nov 3, 2026
Merged via the queue into master with commit 0a379d2 Nov 3, 2026
180 checks passed
@Avogar
Avogar deleted the revert-124816 branch November 3, 2026 15:40
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 3, 2026
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 3, 2026
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 3, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 3, 2026
Backport #127836 to 26.10: Revert "Avoid building stream names and substreams cache keys for every block in MergeTreeReaderWide"
leshikus pushed a commit that referenced this pull request Nov 13, 2026
…bstreams cache keys for every block in MergeTreeReaderWide"
@clickhouse-gh clickhouse-gh Bot added comp-part-formats Formats of MergeTree data parts in the public repository, that is how a part is laid out on disk ... and removed comp-mergetree MergeTree* family: parts, merges, primary index, column statistics, background data transformation. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-force-all Do not skip any jobs when running comp-part-formats Formats of MergeTree data parts in the public repository, that is how a part is laid out on disk ... pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo v26.10-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants