make that old_parts_lifetime=0 deletes files instantly at drop/truncate

This commit is contained in:
Sema Checherinda 2023-01-12 16:14:43 +01:00
parent 8218d59103
commit 90fa1ecd49
2 changed files with 1 additions and 3 deletions

View File

@ -2021,7 +2021,7 @@ MergeTreeData::DataPartsVector MergeTreeData::grabOldParts(bool force)
}
auto part_remove_time = part->remove_time.load(std::memory_order_relaxed);
bool reached_removal_time = part_remove_time < time_now && time_now - part_remove_time > getSettings()->old_parts_lifetime.totalSeconds();
bool reached_removal_time = part_remove_time <= time_now && time_now - part_remove_time >= getSettings()->old_parts_lifetime.totalSeconds();
if ((reached_removal_time && !has_skipped_mutation_parent(part))
|| force
|| isInMemoryPart(part) /// Remove in-memory parts immediately to not store excessive data in RAM

View File

@ -1478,8 +1478,6 @@ void StorageMergeTree::dropPartNoWaitNoThrow(const String & part_name)
part.reset();
clearOldPartsFromFilesystem();
LOG_INFO(log, "Removed part {}.", part_name);
}
/// Else nothing to do, part was removed in some different way