Repository navigation
Fix race condition in Parquet reader accessing next_subgroup_for_step - #95068
Merged
alexey-milovidov merged 3 commits intoJan 25, 2026
Merged
Conversation
There was a data race between: - Thread A assigning a new vector to `row_group.next_subgroup_for_step` in `intersectColumnIndexResultsAndInitSubgroups` - Thread B reading `row_group.next_subgroup_for_step.empty()` in the `is_privileged_task` lambda in `scheduleTasksIfNeeded` The fix adds a stage check before accessing the vector. Since `next_subgroup_for_step` is assigned during `OffsetIndex` processing and the stage advances to `ColumnData` only after the assignment, checking `stage >= ColumnData` with acquire ordering ensures proper synchronization. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
|
Workflow [PR], commit [011c698] Summary: ❌
|
This test creates a parquet file with many small row groups and reads it multiple times to increase the chance of triggering the race condition between `intersectColumnIndexResultsAndInitSubgroups` (which assigns to `next_subgroup_for_step`) and `scheduleTasksIfNeeded` (which reads it). The race is most likely to be caught with ThreadSanitizer. Co-Authored-By: Claude Opus 4.5 <[email protected]>
…rquet-race-next-subgroup-for-step
This was referenced Jan 25, 2026
This was referenced Apr 8, 2026
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.
There was a data race between:
row_group.next_subgroup_for_stepinintersectColumnIndexResultsAndInitSubgroupsrow_group.next_subgroup_for_step.empty()in theis_privileged_tasklambda inscheduleTasksIfNeededThe fix adds a stage check before accessing the vector. Since
next_subgroup_for_stepis assigned duringOffsetIndexprocessing and the stage advances toColumnDataonly after the assignment, checkingstage >= ColumnDatawith acquire ordering ensures proper synchronization.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a rare race condition in the Parquet reader.
See https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=95064&sha=701bbbbe6dab5dd19df5195bba04dfc21921a901&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%201%2F2%29
#95064
Version info
26.1.1.845