From 8377878e7a9c6f6f5ffc743d605101102414bd05 Mon Sep 17 00:00:00 2001 From: Alexander Zalyalov Date: Thu, 16 May 2024 09:13:32 +0000 Subject: [PATCH] consider overcommitment when checking for node overloads --- ydb/core/mind/hive/hive_ut.cpp | 2 +- ydb/core/mind/hive/node_info.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ydb/core/mind/hive/hive_ut.cpp b/ydb/core/mind/hive/hive_ut.cpp index 3357e949e26a..01c23a9dc3f5 100644 --- a/ydb/core/mind/hive/hive_ut.cpp +++ b/ydb/core/mind/hive/hive_ut.cpp @@ -3937,7 +3937,7 @@ Y_UNIT_TEST_SUITE(THiveTest) { // static const int NUM_NODES = 4; static const int NUM_TABLETS = 3; - static const ui64 SINGLE_TABLET_NETWORK_USAGE = 5000000; + static const ui64 SINGLE_TABLET_NETWORK_USAGE = 15'000'000; TTestBasicRuntime runtime(NUM_NODES, false); diff --git a/ydb/core/mind/hive/node_info.cpp b/ydb/core/mind/hive/node_info.cpp index fbe913bcb7d1..864c917b0ecd 100644 --- a/ydb/core/mind/hive/node_info.cpp +++ b/ydb/core/mind/hive/node_info.cpp @@ -327,7 +327,9 @@ ui64 TNodeInfo::GetMaxCountForTabletType(TTabletTypes::EType tabletType) const { } bool TNodeInfo::IsOverloaded() const { - return GetNodeUsage() >= Hive.GetMaxNodeUsageToKick(); + auto maxValues = GetResourceMaximumValues() * Hive.GetResourceOvercommitment(); + auto normValues = NormalizeRawValues(GetResourceCurrentValues(), maxValues); + return GetNodeUsage(normValues) >= Hive.GetMaxNodeUsageToKick(); } bool TNodeInfo::BecomeConnected() {