Skip to content

Commit 0e4fe68

Browse files
vporyadkeCopilot
andauthored
make storage balancer async and turned on (#28244)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 3c63951 commit 0e4fe68

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) {
@@ -9053,6 +9055,11 @@ Y_UNIT_TEST_SUITE(TStorageBalanceTest) {
90539055
OnBootTablet(info);
90549056
return TTestActorRuntime::EEventAction::PROCESS;
90559057
}
9058+
case TEvHive::EvReassignTablet: {
9059+
auto& record = ev->Get<TEvHive::TEvReassignTablet>()->Record;
9060+
record.SetAsync(false);
9061+
return TTestActorRuntime::EEventAction::PROCESS;
9062+
}
90569063
}
90579064
return TTestActorRuntime::EEventAction::PROCESS;
90589065
};

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
@@ -2251,10 +2251,10 @@ message THiveConfig {
22512251
reserved 66;
22522252
optional double ObjectImbalanceToBalance = 67 [default = 0.02];
22532253
optional EHiveChannelBalanceStrategy ChannelBalanceStrategy = 68 [default = HIVE_CHANNEL_BALANCE_STRATEGY_WEIGHTED_RANDOM];
2254-
optional uint64 MaxChannelHistorySize = 69 [default = 200];
2254+
optional uint64 MaxChannelHistorySize = 69 [default = 10];
22552255
optional uint64 StorageInfoRefreshFrequency = 70 [default = 600000]; // send a query to BSC every x milliseconds
2256-
optional double MinStorageScatterToBalance = 71 [default = 999]; // storage balancer trigger is disabled by default
2257-
optional double MinGroupUsageToBalance = 72 [default = 0.1];
2256+
optional double MinStorageScatterToBalance = 71 [default = 0.5]; // storage balancer trigger threshold (enabled by default)
2257+
optional double MinGroupUsageToBalance = 72 [default = 0.05];
22582258
optional uint64 StorageBalancerInflight = 73 [default = 1];
22592259
optional bool EnableDestroyOperations = 74 [default = false];
22602260
optional double NodeUsageRangeToKick = 75 [default = 0.2];

0 commit comments

Comments
 (0)