aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzalyalov <zalyalov@yandex-team.com>2023-10-11 11:04:52 +0300
committerzalyalov <zalyalov@yandex-team.com>2023-10-11 11:38:19 +0300
commit137e73f0a182b6bcd71afc9c124f1ea747bf3e46 (patch)
treed9a972e528dd2a49af3f58ba0eef1ab930057e8a
parente3bebe7bbc99ec039576a38f90b36d4a88e7a7ce (diff)
downloadydb-137e73f0a182b6bcd71afc9c124f1ea747bf3e46.tar.gz
handle balancer and boot queue events in StateInit KIKIMR-19271
-rw-r--r--ydb/core/mind/hive/hive_impl.cpp12
-rw-r--r--ydb/core/mind/hive/hive_impl.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/ydb/core/mind/hive/hive_impl.cpp b/ydb/core/mind/hive/hive_impl.cpp
index 6a037f7cd72..d994d8a88a6 100644
--- a/ydb/core/mind/hive/hive_impl.cpp
+++ b/ydb/core/mind/hive/hive_impl.cpp
@@ -273,6 +273,11 @@ void THive::ExecuteProcessBootQueue(NIceDb::TNiceDb& db, TSideEffects& sideEffec
}
}
+void THive::HandleInit(TEvPrivate::TEvProcessBootQueue::TPtr&) {
+ BLOG_W("Received TEvProcessBootQueue while in StateInit");
+ Schedule(TDuration::Seconds(1), new TEvPrivate::TEvProcessBootQueue());
+}
+
void THive::Handle(TEvPrivate::TEvProcessBootQueue::TPtr&) {
BLOG_TRACE("ProcessBootQueue - executing");
Execute(CreateProcessBootQueue());
@@ -2154,6 +2159,11 @@ std::optional<EResourceToBalance> THive::CheckScatter(const TResourceNormalizedV
return std::nullopt;
}
+void THive::HandleInit(TEvPrivate::TEvProcessTabletBalancer::TPtr&) {
+ BLOG_W("Received TEvProcessTabletBalancer while in StateInit");
+ Schedule(TDuration::Seconds(1), new TEvPrivate::TEvProcessTabletBalancer());
+}
+
void THive::Handle(TEvPrivate::TEvProcessTabletBalancer::TPtr&) {
ProcessTabletBalancerScheduled = false;
if (!SubActors.empty()) {
@@ -2774,6 +2784,8 @@ void THive::EnqueueIncomingEvent(STATEFN_SIG) {
STFUNC(THive::StateInit) {
switch (ev->GetTypeRewrite()) {
hFunc(TEvInterconnect::TEvNodesInfo, Handle);
+ hFunc(TEvPrivate::TEvProcessBootQueue, HandleInit);
+ hFunc(TEvPrivate::TEvProcessTabletBalancer, HandleInit);
// We subscribe to config updates before hive is fully loaded
hFunc(TEvPrivate::TEvProcessIncomingEvent, Handle);
fFunc(NConsole::TEvConsole::TEvConfigNotificationRequest::EventType, EnqueueIncomingEvent);
diff --git a/ydb/core/mind/hive/hive_impl.h b/ydb/core/mind/hive/hive_impl.h
index 33564805cc3..1b5edbe8647 100644
--- a/ydb/core/mind/hive/hive_impl.h
+++ b/ydb/core/mind/hive/hive_impl.h
@@ -518,9 +518,11 @@ protected:
void Handle(TEvPrivate::TEvKickTablet::TPtr&);
void Handle(TEvPrivate::TEvBootTablets::TPtr&);
void Handle(TEvPrivate::TEvCheckTabletNodeAlive::TPtr&);
+ void HandleInit(TEvPrivate::TEvProcessBootQueue::TPtr&);
void Handle(TEvPrivate::TEvProcessBootQueue::TPtr&);
void Handle(TEvPrivate::TEvPostponeProcessBootQueue::TPtr&);
void Handle(TEvPrivate::TEvProcessDisconnectNode::TPtr&);
+ void HandleInit(TEvPrivate::TEvProcessTabletBalancer::TPtr&);
void Handle(TEvPrivate::TEvProcessTabletBalancer::TPtr&);
void Handle(TEvPrivate::TEvUnlockTabletReconnectTimeout::TPtr&);
void Handle(TEvPrivate::TEvProcessPendingOperations::TPtr&);