Merge pull request #30412 from ClickHouse/kssenii-fix-test

Follow-up for #30282
This commit is contained in:
Kseniia Sumarokova 2021-10-21 12:48:10 +03:00 committed by GitHub
commit da0021c82f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -267,6 +267,9 @@ struct ContextSharedPart
bool shutdown_called = false;
/// Has background executors for MergeTree tables been initialized?
bool is_background_executors_initialized = false;
Stopwatch uptime_watch;
Context::ApplicationType application_type = Context::ApplicationType::SERVER;
@ -2974,7 +2977,7 @@ void Context::setAsynchronousInsertQueue(const std::shared_ptr<AsynchronousInser
void Context::initializeBackgroundExecutorsIfNeeded()
{
auto lock = getLock();
if (is_background_executors_initialized)
if (shared->is_background_executors_initialized)
return;
const size_t max_merges_and_mutations = getSettingsRef().background_pool_size * getSettingsRef().background_merges_mutations_concurrency_ratio;
@ -3024,7 +3027,7 @@ void Context::initializeBackgroundExecutorsIfNeeded()
LOG_INFO(shared->log, "Initialized background executor for common operations (e.g. clearing old parts) with num_threads={}, num_tasks={}",
getSettingsRef().background_common_pool_size, getSettingsRef().background_common_pool_size);
is_background_executors_initialized = true;
shared->is_background_executors_initialized = true;
}

View File

@ -293,8 +293,6 @@ private:
/// A flag, used to distinguish between user query and internal query to a database engine (MaterializedPostgreSQL).
bool is_internal_query = false;
/// Has initializeBackgroundExecutors() method been executed?
bool is_background_executors_initialized = false;
public: