mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Merge pull request #57553 from evillique/fix-local-crash
Fix crash in clickhouse-local
This commit is contained in:
commit
c5e52d260f
@ -4811,7 +4811,7 @@ void Context::initializeBackgroundExecutorsIfNeeded()
|
||||
shared->are_background_executors_initialized = true;
|
||||
}
|
||||
|
||||
bool Context::areBackgroundExecutorsInitialized()
|
||||
bool Context::areBackgroundExecutorsInitialized() const
|
||||
{
|
||||
SharedLockGuard lock(shared->background_executors_mutex);
|
||||
return shared->are_background_executors_initialized;
|
||||
|
@ -1202,7 +1202,7 @@ public:
|
||||
|
||||
/// Background executors related methods
|
||||
void initializeBackgroundExecutorsIfNeeded();
|
||||
bool areBackgroundExecutorsInitialized();
|
||||
bool areBackgroundExecutorsInitialized() const;
|
||||
|
||||
MergeMutateBackgroundExecutorPtr getMergeMutateExecutor() const;
|
||||
OrdinaryBackgroundExecutorPtr getMovesExecutor() const;
|
||||
|
@ -46,17 +46,20 @@ void StorageSystemServerSettings::fillData(MutableColumns & res_columns, Context
|
||||
{"max_concurrent_insert_queries", std::to_string(context->getProcessList().getMaxInsertQueriesAmount())},
|
||||
{"max_concurrent_select_queries", std::to_string(context->getProcessList().getMaxSelectQueriesAmount())},
|
||||
|
||||
{"background_pool_size", std::to_string(context->getMergeMutateExecutor()->getMaxThreads())},
|
||||
{"background_move_pool_size", std::to_string(context->getMovesExecutor()->getMaxThreads())},
|
||||
{"background_fetches_pool_size", std::to_string(context->getFetchesExecutor()->getMaxThreads())},
|
||||
{"background_common_pool_size", std::to_string(context->getCommonExecutor()->getMaxThreads())},
|
||||
|
||||
{"background_buffer_flush_schedule_pool_size", std::to_string(CurrentMetrics::get(CurrentMetrics::BackgroundBufferFlushSchedulePoolSize))},
|
||||
{"background_schedule_pool_size", std::to_string(CurrentMetrics::get(CurrentMetrics::BackgroundSchedulePoolSize))},
|
||||
{"background_message_broker_schedule_pool_size", std::to_string(CurrentMetrics::get(CurrentMetrics::BackgroundMessageBrokerSchedulePoolSize))},
|
||||
{"background_distributed_schedule_pool_size", std::to_string(CurrentMetrics::get(CurrentMetrics::BackgroundDistributedSchedulePoolSize))}
|
||||
};
|
||||
|
||||
if (context->areBackgroundExecutorsInitialized())
|
||||
{
|
||||
updated.insert({"background_pool_size", std::to_string(context->getMergeMutateExecutor()->getMaxThreads())});
|
||||
updated.insert({"background_move_pool_size", std::to_string(context->getMovesExecutor()->getMaxThreads())});
|
||||
updated.insert({"background_fetches_pool_size", std::to_string(context->getFetchesExecutor()->getMaxThreads())});
|
||||
updated.insert({"background_common_pool_size", std::to_string(context->getCommonExecutor()->getMaxThreads())});
|
||||
}
|
||||
|
||||
const auto & config = context->getConfigRef();
|
||||
ServerSettings settings;
|
||||
settings.loadSettingsFromConfig(config);
|
||||
|
7
tests/queries/0_stateless/02933_local_system_setting.sh
Executable file
7
tests/queries/0_stateless/02933_local_system_setting.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
$CLICKHOUSE_LOCAL -q "select * from system.server_settings format Null;"
|
Loading…
Reference in New Issue
Block a user