Repository navigation
Fix data race on pmull_runtime_flag in crc32c - #29
Merged
alexey-milovidov merged 1 commit intoApr 10, 2026
Merged
Conversation
The global `bool pmull_runtime_flag` is written from `IsFastCrc32Supported` and `Choose_Extend` without synchronization, causing a TSan report when multiple RocksDB instances are opened concurrently. Make it `std::atomic<bool>` with relaxed ordering, since it is always set to the same value. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 task
alexey-milovidov
added a commit
to ClickHouse/ClickHouse
that referenced
this pull request
Apr 12, 2026
The global `bool pmull_runtime_flag` is written from `IsFastCrc32Supported` and `Choose_Extend` without synchronization, causing a TSan report when multiple RocksDB instances are opened concurrently. The fix makes it `std::atomic<bool>` with relaxed ordering, since it is always set to the same value. ClickHouse/rocksdb#29 https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=72bdd3a2f384f33510436950ddfd79288573165d&name_0=MasterCI&name_1=Stress%20test%20%28arm_tsan%29 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Member
alexey-milovidov
pushed a commit
to original-brownbear/ClickHouse
that referenced
this pull request
Sep 21, 2026
The submodule now points to `ClickHouse/v11.8.1` in the ClickHouse fork (ClickHouse/rocksdb#35), which is upstream tag `v11.8.1` plus the existing ClickHouse patch that makes `pmull_runtime_flag` in `crc32c` a `std::atomic<bool>` (TSan fix from ClickHouse/rocksdb#29), exactly as the previous `ClickHouse/v10.10.fb` pin did. Adaptations: - `contrib/rocksdb-cmake/CMakeLists.txt`: add the 13 library sources that upstream added to `LIB_SOURCES` between v10.10.1 and v11.8.1 (blob partition manager, blob gen2 format, blob write batch transformer, `version_util`, read-path blob resolver, multi-scan index iterator, coroutine stats and I/O dispatcher, copy engine, sorted run builder, trie index). - `StorageEmbeddedRocksDB`: RocksDB 11.0 removed the raw `DB *` overloads of `DB::Open` and `DB::OpenForReadOnly`; use the `std::unique_ptr<DB>` overloads instead. Co-Authored-By: Claude Fable 5.1 <[email protected]>
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 global
bool pmull_runtime_flagis written fromIsFastCrc32SupportedandChoose_Extendwithout synchronization, causing a TSan report when multiple RocksDB instances are opened concurrently. Make itstd::atomic<bool>with relaxed ordering, since it is always set to the same value.