From d364cd067f4928aae2ff8b3cdee47b3495172e39 Mon Sep 17 00:00:00 2001 From: serxa Date: Wed, 31 May 2023 18:08:03 +0000 Subject: [PATCH] fix `system.async_loader` --- .../System/StorageSystemAsyncLoader.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Storages/System/StorageSystemAsyncLoader.cpp b/src/Storages/System/StorageSystemAsyncLoader.cpp index 1535657c5ec..32e70d31141 100644 --- a/src/Storages/System/StorageSystemAsyncLoader.cpp +++ b/src/Storages/System/StorageSystemAsyncLoader.cpp @@ -56,8 +56,9 @@ NamesAndTypesList StorageSystemAsyncLoader::getNamesAndTypes() { "is_blocked", std::make_shared() }, { "is_ready", std::make_shared() }, { "elapsed", std::make_shared()}, + { "pool_id", std::make_shared() }, + { "pool", std::make_shared() }, { "priority", std::make_shared() }, - { "initial_priority", std::make_shared(std::make_shared()) }, { "ready_seqno", std::make_shared(std::make_shared()) }, { "waiters", std::make_shared() }, { "exception", std::make_shared(std::make_shared()) }, @@ -72,7 +73,9 @@ void StorageSystemAsyncLoader::fillData(MutableColumns & res_columns, ContextPtr { TimePoint now = std::chrono::system_clock::now(); - for (const auto & state : context->getAsyncLoader().getJobStates()) + AsyncLoader & async_loader = context->getAsyncLoader(); + + for (const auto & state : async_loader.getJobStates()) { Array dependencies; @@ -86,13 +89,9 @@ void StorageSystemAsyncLoader::fillData(MutableColumns & res_columns, ContextPtr TimeDuration elapsed = started != TimePoint{} ? last - started : TimeDuration{0}; double elapsed_sec = std::chrono::duration_cast(elapsed).count() * 1e-9; - Field initial_priority; - if (state.initial_priority) - initial_priority = *state.initial_priority; - Field ready_seqno; if (state.ready_seqno) - ready_seqno = *state.ready_seqno; + ready_seqno = state.ready_seqno; Field exception; if (state.job->exception()) @@ -120,8 +119,9 @@ void StorageSystemAsyncLoader::fillData(MutableColumns & res_columns, ContextPtr res_columns[i++]->insert(state.is_blocked); res_columns[i++]->insert(state.is_ready); res_columns[i++]->insert(elapsed_sec); - res_columns[i++]->insert(state.job->priority()); - res_columns[i++]->insert(initial_priority); + res_columns[i++]->insert(state.job->pool()); + res_columns[i++]->insert(async_loader.getPoolName(state.job->pool())); + res_columns[i++]->insert(async_loader.getPoolPriority(state.job->pool()).value); res_columns[i++]->insert(ready_seqno); res_columns[i++]->insert(state.job->waitersCount()); res_columns[i++]->insert(exception);