Skip to content

Cherry pick #94262 to 25.3: Fix data race in DataPartStorageOnDiskBase::remove vs system.parts#94437

Merged
robot-ch-test-poll4 merged 4 commits intobackport/25.3/94262from
cherrypick/25.3/94262
Jan 16, 2026
Merged

Cherry pick #94262 to 25.3: Fix data race in DataPartStorageOnDiskBase::remove vs system.parts#94437
robot-ch-test-poll4 merged 4 commits intobackport/25.3/94262from
cherrypick/25.3/94262

Conversation

@robot-ch-test-poll4
Copy link
Copy Markdown
Contributor

Original pull-request #94262

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

alexey-milovidov and others added 4 commits January 14, 2026 22:32
The data race occurred between:
- Thread modifying part_dir in remove() after renaming directory
- Thread reading part_dir in getFullPath() from system.parts queries

The assignment to part_dir is unnecessary because:
- The 'to' variable is already computed and used for all subsequent operations
- The part is being removed, so the path doesn't need to be updated

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This test aims to trigger a race condition between:
- Reading system.parts table (calling getFullPath())
- Removing parts (calling remove() which modifies part_dir)

The test creates a table with minimal part lifetime, then runs
concurrent inserts, partition drops, and system.parts queries.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…remove

Fix data race in `DataPartStorageOnDiskBase::remove` vs `system.parts`
@robot-ch-test-poll4 robot-ch-test-poll4 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-critical-bugfix labels Jan 16, 2026
@robot-ch-test-poll4 robot-ch-test-poll4 merged commit 1dd9d2c into backport/25.3/94262 Jan 16, 2026
124 of 126 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 deleted the cherrypick/25.3/94262 branch January 16, 2026 21:14
@clickhouse-gh clickhouse-gh bot added the ready-for-backport PR is eligible for backporting (merged 7+ days ago, not reverted) label Mar 27, 2026
@maxknv maxknv removed the ready-for-backport PR is eligible for backporting (merged 7+ days ago, not reverted) label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants