From d0201eadb3c8fb46e1ff448fff673f68bd6f8a50 Mon Sep 17 00:00:00 2001 From: Alexander Zalyalov Date: Thu, 11 Jan 2024 19:16:43 +0000 Subject: [PATCH] disable warmup for root hive --- ydb/core/mind/hive/hive_ut.cpp | 4 +++- ydb/core/mind/hive/tx__load_everything.cpp | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ydb/core/mind/hive/hive_ut.cpp b/ydb/core/mind/hive/hive_ut.cpp index 984674a3989b..b28ee8db4b96 100644 --- a/ydb/core/mind/hive/hive_ut.cpp +++ b/ydb/core/mind/hive/hive_ut.cpp @@ -4163,7 +4163,9 @@ Y_UNIT_TEST_SUITE(THiveTest) { static const int NUM_TABLETS = NUM_NODES * TABLETS_PER_NODE; TTestBasicRuntime runtime(NUM_NODES, false); - Setup(runtime, true); + Setup(runtime, true, 1, [](TAppPrepare& app) { + app.HiveConfig.SetWarmUpEnabled(true); + }); const int nodeBase = runtime.GetNodeId(0); TActorId senderA = runtime.AllocateEdgeActor(); const ui64 hiveTablet = MakeDefaultHiveID(0); diff --git a/ydb/core/mind/hive/tx__load_everything.cpp b/ydb/core/mind/hive/tx__load_everything.cpp index 7818698a123f..9b8b05ae9b12 100644 --- a/ydb/core/mind/hive/tx__load_everything.cpp +++ b/ydb/core/mind/hive/tx__load_everything.cpp @@ -181,7 +181,11 @@ class TTxLoadEverything : public TTransactionBase { } Self->BuildCurrentConfig(); - Self->WarmUp = Self->CurrentConfig.GetWarmUpEnabled(); + if (Self->CurrentConfig.HasWarmUpEnabled()) { + Self->WarmUp = Self->CurrentConfig.GetWarmUpEnabled(); + } else { + Self->WarmUp = Self->CurrentConfig.GetWarmUpEnabled() && !Self->AreWeRootHive(); + } Self->DefaultResourceMetricsAggregates.MaximumCPU.SetWindowSize(TDuration::MilliSeconds(Self->GetMetricsWindowSize())); Self->DefaultResourceMetricsAggregates.MaximumMemory.SetWindowSize(TDuration::MilliSeconds(Self->GetMetricsWindowSize()));