Skip to content

Commit b20898c

Browse files
authored
25-3-1: make storage balancer async (#29212)
2 parents 983f713 + b1d9876 commit b20898c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
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
}

0 commit comments

Comments
 (0)