mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
fix possible deadlock
This commit is contained in:
parent
df6b4c4372
commit
a7bbf02bac
@ -3825,9 +3825,9 @@ void Context::initializeBackgroundExecutorsIfNeeded()
|
||||
"MergeMutate",
|
||||
/*max_threads_count*/background_pool_size,
|
||||
/*max_tasks_count*/background_pool_size * background_merges_mutations_concurrency_ratio,
|
||||
CurrentMetrics::BackgroundMergesAndMutationsPoolTask
|
||||
CurrentMetrics::BackgroundMergesAndMutationsPoolTask,
|
||||
background_merges_mutations_scheduling_policy
|
||||
);
|
||||
shared->merge_mutate_executor->updateSchedulingPolicy(background_merges_mutations_scheduling_policy);
|
||||
LOG_INFO(shared->log, "Initialized background executor for merges and mutations with num_threads={}, num_tasks={}, scheduling_policy={}",
|
||||
background_pool_size, background_pool_size * background_merges_mutations_concurrency_ratio, background_merges_mutations_scheduling_policy);
|
||||
|
||||
|
@ -267,6 +267,18 @@ public:
|
||||
pool.scheduleOrThrowOnError([this] { threadFunction(); });
|
||||
}
|
||||
|
||||
MergeTreeBackgroundExecutor(
|
||||
String name_,
|
||||
size_t threads_count_,
|
||||
size_t max_tasks_count_,
|
||||
CurrentMetrics::Metric metric_,
|
||||
std::string_view policy)
|
||||
requires requires(Queue queue) { queue.updatePolicy(policy); } // Because we use explicit template instantiation
|
||||
: MergeTreeBackgroundExecutor(name_, threads_count_, max_tasks_count_, metric_)
|
||||
{
|
||||
pending.updatePolicy(policy);
|
||||
}
|
||||
|
||||
~MergeTreeBackgroundExecutor()
|
||||
{
|
||||
wait();
|
||||
|
Loading…
Reference in New Issue
Block a user