diff options
author | alexvru <alexvru@ydb.tech> | 2023-07-18 20:05:14 +0300 |
---|---|---|
committer | alexvru <alexvru@ydb.tech> | 2023-07-18 20:05:14 +0300 |
commit | aa32c932ea3f254fcf8332442711daaf972fc885 (patch) | |
tree | a0ed7faf23fe16477b55e65374d135febc107ff0 | |
parent | 5950024b3f226e8ebf4bd5de7fc668d56b94bebc (diff) | |
download | ydb-aa32c932ea3f254fcf8332442711daaf972fc885.tar.gz |
Increment group generation on scope change KIKIMR-18781
-rw-r--r-- | ydb/core/mind/bscontroller/cmds_storage_pool.cpp | 14 | ||||
-rw-r--r-- | ydb/core/mind/bscontroller/config.cpp | 5 | ||||
-rw-r--r-- | ydb/core/mind/bscontroller/config_fit_groups.cpp | 1 | ||||
-rw-r--r-- | ydb/core/mind/bscontroller/impl.h | 2 |
4 files changed, 16 insertions, 6 deletions
diff --git a/ydb/core/mind/bscontroller/cmds_storage_pool.cpp b/ydb/core/mind/bscontroller/cmds_storage_pool.cpp index 72fee19f582..09da9e3e679 100644 --- a/ydb/core/mind/bscontroller/cmds_storage_pool.cpp +++ b/ydb/core/mind/bscontroller/cmds_storage_pool.cpp @@ -155,7 +155,17 @@ namespace NKikimr::NBsController { } auto &storagePools = StoragePools.Unshare(); - storagePools[id] = std::move(storagePool); + if (const auto [spIt, inserted] = storagePools.try_emplace(id, std::move(storagePool)); !inserted) { + TStoragePoolInfo& cur = spIt->second; + if (cur.SchemeshardId != storagePool.SchemeshardId || cur.PathItemId != storagePool.PathItemId) { + for (auto it = r.first; it != r.second; ++it) { + TGroupInfo *group = Groups.FindForUpdate(it->second); + Y_VERIFY(group); + group->ContentChanged = true; + } + } + cur = std::move(storagePool); // update existing storage pool + } Fit.PoolsAndGroups.emplace(id, std::nullopt); } @@ -653,7 +663,7 @@ namespace NKikimr::NBsController { vslot->Mood = TMood::Wipe; vslot->Status = NKikimrBlobStorage::EVDiskStatus::INIT_PENDING; vslot->IsReady = false; - group->MoodChanged = true; + group->FailureModelChanged = true; group->CalculateGroupStatus(); } diff --git a/ydb/core/mind/bscontroller/config.cpp b/ydb/core/mind/bscontroller/config.cpp index 44ee41bb748..b13830b9b81 100644 --- a/ydb/core/mind/bscontroller/config.cpp +++ b/ydb/core/mind/bscontroller/config.cpp @@ -301,8 +301,7 @@ namespace NKikimr::NBsController { if (!overlay->second || !base) { continue; } - auto& group = overlay->second; - if ((base->second->Generation != group->Generation || group->MoodChanged) && group->VDisksInGroup) { + if (auto& group = overlay->second; group->FailureModelChanged && group->VDisksInGroup) { // process only groups with changed content; create topology for group auto& topology = *group->Topology; // fill in vector of failed disks (that are not fully operational) @@ -737,7 +736,7 @@ namespace NKikimr::NBsController { for (const auto& slot : VDisksInGroup) { slot.Mutable().Group = this; } - MoodChanged = false; + FailureModelChanged = false; } void TBlobStorageController::Serialize(NKikimrBlobStorage::TDefineHostConfig *pb, const THostConfigId &id, diff --git a/ydb/core/mind/bscontroller/config_fit_groups.cpp b/ydb/core/mind/bscontroller/config_fit_groups.cpp index cc71480c4d7..f91bb48d4be 100644 --- a/ydb/core/mind/bscontroller/config_fit_groups.cpp +++ b/ydb/core/mind/bscontroller/config_fit_groups.cpp @@ -351,6 +351,7 @@ namespace NKikimr { // create slots for the new group auto newSlots = CreateVSlotsForGroup(groupInfo, group, preservedSlots); groupInfo->ContentChanged = true; + groupInfo->FailureModelChanged = true; if (replacedSlots) { if (!IgnoreGroupFailModelChecks) { diff --git a/ydb/core/mind/bscontroller/impl.h b/ydb/core/mind/bscontroller/impl.h index 74f89d775fc..a90e598c02a 100644 --- a/ydb/core/mind/bscontroller/impl.h +++ b/ydb/core/mind/bscontroller/impl.h @@ -549,7 +549,7 @@ public: TBoxStoragePoolId StoragePoolId; mutable TStorageStatusFlags StatusFlags; bool ContentChanged = false; - bool MoodChanged = false; + bool FailureModelChanged = false; TActorId VirtualGroupSetupMachineId; |