Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Storages/MergeTree/DataPartStorageOnDiskBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,11 @@ void DataPartStorageOnDiskBase::remove(

try
{
/// Evaluate can_remove_callback before moving the directory so zero-copy reference checks
/// use the current (existing) path. We intentionally don't update part_dir to avoid races.
if (!can_remove_description)
can_remove_description.emplace(can_remove_callback());

disk->moveDirectory(from, to);
/// NOTE: we intentionally don't update part_dir here because it would cause a data race
/// with concurrent readers (e.g. system.parts table queries calling getFullPath()).
Expand Down
Loading