Repository navigation
Find bad usage of storage in-memory metadata - #106200
Conversation
|
Workflow [PR], commit [4a4f69a] Summary: ❌
AI ReviewSummaryThis PR replaces direct Final VerdictStatus: ✅ Approve |
|
The text index drops metadata when a reference to it is used. |
|
📊 Cloud Performance Report 🟢 AI verdict: This is a broad refactor that swaps heavyweight metadata pointers for lighter handles and caches metadata within a query, touching the setup path that every query runs through. Three ClickBench queries (Q15, Q18, Q28) show consistent small improvements (-5% to -11.5%), which matches what cheaper metadata handling in query analysis/setup would produce; the execution hot paths are untouched. Q15's larger -11.5% delta is partly inflated by a recent slowdown trend on the base branch, so treat its magnitude with some caution. No regressions were flagged. clickbench🟢 2 improved · Flagged queries (3 of 43)
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
|
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 857/1034 (82.88%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 70 line(s) · Uncovered code |
`MergeTreeData::getInMemoryMetadataPtr` deep-copied the whole `StorageInMemoryMetadata` on every call in debug and sanitizer builds, so that a reference kept after its metadata pointer was dropped became a use-after-free under ASan. With the bucketed `system.metric_log` schema every copy clones thousands of `ALIAS` default ASTs, a large part of why `03540_system_dashboards` is slow on the sanitizer lanes. The copy was added together with `StorageMetadataHandle` in ClickHouse#106200, and the handle already rejects the common misuse, a reference taken through a temporary handle, at compile time. Removing the copy is simpler than making it cheaper, so this drops it and reverts the AST-sharing copies of the previous two commits, as asked in review. Dashboards probe (debug, 166 dashboards x 3 variants, sum of query durations, min of 2, same base): - bucketed: base 24.57 s, AST sharing 21.50 s, copy removed 20.06 s - wide: base 13.36 s, AST sharing 13.23 s, copy removed 11.99 s Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
There is no guarantee that metadata will outlive the query if the pointer is dropped early. Let's find all the places here.
Version info
26.6.1.1067