Skip to content

Carry the crc32c TSan fix onto v11.8.1 - #35

Merged
thevar1able merged 1 commit into
ClickHouse:ClickHouse/v11.8.1from
actueleai:ClickHouse/v11.8.1
Sep 8, 2026
Merged

thevar1able merged 1 commit into
ClickHouse:ClickHouse/v11.8.1from
actueleai:ClickHouse/v11.8.1

Conversation

@actueleai

Copy link
Copy Markdown

Cherry-picks dabb7ba ("Fix data race on pmull_runtime_flag in crc32c") from ClickHouse/v10.10.fb onto upstream tag v11.8.1. The patch turns the global bool pmull_runtime_flag in util/crc32c.cc / util/crc32c_arm64.cc into an std::atomic<bool>, fixing the TSan report seen when several RocksDB instances are opened concurrently (ClickHouse commit 4bb21056e6). It applied without conflicts; upstream v11.8.1 does not contain an equivalent fix.

Once merged, ClickHouse's contrib/rocksdb submodule is bumped to this branch head.

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) <noreply@anthropic.com>
(cherry picked from commit dabb7ba)
@thevar1able
thevar1able merged commit 7d4d932 into ClickHouse:ClickHouse/v11.8.1 Sep 8, 2026
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 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants