diff options
author | zalyalov <zalyalov@yandex-team.com> | 2023-09-25 11:47:38 +0300 |
---|---|---|
committer | zalyalov <zalyalov@yandex-team.com> | 2023-09-25 12:06:02 +0300 |
commit | ef92969347d888d1f2bf46a4a9328822447e5225 (patch) | |
tree | 0bc1209eeda9a46b5f684f19579c5209e30a1ed6 | |
parent | 5f9629787357b8b1d70e8d8058dcd64e2822462b (diff) | |
download | ydb-ef92969347d888d1f2bf46a4a9328822447e5225.tar.gz |
peridodically refresh storage pool info KIKIMR-19429
-rw-r--r-- | ydb/core/mind/hive/hive_events.h | 3 | ||||
-rw-r--r-- | ydb/core/mind/hive/hive_impl.cpp | 10 | ||||
-rw-r--r-- | ydb/core/mind/hive/hive_impl.h | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/ydb/core/mind/hive/hive_events.h b/ydb/core/mind/hive/hive_events.h index 73350e6e4c..8a74a533b9 100644 --- a/ydb/core/mind/hive/hive_events.h +++ b/ydb/core/mind/hive/hive_events.h @@ -25,6 +25,7 @@ struct TEvPrivate { EvRestartComplete, EvBalancerOut, EvProcessIncomingEvent, + EvRefreshStorageInfo, EvEnd }; @@ -84,6 +85,8 @@ struct TEvPrivate { struct TEvBalancerOut : TEventLocal<TEvBalancerOut, EvBalancerOut> {}; struct TEvProcessIncomingEvent : TEventLocal<TEvProcessIncomingEvent, EvProcessIncomingEvent> {}; + + struct TEvRefreshStorageInfo : TEventLocal<TEvRefreshStorageInfo, EvRefreshStorageInfo> {}; }; } // NHive diff --git a/ydb/core/mind/hive/hive_impl.cpp b/ydb/core/mind/hive/hive_impl.cpp index 6a1c0849ad..85ec0d84bf 100644 --- a/ydb/core/mind/hive/hive_impl.cpp +++ b/ydb/core/mind/hive/hive_impl.cpp @@ -2544,8 +2544,9 @@ void THive::RequestPoolsInformation() { BLOG_D("THive::RequestPoolsInformation()"); TVector<THolder<NKikimrBlobStorage::TEvControllerSelectGroups::TGroupParameters>> requests; - for (const auto& [poolName, storagePool] : StoragePools) { + for (auto& [poolName, storagePool] : StoragePools) { THolder<NKikimrBlobStorage::TEvControllerSelectGroups::TGroupParameters> item = storagePool.BuildRefreshRequest(); + ++storagePool.RefreshRequestInFlight; requests.emplace_back(std::move(item)); } @@ -2559,6 +2560,7 @@ void THive::RequestPoolsInformation() { } SendToBSControllerPipe(ev.Release()); } + Schedule(TDuration::Minutes(10), new TEvPrivate::TEvRefreshStorageInfo()); } ui32 THive::GetEventPriority(IEventHandle* ev) { @@ -2648,6 +2650,7 @@ void THive::ProcessEvent(std::unique_ptr<IEventHandle> event) { hFunc(TEvHive::TEvTabletOwnersReply, Handle); hFunc(TEvPrivate::TEvBalancerOut, Handle); hFunc(TEvHive::TEvUpdateTabletsObject, Handle); + hFunc(TEvPrivate::TEvRefreshStorageInfo, Handle); } } @@ -2741,6 +2744,7 @@ STFUNC(THive::StateWork) { fFunc(TEvHive::TEvTabletOwnersReply::EventType, EnqueueIncomingEvent); fFunc(TEvPrivate::TEvBalancerOut::EventType, EnqueueIncomingEvent); fFunc(TEvHive::TEvUpdateTabletsObject::EventType, EnqueueIncomingEvent); + fFunc(TEvPrivate::TEvRefreshStorageInfo::EventType, EnqueueIncomingEvent); hFunc(TEvPrivate::TEvProcessIncomingEvent, Handle); default: if (!HandleDefaultEvents(ev, SelfId())) { @@ -2969,6 +2973,10 @@ void THive::Handle(TEvHive::TEvUpdateTabletsObject::TPtr& ev) { Execute(CreateUpdateTabletsObject(std::move(ev))); } +void THive::Handle(TEvPrivate::TEvRefreshStorageInfo::TPtr&) { + RequestPoolsInformation(); +} + TVector<TNodeId> THive::GetNodesForWhiteboardBroadcast(size_t maxNodesToReturn) { TVector<TNodeId> nodes; TNodeId selfNodeId = SelfId().NodeId(); diff --git a/ydb/core/mind/hive/hive_impl.h b/ydb/core/mind/hive/hive_impl.h index a59d598da5..63ab0344eb 100644 --- a/ydb/core/mind/hive/hive_impl.h +++ b/ydb/core/mind/hive/hive_impl.h @@ -527,6 +527,7 @@ protected: void Handle(TEvHive::TEvRequestTabletOwners::TPtr& ev); void Handle(TEvHive::TEvTabletOwnersReply::TPtr& ev); void Handle(TEvHive::TEvUpdateTabletsObject::TPtr& ev); + void Handle(TEvPrivate::TEvRefreshStorageInfo::TPtr& ev); void Handle(TEvPrivate::TEvProcessIncomingEvent::TPtr& ev); protected: |