Skip to content

Commit cc64f5f

Browse files
authored
25-3: make storage balancer async (#29334)
2 parents be9f866 + a48962c commit cc64f5f

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) {
@@ -9116,6 +9118,11 @@ Y_UNIT_TEST_SUITE(TStorageBalanceTest) {
91169118
OnBootTablet(info);
91179119
return TTestActorRuntime::EEventAction::PROCESS;
91189120
}
9121+
case TEvHive::EvReassignTablet: {
9122+
auto& record = ev->Get<TEvHive::TEvReassignTablet>()->Record;
9123+
record.SetAsync(false);
9124+
return TTestActorRuntime::EEventAction::PROCESS;
9125+
}
91199126
}
91209127
return TTestActorRuntime::EEventAction::PROCESS;
91219128
};

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)