Skip to content

Commit

Permalink
consider overcommitment when checking for node overloads (#4588)
Browse files Browse the repository at this point in the history
  • Loading branch information
vporyadke committed May 16, 2024
1 parent da77179 commit 7a271ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ydb/core/mind/hive/hive_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 3 additions & 1 deletion ydb/core/mind/hive/node_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 7a271ce

Please sign in to comment.