mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #49365 from ClickHouse/ttl_on_insert
Fix bug in removal of existing part directory
This commit is contained in:
commit
96d2482bff
@ -463,6 +463,7 @@ void DataPartStorageOnDiskBase::rename(
|
||||
|
||||
if (volume->getDisk()->exists(to))
|
||||
{
|
||||
/// FIXME it should be logical error
|
||||
if (remove_new_dir_if_exists)
|
||||
{
|
||||
Names files;
|
||||
@ -473,7 +474,8 @@ void DataPartStorageOnDiskBase::rename(
|
||||
"Part directory {} already exists and contains {} files. Removing it.",
|
||||
fullPath(volume->getDisk(), to), files.size());
|
||||
|
||||
executeWriteOperation([&](auto & disk) { disk.removeRecursive(to); });
|
||||
/// Do not remove blobs if they exist
|
||||
executeWriteOperation([&](auto & disk) { disk.removeSharedRecursive(to, true, {}); });
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1330,6 +1330,11 @@ void StorageReplicatedMergeTree::checkParts(bool skip_sanity_checks)
|
||||
uncovered_unexpected_parts.size(), uncovered_unexpected_parts_rows, unexpected_parts_nonnew, unexpected_parts_nonnew_rows,
|
||||
parts_to_fetch.size(), parts_to_fetch_blocks, covered_unexpected_parts.size(), unexpected_parts_rows - uncovered_unexpected_parts_rows);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!parts_to_fetch.empty())
|
||||
LOG_DEBUG(log, "Found parts to fetch (exist in zookeeper, but not locally): [{}]", fmt::join(parts_to_fetch, ", "));
|
||||
}
|
||||
|
||||
/// Add to the queue jobs to pick up the missing parts from other replicas and remove from ZK the information that we have them.
|
||||
queue.setBrokenPartsToEnqueueFetchesOnLoading(std::move(parts_to_fetch));
|
||||
|
Loading…
Reference in New Issue
Block a user