Skip to content

Sync changes - #109203

Merged
kssenii merged 2 commits into
masterfrom
sync-file-cache-changes
Jul 10, 2026
Merged

kssenii merged 2 commits into
masterfrom
sync-file-cache-changes

Conversation

@kssenii

@kssenii kssenii commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

...

Version info

  • Merged into: 26.7.1.767 (included in 26.7 and later)

Copy the FileCache- and DistributedCache-related changes made in
`clickhouse-private` master into the files that already exist in the
public repository (no new files added), and make the public build
self-contained by keeping the distributed-cache-only headers private.

FileCache/DistributedCache sync (public files updated to match private):
`FileCache`, `IFileCachePriority`, `LRU`/`SLRU`/`Split` `FileCachePriority`,
`EvictionCandidates`, `Metadata`, `CacheUsage.h`, `FileCacheSettings`,
`FileSegment`, `CachedOnDiskReadBufferFromFile`,
`CachedOnDiskWriteBufferFromFile`, `StorageSystemFilesystemCache`,
`gtest_filecache`, the cache/distributed-cache entries in `FailPoint` and
`ProfileEvents`, and the corresponding public filesystem-cache tests.
`FilesystemCacheSettings` in `ReadSettings.h` gains `temp_cache_only`,
used by `CachedOnDiskReadBufferFromFile` for distributed-cache temporary
data.

The overcommit code paths that reference the private-only
`OvercommitFileCachePriority` are guarded by `#if ENABLE_DISTRIBUTED_CACHE`,
which is off in the public build, so this builds without the new files.

Make `DistributedCacheDefines.h` and `DistributedCacheSettings.h`
private-only: remove them here and guard every usage under
`#if ENABLE_DISTRIBUTED_CACHE`.
- `Settings.cpp`: guard the include; the `default_distributed_cache_*`
  constants use `DistributedCache::` under the macro and literal
  fallbacks otherwise.
- `ReadSettings.h`/`WriteSettings.h`: guard the include and the
  `distributed_cache_settings` member; include `Core/Types.h` directly
  (it was previously pulled in transitively via `DistributedCacheSettings.h`).
- `ReadPipeline.cpp` and `MergeTreeSequentialSource.cpp`: guard the two
  remaining unguarded `distributed_cache_settings` accesses.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [9c7f257]

Summary: ✅


AI Review

Summary

This PR syncs a large FileCache/distributed-cache change set from private code into the public tree, adds the new temp_cache_only cache-read mode, reworks invalidated-entry cleanup and dynamic-resize restore paths, introduces idle-client cache eviction plumbing, and guards the remaining distributed-cache-only includes/fields so the public build stays self-contained. I did not find a concrete correctness or safety regression in the public diff after tracing the changed cache state transitions and the new regression tests.

Missing context / blind spots
  • ⚠️ The new ENABLE_DISTRIBUTED_CACHE runtime branches cannot be exercised end-to-end from this public checkout because the private distributed-cache implementation and its CI coverage are not present here. A private build/test run is the main remaining gap.
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 2, 2026
@kssenii
kssenii force-pushed the sync-file-cache-changes branch from 6eda00e to 95d1bc4 Compare July 3, 2026 11:10
The module-level `cache_dynamic_resize_config` config string was removed
together with `test_readonly_cache` and
`test_no_background_download_for_metadata_files`, but `test_dynamic_resize`
and `test_dynamic_resize_disabled` still use it, tripping the `F821`
undefined-name style check. Restore the definition.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@kssenii
kssenii force-pushed the sync-file-cache-changes branch from 95d1bc4 to 9c7f257 Compare July 3, 2026 11:30
@clickhouse-gh

clickhouse-gh Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.60% 85.60% +0.00%
Functions 92.70% 92.70% +0.00%
Branches 77.80% 77.70% -0.10%

Changed lines: Changed C/C++ lines covered: 268/418 (64.11%) · Uncovered code

Full report · Diff report

@kssenii kssenii self-assigned this Jul 8, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

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

Every flagged query is an apparent improvement, and the deterministic gates already suppressed all of them: six sit inside master's current variance band and two are borderline with disagreeing tests. This PR only touches distributed-cache defaults and filesystem-cache eviction/write-through internals, none of which are on the ClickBench SELECT read path, so the consistent small speedups across Q4, Q15, Q18, Q28, Q32, Q33 and Q34 are a baseline/run-to-run shift rather than a PR effect. No action needed; the no-change verdicts are correct.

clickbench

⚠️ 2 inconclusive

Flagged queries (2 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 28 not_sure 1094 1032 -5.7% <0.0001 Marginal -5.7% with mixed signals from the two tests and a noisy history for this query; not attributable to the cache changes in this PR.
⚠️ 32 not_sure 1323 1251 -5.4% <0.0001 Borderline -5.4% with disagreeing tests; the PR only changes cache eviction/write-through code this SELECT does not run, so treat as variance.

Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: ee19e786-0cec-4ecf-899d-44e06739332d
  • MIRAI run: e882471d-9579-4144-a4b7-3a91616bed62
  • PR check IDs:
    • clickbench_177324_1783693852
    • clickbench_177337_1783693852
    • clickbench_177343_1783693852
    • tpch_adapted_1_official_177348_1783693852
    • tpch_adapted_1_official_177355_1783693852
    • tpch_adapted_1_official_177363_1783693852

@kssenii
kssenii added this pull request to the merge queue Jul 10, 2026
Merged via the queue into master with commit 6529bd4 Jul 10, 2026
343 of 344 checks passed
@kssenii
kssenii deleted the sync-file-cache-changes branch July 10, 2026 17:28
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 10, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants