Repository navigation
Fix data races in profile events and memory tracker - #112466
Conversation
|
Workflow [PR], commit [62855e8] Summary: ❌
AI ReviewSummaryThis PR switches the Findings❌ Blockers
Final Verdict❌ Changes requested. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 79/80 (98.75%) · Uncovered code |
|
Exactly the same applies to Thread A code: ClickHouse/src/Interpreters/ProcessList.cpp Lines 290 to 305 in 4eb43eb Thread B can be:
Memory tracker is a very hot path, so I evaluated the performance impact. Acquire-release costs 0 vs relaxed on x86 (exact same instructions) and should not cost much on ARM in our use case, according to Claude's analysis: https://pastila.clickhouse.com/?0017eb48/ff68c429ee04b7443f452a37e70d9c58#EnrE2yCkbifettLX+SLeDw==GCM. Added a performance label to confirm there are no degradations. |
|
📊 Cloud Performance Report ✅ AI verdict: This PR is a correctness-only change: it upgrades the parent-pointer atomics in the memory tracker and profile-event counters from relaxed to acquire/release ordering, plus adds concurrency tests. That path runs on every allocation and counter increment, but the ordering change is effectively runtime-neutral, so it cannot plausibly produce the isolated -13.7% improvement flagged on clickbench Q17 — I downgraded that to not_sure as run-to-run variance. Q18's -7.6% correctly stayed no_change inside master's normal variance band. No real performance shift is attributable to this diff. clickbenchFlagged queries (1 of 43)
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
|
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 45/45 (100.00%) · Uncovered code |
Michicosun
left a comment
There was a problem hiding this comment.
LGTM, interesting that on a hot path (increment) seq-cst was left.
You're right, I overlooked that, fixed now. |
|
Bugfix validation is run against a UB + Address sanitizer build - which cannot catch this bug. I checked manually, TSan reliably produces 50/50 red before, 50/50 green after. @groeneai, please check other failing tests and provide a report. |
|
Report on the reds at
On the three hung checks: in all three, process-list Row 1 is I checked whether it is specific to your diff by pulling the One caveat on my own numbers, in case you try to reproduce them: CIDB's So the only thing on this list attributable to the PR is the unit-validator verdict, and that is the job being blind to races rather than a problem with your test. Report URLs: amd_tsan, arm_release, arm_debug. |
Backport #112466 to 26.7: Fix data races in profile events and memory tracker
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix data races in profile events and memory tracker.
Version info
26.8.1.1253(included in26.8and later)26.7.4.23