Repository navigation
Fix TSan data race in Keeper AuthID between preprocess and commit - #100396
Merged
Merged
Conversation
The `AddAuthDelta` stores a `shared_ptr<AuthID>` that is shared between the delta and the uncommitted state. During `commit`, the code was move-constructing from this shared `AuthID` via `std::move(*operation.auth_id)`, which could race with a concurrent `preprocess` call reading the same `AuthID` through `uncommitted_state.session_and_auth` without holding `auth_mutex`. Fix by copying instead of moving. https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=3134af4b1eeebf8773015eb04eb1aa1a80bd2f17&name_0=MasterCI&name_1=Integration%20tests%20%28amd_tsan%2C%206%2F6%29 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [9785e40] Summary: ✅ AI ReviewSummaryThis PR fixes a real TSan race in Keeper auth handling by replacing a move from shared ClickHouse Rules
Final Verdict
|
antonio2368
approved these changes
Mar 23, 2026
1 task
Contributor
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 100.00% (4/4, 0 noise lines excluded) |
alexey-milovidov
added a commit
that referenced
this pull request
Jul 1, 2026
Backport #100396 to 25.8: Fix TSan data race in Keeper AuthID between preprocess and commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
AddAuthDeltastores ashared_ptr<AuthID>that is shared between the delta and the uncommitted state. Duringcommit, the code was move-constructing from this sharedAuthIDviastd::move(*operation.auth_id), which could race with a concurrentpreprocesscall reading the sameAuthIDthroughuncommitted_state.session_and_authwithout holdingauth_mutex.Fix by copying instead of moving.
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=3134af4b1eeebf8773015eb04eb1aa1a80bd2f17&name_0=MasterCI&name_1=Integration%20tests%20%28amd_tsan%2C%206%2F6%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.4.1.191(included in26.4and later)25.8.26.6