Do not use c-style cast for std::min(max_part_removal_threads)

This commit is contained in:
Azat Khuzhin 2021-04-11 12:22:39 +03:00
parent 2061e581e6
commit 940ff6cb76
2 changed files with 2 additions and 2 deletions

View File

@ -1213,7 +1213,7 @@ void MergeTreeData::clearPartsFromFilesystem(const DataPartsVector & parts_to_re
{ {
/// Parallel parts removal. /// Parallel parts removal.
size_t num_threads = std::min(size_t(settings->max_part_removal_threads), parts_to_remove.size()); size_t num_threads = std::min<size_t>(settings->max_part_removal_threads, parts_to_remove.size());
ThreadPool pool(num_threads); ThreadPool pool(num_threads);
/// NOTE: Under heavy system load you may get "Cannot schedule a task" from ThreadPool. /// NOTE: Under heavy system load you may get "Cannot schedule a task" from ThreadPool.

View File

@ -5708,7 +5708,7 @@ void StorageReplicatedMergeTree::removePartsFromFilesystem(const DataPartsVector
{ {
/// Parallel parts removal. /// Parallel parts removal.
size_t num_threads = std::min(size_t(settings->max_part_removal_threads), parts.size()); size_t num_threads = std::min<size_t>(settings->max_part_removal_threads, parts.size());
ThreadPool pool(num_threads); ThreadPool pool(num_threads);
/// NOTE: Under heavy system load you may get "Cannot schedule a task" from ThreadPool. /// NOTE: Under heavy system load you may get "Cannot schedule a task" from ThreadPool.