diff options
author | serg-belyakov <serg-belyakov@yandex-team.com> | 2023-05-26 16:06:24 +0300 |
---|---|---|
committer | serg-belyakov <serg-belyakov@yandex-team.com> | 2023-05-26 16:06:24 +0300 |
commit | 72f4c3c32ff525098aa0739cd75dec7f7a901547 (patch) | |
tree | a408b92d66b83e36b4cb993a7de68e40c8acda14 | |
parent | 128ca89c517a1e3868cbf91525b75a61b13051c9 (diff) | |
download | ydb-72f4c3c32ff525098aa0739cd75dec7f7a901547.tar.gz |
Propagate IsReady flag to SelfHealActor,
Send UpdateSelfHealInfo when IsReady is altered
-rw-r--r-- | ydb/core/mind/bscontroller/impl.h | 8 | ||||
-rw-r--r-- | ydb/core/mind/bscontroller/register_node.cpp | 1 | ||||
-rw-r--r-- | ydb/core/mind/bscontroller/self_heal.cpp | 13 | ||||
-rw-r--r-- | ydb/core/mind/bscontroller/self_heal.h | 2 |
4 files changed, 23 insertions, 1 deletions
diff --git a/ydb/core/mind/bscontroller/impl.h b/ydb/core/mind/bscontroller/impl.h index ba840f66f14..018c3e8cc6f 100644 --- a/ydb/core/mind/bscontroller/impl.h +++ b/ydb/core/mind/bscontroller/impl.h @@ -2102,8 +2102,13 @@ public: const TMonotonic now = TActivationContext::Monotonic(); THashSet<TGroupInfo*> groups; + + auto sh = std::make_unique<TEvControllerUpdateSelfHealInfo>(); for (auto it = VSlotReadyTimestampQ.begin(); it != VSlotReadyTimestampQ.end() && it->first <= now; it = VSlotReadyTimestampQ.erase(it)) { + Y_VERIFY_DEBUG(!it->second->IsReady); + + sh->VDiskIsReadyUpdate.emplace_back(it->second->GetVDiskId(), true); it->second->IsReady = true; it->second->ResetVSlotReadyTimestampIter(); if (const TGroupInfo *group = it->second->Group) { @@ -2121,6 +2126,9 @@ public: if (!timingQ.empty()) { Execute(CreateTxUpdateLastSeenReady(std::move(timingQ))); } + if (sh->VDiskIsReadyUpdate) { + Send(SelfHealId, sh.release()); + } } void ScheduleVSlotReadyUpdate() { diff --git a/ydb/core/mind/bscontroller/register_node.cpp b/ydb/core/mind/bscontroller/register_node.cpp index 2110073a4a5..3717faab223 100644 --- a/ydb/core/mind/bscontroller/register_node.cpp +++ b/ydb/core/mind/bscontroller/register_node.cpp @@ -519,6 +519,7 @@ void TBlobStorageController::OnWardenDisconnected(TNodeId nodeId) { if (const TGroupInfo *group = it->second->Group) { if (it->second->IsReady) { NotReadyVSlotIds.insert(it->second->VSlotId); + sh->VDiskIsReadyUpdate.emplace_back(it->second->GetVDiskId(), false); } it->second->SetStatus(NKikimrBlobStorage::EVDiskStatus::ERROR, mono, now, false); timingQ.emplace_back(*it->second); diff --git a/ydb/core/mind/bscontroller/self_heal.cpp b/ydb/core/mind/bscontroller/self_heal.cpp index 693f2194aac..440114a23f7 100644 --- a/ydb/core/mind/bscontroller/self_heal.cpp +++ b/ydb/core/mind/bscontroller/self_heal.cpp @@ -371,6 +371,15 @@ namespace NKikimr::NBsController { } } } + for (auto& [vdiskId, isReady] : ev->Get()->VDiskIsReadyUpdate) { + if (const auto it = Groups.find(vdiskId.GroupID); it != Groups.end()) { + auto& group = it->second; + if (const auto it = group.Content.VDisks.find(vdiskId); it != group.Content.VDisks.end() && + vdiskId.GroupGeneration == it->first.GroupGeneration) { + it->second.IsReady = isReady; + } + } + } CheckGroups(); } @@ -406,7 +415,7 @@ namespace NKikimr::NBsController { bool allDisksAreFullyOperational = true; for (const auto& [vdiskId, vdisk] : group.Content.VDisks) { - if (vdisk.Bad || vdisk.Faulty || vdisk.VDiskStatus != NKikimrBlobStorage::EVDiskStatus::READY) { + if (vdisk.Bad || vdisk.Faulty || !vdisk.IsReady) { // don't sanitize groups with non-operational or replicating disks allDisksAreFullyOperational = false; break; @@ -893,6 +902,7 @@ namespace NKikimr::NBsController { slot->PDisk->BadInTermsOfSelfHeal(), slot->PDisk->Decommitted(), slot->OnlyPhantomsRemain, + slot->IsReady, slot->Status, }; } @@ -921,6 +931,7 @@ namespace NKikimr::NBsController { slot->SetStatus(m.GetStatus(), mono, now, m.GetOnlyPhantomsRemain()); if (slot->IsReady != wasReady) { ScrubState.UpdateVDiskState(slot); + ev->VDiskIsReadyUpdate.emplace_back(vdiskId, slot->IsReady); if (wasReady) { NotReadyVSlotIds.insert(slot->VSlotId); } diff --git a/ydb/core/mind/bscontroller/self_heal.h b/ydb/core/mind/bscontroller/self_heal.h index d39b766cd82..0ea672c1e98 100644 --- a/ydb/core/mind/bscontroller/self_heal.h +++ b/ydb/core/mind/bscontroller/self_heal.h @@ -16,6 +16,7 @@ namespace NKikimr::NBsController { bool Bad; bool Decommitted; bool OnlyPhantomsRemain; + bool IsReady; NKikimrBlobStorage::EVDiskStatus VDiskStatus; }; ui32 Generation; @@ -26,6 +27,7 @@ namespace NKikimr::NBsController { THashMap<TGroupId, std::optional<TGroupContent>> GroupsToUpdate; // groups with faulty groups that are changed or got faulty PDisks for the first time TVector<std::tuple<TVDiskID, NKikimrBlobStorage::EVDiskStatus, bool>> VDiskStatusUpdate; + TVector<std::pair<TVDiskID, bool>> VDiskIsReadyUpdate; std::optional<bool> GroupLayoutSanitizerEnabled; ui64 ConfigTxSeqNo = 0; |