Repository navigation
Fix Shared Snapshot Parts Pin - #112991
Conversation
|
Workflow [PR], commit [c0e7e4f] Summary: ✅
AI ReviewSummaryThis PR makes PR Metadata
Findings
Final Verdict
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 53/54 (98.15%) · Uncovered code |
azat
left a comment
There was a problem hiding this comment.
I guess it also make sense to remove this note -
ClickHouse/src/Core/Settings.cpp
Lines 5996 to 5998 in bf681dd
|
📊 Cloud Performance Report ✅ AI verdict: 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
|
|
|
||
| Without this setting, the outer and inner queries may operate on different data snapshots, leading to incorrect results. | ||
|
|
||
| :::note |
There was a problem hiding this comment.
Removing this note is broader than the evidence in the PR. ReadFromMergeTree now strips parts from every shared snapshot, but the new regression only proves mid-query cleanup for ... STREAM.
We still need a focused non-stream case with enable_shared_storage_snapshot_in_query = 1 (for example, an ordinary same-table subquery that keeps running while obsolete parts are cleaned up) before dropping the warning for the setting entirely. Otherwise the setting can still regress the storage-pressure behavior this note is warning users about and we would not notice.
… inserts When a block is inserted into a table with materialized views, the SELECT of every view is analyzed with the real source table, and only afterwards the table is replaced by the inserted block in `replaceStorageInQueryTree`. The analyzer resolved the source table through `getStorageSnapshot`, which for `MergeTree` collects all active parts and the mutations snapshot. The result was thrown away, so the cost, proportional to the number of active parts multiplied by the number of views, was wasted on every inserted block. The per-query snapshot cache of `enable_shared_storage_snapshot_in_query` could not mitigate this: the async insert flush never attaches it, and since ClickHouse#112991 it is no longer kept alive during pipeline execution, when the views are processed, for synchronous inserts either. Now `IdentifierResolver::tryResolveTableIdentifier` uses `getStorageSnapshotWithoutData` when the context carries a view source with the same name as the resolved table, exactly the condition under which the table is later replaced by the block. The snapshot is only used for metadata and column resolution in this case. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
This patch removes metadata cache from BlockIO.
Version info
26.8.1.716(included in26.8and later)