Skip to content

Commit 8028541

Browse files
vporyadkeCopilot
andcommitted
make storage balancer async and turned on (#28244)
Co-authored-by: Copilot <[email protected]>
1 parent b511d7b commit 8028541

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

ydb/core/mind/hive/hive_ut.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3392,6 +3392,8 @@ Y_UNIT_TEST_SUITE(THiveTest) {
33923392
const ui64 testerTablet = MakeTabletID(false, 1);
33933393
CreateTestBootstrapper(runtime, CreateTestTabletInfo(hiveTablet, TTabletTypes::Hive), &CreateDefaultHive);
33943394

3395+
auto syncReassign = runtime.AddObserver<TEvHive::TEvReassignTablet>([] (auto&& ev) { ev->Get()->Record.SetAsync(false); });
3396+
33953397
TTabletTypes::EType tabletType = TTabletTypes::Dummy;
33963398
TVector<ui64> tablets;
33973399
for (ui64 i = 0; i < NUM_TABLETS; ++i) {
@@ -9075,6 +9077,11 @@ Y_UNIT_TEST_SUITE(TStorageBalanceTest) {
90759077
OnBootTablet(info);
90769078
return TTestActorRuntime::EEventAction::PROCESS;
90779079
}
9080+
case TEvHive::EvReassignTablet: {
9081+
auto& record = ev->Get<TEvHive::TEvReassignTablet>()->Record;
9082+
record.SetAsync(false);
9083+
return TTestActorRuntime::EEventAction::PROCESS;
9084+
}
90789085
}
90799086
return TTestActorRuntime::EEventAction::PROCESS;
90809087
};

ydb/core/mind/hive/storage_balancer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ class THiveStorageBalancer : public NActors::TActorBootstrapped<THiveStorageBala
177177
if (!ev) {
178178
ev = std::make_unique<TEvHive::TEvReassignTablet>(channel.TabletId);
179179
ev->Record.SetReassignReason(NKikimrHive::TEvReassignTablet::HIVE_REASSIGN_REASON_BALANCE);
180+
ev->Record.SetAsync(true);
180181
}
181182
ev->Record.AddChannels(channel.ChannelId);
182183
}

ydb/core/protos/config.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,10 +2057,10 @@ message THiveConfig {
20572057
reserved 66;
20582058
optional double ObjectImbalanceToBalance = 67 [default = 0.02];
20592059
optional EHiveChannelBalanceStrategy ChannelBalanceStrategy = 68 [default = HIVE_CHANNEL_BALANCE_STRATEGY_WEIGHTED_RANDOM];
2060-
optional uint64 MaxChannelHistorySize = 69 [default = 200];
2060+
optional uint64 MaxChannelHistorySize = 69 [default = 10];
20612061
optional uint64 StorageInfoRefreshFrequency = 70 [default = 600000]; // send a query to BSC every x milliseconds
2062-
optional double MinStorageScatterToBalance = 71 [default = 999]; // storage balancer trigger is disabled by default
2063-
optional double MinGroupUsageToBalance = 72 [default = 0.1];
2062+
optional double MinStorageScatterToBalance = 71 [default = 0.5]; // storage balancer trigger threshold (enabled by default)
2063+
optional double MinGroupUsageToBalance = 72 [default = 0.05];
20642064
optional uint64 StorageBalancerInflight = 73 [default = 1];
20652065
optional bool EnableDestroyOperations = 74 [default = false];
20662066
optional double NodeUsageRangeToKick = 75 [default = 0.2];

0 commit comments

Comments
 (0)