summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvporyadke <[email protected]>2025-11-07 12:06:40 +0100
committerGitHub <[email protected]>2025-11-07 12:06:40 +0100
commit0e4fe680454591b8d93c6891a726ecbf4533d10c (patch)
tree780fefd748622eb97a9d165682c5bc3909691a06
parent3c63951faf7b212d0097f45457eb67f9f8f4f2a4 (diff)
make storage balancer async and turned on (#28244)
Co-authored-by: Copilot <[email protected]>
-rw-r--r--ydb/core/mind/hive/hive_ut.cpp7
-rw-r--r--ydb/core/mind/hive/storage_balancer.cpp1
-rw-r--r--ydb/core/protos/config.proto6
3 files changed, 11 insertions, 3 deletions
diff --git a/ydb/core/mind/hive/hive_ut.cpp b/ydb/core/mind/hive/hive_ut.cpp
index 3cf9b5f5e17..feec5c767c6 100644
--- a/ydb/core/mind/hive/hive_ut.cpp
+++ b/ydb/core/mind/hive/hive_ut.cpp
@@ -3392,6 +3392,8 @@ Y_UNIT_TEST_SUITE(THiveTest) {
const ui64 testerTablet = MakeTabletID(false, 1);
CreateTestBootstrapper(runtime, CreateTestTabletInfo(hiveTablet, TTabletTypes::Hive), &CreateDefaultHive);
+ auto syncReassign = runtime.AddObserver<TEvHive::TEvReassignTablet>([] (auto&& ev) { ev->Get()->Record.SetAsync(false); });
+
TTabletTypes::EType tabletType = TTabletTypes::Dummy;
TVector<ui64> tablets;
for (ui64 i = 0; i < NUM_TABLETS; ++i) {
@@ -9053,6 +9055,11 @@ Y_UNIT_TEST_SUITE(TStorageBalanceTest) {
OnBootTablet(info);
return TTestActorRuntime::EEventAction::PROCESS;
}
+ case TEvHive::EvReassignTablet: {
+ auto& record = ev->Get<TEvHive::TEvReassignTablet>()->Record;
+ record.SetAsync(false);
+ return TTestActorRuntime::EEventAction::PROCESS;
+ }
}
return TTestActorRuntime::EEventAction::PROCESS;
};
diff --git a/ydb/core/mind/hive/storage_balancer.cpp b/ydb/core/mind/hive/storage_balancer.cpp
index 0687c7cad1a..db9a75be88f 100644
--- a/ydb/core/mind/hive/storage_balancer.cpp
+++ b/ydb/core/mind/hive/storage_balancer.cpp
@@ -177,6 +177,7 @@ public:
if (!ev) {
ev = std::make_unique<TEvHive::TEvReassignTablet>(channel.TabletId);
ev->Record.SetReassignReason(NKikimrHive::TEvReassignTablet::HIVE_REASSIGN_REASON_BALANCE);
+ ev->Record.SetAsync(true);
}
ev->Record.AddChannels(channel.ChannelId);
}
diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto
index 188b32ef69f..3e24b45ce06 100644
--- a/ydb/core/protos/config.proto
+++ b/ydb/core/protos/config.proto
@@ -2251,10 +2251,10 @@ message THiveConfig {
reserved 66;
optional double ObjectImbalanceToBalance = 67 [default = 0.02];
optional EHiveChannelBalanceStrategy ChannelBalanceStrategy = 68 [default = HIVE_CHANNEL_BALANCE_STRATEGY_WEIGHTED_RANDOM];
- optional uint64 MaxChannelHistorySize = 69 [default = 200];
+ optional uint64 MaxChannelHistorySize = 69 [default = 10];
optional uint64 StorageInfoRefreshFrequency = 70 [default = 600000]; // send a query to BSC every x milliseconds
- optional double MinStorageScatterToBalance = 71 [default = 999]; // storage balancer trigger is disabled by default
- optional double MinGroupUsageToBalance = 72 [default = 0.1];
+ optional double MinStorageScatterToBalance = 71 [default = 0.5]; // storage balancer trigger threshold (enabled by default)
+ optional double MinGroupUsageToBalance = 72 [default = 0.05];
optional uint64 StorageBalancerInflight = 73 [default = 1];
optional bool EnableDestroyOperations = 74 [default = false];
optional double NodeUsageRangeToKick = 75 [default = 0.2];