Repository navigation
Backport #111103 to 26.5: Cache deduplication data hashes before the Alias hop - #112722
Conversation
|
Workflow [BackportPR], commit [066e5c4] Summary: ✅ |
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=112722&sha=21ba2dbcf7a5d9e1a4f1e1357677f5429f121040&name_0=BackportPR&name_1=Integration%20tests%20%28amd_tsan%2C%203%2F6%29 and provide a fix in a separate PR. If the fix is already in progress, link it here. The failure is unrelated to this backport (which only touches This is exactly what #112695 ("Fix the ineffective TSAN suppression in |
|
The fix on master is #112695 (merged 2026-07-31 16:57:30Z). No backport exists yet: it is labelled The affected set is exactly 26.5, 26.6 and 26.7. The carrier needs One correction, and it makes the backport simpler than you described. #107083 is not on 26.5, 26.6 or 26.7 either: A straight cherry-pick does not apply. Efficacy on master since the merge: 0 occurrences of that signature across 172 distinct TSan integration builds, against 15 in the 30 days before it. I will open one pull request per branch for 26.5, 26.6 and 26.7 and link them here. Tell me if you would rather limit it to 26.5 and 26.6, where the signature is actually observed. |
|
26.5 is open: #112899. It is additive, as described above: the hook goes beside the existing What I verified before opening it, since the race itself is not reproducible on demand and the only end-to-end oracle is the TSan shards going quiet:
26.6 and 26.7 are still to come, one pull request each. Both take the master shape rather than 26.5's, since they do have Your question about narrowing is still open and I have not assumed an answer. If you would rather stop at 26.5 and 26.6, say so and I will drop 26.7. My reason for including it is structural rather than statistical: its queue header is md5-identical to 26.6's, which does have an observed hit, and with 58 TSan integration builds against master's rate of roughly 0.191% per build, a zero there is about 90% likely even if the branch is fully susceptible. So I read 26.7's zero as sample size, not immunity. |
|
26.6 is open: #112912. On this branch the hook goes into Two differences from the 26.5 pull request, both deliberate:
26.7 is next, and I will link it here. |
|
26.7 is open: #112916. That completes the set I promised: 26.5 #112899, 26.6 #112912, 26.7 #112916. 26.7 is the one branch where the signature has never been observed, so the case for it is structural rather than statistical: both carrier files are present with both explicit instantiations, and its copy of the queue header is md5-identical to 26.6's, which did see the failure. Like 26.6 it takes master's placement in One measurement worth passing on, since it changed my own numbers. Counting this failure by the harness line 26.4 and older lack the carrier files entirely, so nothing further is needed there. |
Backport of #112695 to 26.6, requested by alexey-milovidov on #112722. 26.6 still carries the defect and has no fix. `Integration tests (amd_tsan, N/6)` fails in teardown with `Sanitizer assert found for instance zoo<N>`, from a TSAN data race report between the `slot.value` write in `NonblockingBoundedQueue::tryPush` and the read in `tryPop`. The report is a false positive. The release/acquire handoff on `slot.pos` orders every access to a slot payload, and there is no non-protocol payload access anywhere in the class, so the code is isomorphic to Vyukov's original implementation. But `abort_on_error=1` in `__tsan_default_options` turns the report into an aborted Keeper node, so healthy runs go red. A `NO_SANITIZE_THREAD` attribute cannot suppress it. Neither `KeeperRequestForSession` nor `KeeperResponseForSession` declares an `operator=`, so the racing access happens in the implicitly generated move assignment, a separate function that keeps `sanitize_thread`. The attribute also prevents that un-attributed callee from being inlined into the attributed caller, which is what creates the frame split that defeats it. A runtime `__tsan_default_suppressions` entry is consulted for every frame of a report, so one entry covers the whole nested move chain. Register that hook with two anchored patterns for the two Keeper instantiations. Only `tryPush` is listed: the `dequeue_pos` compare-exchange gives one consumer sole ownership of a slot before the move-out in `tryPop`, so a pop/pop payload race cannot occur at any consumer count, and each `race:` entry also hides heap-use-after-free reports through the frame it names. Anchoring is load-bearing. Patterns are matched against each frame's function, file and module name, and `clickhouse-keeper-bench` is a symlink to the same binary, so an unqualified pattern would also silence its three unrelated `NonblockingBoundedQueue<QueueItem>` queues. Verified it does not. This is purely additive, unlike the master commit: #107083, which added the attributes master removes, was never backported to 26.6, so there is no attribute to strip here. A straight cherry-pick does not apply (`git apply --check` fails on both files); on 26.6 the hook goes in `base/base/sanitizer_options.h`, which is master's own placement, whereas the 26.5 sibling #112899 had to use `programs/main.cpp` because that header does not exist on 26.5. Non-sanitizer builds are unaffected: the hook is inside `#ifdef THREAD_SANITIZER` and the other change is a comment, so there is no codegen change and no performance impact. A suppression only affects whether TSAN prints or aborts on a report. No test, matching #112695. The only oracle is a CI-side absence property over many runs, which no functional test can assert. Co-Authored-By: Claude Fable 5 <[email protected]>
Original pull-request #111103
Cherry-pick pull-request #112583
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Version info
26.5.6.102