diff --git a/src/Storages/MergeTree/MergeTreeData.cpp b/src/Storages/MergeTree/MergeTreeData.cpp index 013118896aa..263c95bd68c 100644 --- a/src/Storages/MergeTree/MergeTreeData.cpp +++ b/src/Storages/MergeTree/MergeTreeData.cpp @@ -1851,7 +1851,7 @@ void MergeTreeData::removePartsFinally(const MergeTreeData::DataPartsVector & pa auto it = data_parts_by_info.find(part->info); if (it == data_parts_by_info.end()) - throw Exception("Deleting data part " + part->name + " doesn't exist", ErrorCodes::LOGICAL_ERROR); + throw Exception(ErrorCodes::LOGICAL_ERROR, "Deleting data part {} doesn't exist", part->name); (*it)->assertState({DataPartState::Deleting}); diff --git a/src/Storages/System/StorageSystemPartsColumns.cpp b/src/Storages/System/StorageSystemPartsColumns.cpp index 65b5af0c8e9..00b958b015f 100644 --- a/src/Storages/System/StorageSystemPartsColumns.cpp +++ b/src/Storages/System/StorageSystemPartsColumns.cpp @@ -193,9 +193,12 @@ void StorageSystemPartsColumns::processNextStorage( columns[res_index++]->insert(part->getDataPartStorage().getDiskName()); if (columns_mask[src_index++]) { - // The full path changes at clean up thread under deleting state, do not read it, avoid the race - if (part_state != State::Deleting) + /// The full path changes at clean up thread, so do not read it if parts can be deleted, avoid the race. + if (part->isStoredOnDisk() + && part_state != State::Deleting && part_state != State::DeleteOnDestroy && part_state != State::Temporary) + { columns[res_index++]->insert(part->getDataPartStorage().getFullPath()); + } else columns[res_index++]->insertDefault(); }