Fix race on Outdated parts loading (#49223)

This commit is contained in:
Alexander Tokmakov 2023-04-27 14:52:09 +03:00 committed by GitHub
parent f67bf699a7
commit fc9b2fbac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3948,6 +3948,9 @@ void MergeTreeData::forcefullyMovePartToDetachedAndRemoveFromMemory(const MergeT
else
LOG_INFO(log, "Renaming {} to {}_{} and forgetting it.", part_to_detach->getDataPartStorage().getPartDirectory(), prefix, part_to_detach->name);
if (restore_covered)
waitForOutdatedPartsToBeLoaded();
auto lock = lockParts();
bool removed_active_part = false;
bool restored_active_part = false;