diff options
author | Alexander Rutkovsky <[email protected]> | 2025-08-04 11:40:35 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2025-08-04 11:40:35 +0300 |
commit | ebb49b56ac840a3938d630782b7873be7d354038 (patch) | |
tree | 1ee5888aa8c4e1f13f385e60a42f5b713624583e | |
parent | 6116d996ac373267bf7a504c76f30907f933d794 (diff) |
Report bridge proxy group id and bridge pile id in TGroupInfo (#22240)
-rw-r--r-- | ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp | 6 | ||||
-rw-r--r-- | ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h | 4 | ||||
-rw-r--r-- | ydb/core/blobstorage/nodewarden/distconf.h | 2 | ||||
-rw-r--r-- | ydb/core/blobstorage/nodewarden/distconf_generate.cpp | 19 | ||||
-rw-r--r-- | ydb/core/blobstorage/nodewarden/distconf_invoke_static_group.cpp | 8 | ||||
-rw-r--r-- | ydb/core/mind/bscontroller/config.cpp | 6 | ||||
-rw-r--r-- | ydb/core/node_whiteboard/node_whiteboard.h | 8 | ||||
-rw-r--r-- | ydb/core/protos/blobstorage.proto | 2 | ||||
-rw-r--r-- | ydb/core/protos/node_whiteboard.proto | 2 |
9 files changed, 49 insertions, 8 deletions
diff --git a/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp b/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp index 3cd84768d6e..a4a20467e15 100644 --- a/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp +++ b/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp @@ -798,6 +798,12 @@ TIntrusivePtr<TBlobStorageGroupInfo> TBlobStorageGroupInfo::Parse(const NKikimrB for (const auto& groupId : group.GetBridgeGroupIds()) { res->BridgeGroupIds.push_back(TGroupId::FromValue(groupId)); } + if (group.HasBridgeProxyGroupId()) { + res->BridgeProxyGroupId.emplace(TGroupId::FromProto(&group, &NKikimrBlobStorage::TGroupInfo::GetBridgeProxyGroupId)); + } + if (group.HasBridgePileId()) { + res->BridgePileId.emplace(TBridgePileId::FromProto(&group, &NKikimrBlobStorage::TGroupInfo::GetBridgePileId)); + } // store original group protobuf it was parsed from res->Group.emplace(group); diff --git a/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h b/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h index 36c07365309..39707780476 100644 --- a/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h +++ b/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h @@ -337,6 +337,8 @@ public: const std::vector<TGroupId>& GetBridgeGroupIds() const { return BridgeGroupIds; } bool IsBridged() const { return !BridgeGroupIds.empty(); } + std::optional<TGroupId> GetBridgeProxyGroupId() const { return BridgeProxyGroupId; } + std::optional<TBridgePileId> GetBridgePileId() const { return BridgePileId; } // for testing purposes; numFailDomains = 0 automatically selects possible minimum for provided erasure; groupId=0 // and groupGen=1 for constructed group @@ -482,6 +484,8 @@ private: NPDisk::EDeviceType DeviceType = NPDisk::DEVICE_TYPE_UNKNOWN; // bridge mode fields std::vector<TGroupId> BridgeGroupIds; + std::optional<TGroupId> BridgeProxyGroupId; + std::optional<TBridgePileId> BridgePileId; }; // physical fail domain description diff --git a/ydb/core/blobstorage/nodewarden/distconf.h b/ydb/core/blobstorage/nodewarden/distconf.h index 7d5dd6158f5..78c0bb5df17 100644 --- a/ydb/core/blobstorage/nodewarden/distconf.h +++ b/ydb/core/blobstorage/nodewarden/distconf.h @@ -442,7 +442,7 @@ namespace NKikimr::NStorage { const NBsController::TGroupMapper::TForbiddenPDisks& forbid, i64 requiredSpace, NKikimrBlobStorage::TBaseConfig *baseConfig, bool convertToDonor, bool ignoreVSlotQuotaCheck, bool isSelfHealReasonDecommit, - std::optional<TBridgePileId> bridgePileId); + std::optional<TBridgePileId> bridgePileId, std::optional<TGroupId> bridgeProxyGroupId); bool UpdateConfig(NKikimrBlobStorage::TStorageConfig *config, bool& checkSyncersAfterCommit); diff --git a/ydb/core/blobstorage/nodewarden/distconf_generate.cpp b/ydb/core/blobstorage/nodewarden/distconf_generate.cpp index 483a8e796ed..8248c94cb2c 100644 --- a/ydb/core/blobstorage/nodewarden/distconf_generate.cpp +++ b/ydb/core/blobstorage/nodewarden/distconf_generate.cpp @@ -34,11 +34,11 @@ namespace NKikimr::NStorage { TGroupId groupId = TGroupId::Zero(); - auto allocateGroup = [&](std::optional<TBridgePileId> bridgePileId) { + auto allocateGroup = [&](std::optional<TBridgePileId> bridgePileId, std::optional<TGroupId> bridgeProxyGroupId) { AllocateStaticGroup(config, groupId, /*groupGeneration=*/ 1, TBlobStorageGroupType(species), smConfig.GetGeometry(), smConfig.GetPDiskFilter(), smConfig.HasPDiskType() ? std::make_optional(smConfig.GetPDiskType()) : std::nullopt, {}, {}, 0, - nullptr, false, true, false, bridgePileId); + nullptr, false, true, false, bridgePileId, bridgeProxyGroupId); const auto& groups = config->GetBlobStorageConfig().GetServiceSet().GetGroups(); const auto& allocatedGroup = groups.at(groups.size() - 1); @@ -47,6 +47,7 @@ namespace NKikimr::NStorage { if (const auto& bridge = Cfg->BridgeConfig) { auto *group = config->MutableBlobStorageConfig()->MutableServiceSet()->AddGroups(); + const TGroupId bridgeProxyGroupId = groupId; groupId.CopyToProto(group, &NKikimrBlobStorage::TGroupInfo::SetGroupID); ++groupId; group->SetGroupGeneration(1); @@ -54,12 +55,12 @@ namespace NKikimr::NStorage { const auto& piles = bridge->GetPiles(); for (int i = 0; i < piles.size(); ++i) { prefix << "pile# " << i << ' '; - allocateGroup(TBridgePileId::FromValue(i)); + allocateGroup(TBridgePileId::FromValue(i), bridgeProxyGroupId); groupId.CopyToProto(group, &NKikimrBlobStorage::TGroupInfo::AddBridgeGroupIds); ++groupId; } } else { - allocateGroup(std::nullopt); + allocateGroup(std::nullopt, std::nullopt); } } catch (const TExConfigError& ex) { return TStringBuilder() << "failed to allocate static group: " << ex.what() << ' ' << prefix.Str(); @@ -135,7 +136,8 @@ namespace NKikimr::NStorage { THashMap<TVDiskIdShort, NBsController::TPDiskId> replacedDisks, const NBsController::TGroupMapper::TForbiddenPDisks& forbid, i64 requiredSpace, NKikimrBlobStorage::TBaseConfig *baseConfig, bool convertToDonor, bool ignoreVSlotQuotaCheck, - bool isSelfHealReasonDecommit, std::optional<TBridgePileId> bridgePileId) { + bool isSelfHealReasonDecommit, std::optional<TBridgePileId> bridgePileId, + std::optional<TGroupId> bridgeProxyGroupId) { using TPDiskId = NBsController::TPDiskId; NKikimrConfig::TBlobStorageConfig *bsConfig = config->MutableBlobStorageConfig(); @@ -495,6 +497,13 @@ namespace NKikimr::NStorage { } sGroup->SetGroupGeneration(groupGeneration); + if (bridgeProxyGroupId) { + bridgeProxyGroupId->CopyToProto(sGroup, &NKikimrBlobStorage::TGroupInfo::SetBridgeProxyGroupId); + } + if (bridgePileId) { + bridgePileId->CopyToProto(sGroup, &NKikimrBlobStorage::TGroupInfo::SetBridgePileId); + } + TVDiskIdShort prev; NKikimrBlobStorage::TGroupInfo::TFailRealm *sRealm = nullptr; NKikimrBlobStorage::TGroupInfo::TFailRealm::TFailDomain *sDomain = nullptr; diff --git a/ydb/core/blobstorage/nodewarden/distconf_invoke_static_group.cpp b/ydb/core/blobstorage/nodewarden/distconf_invoke_static_group.cpp index 02276ac0d22..5d22c4aa0e4 100644 --- a/ydb/core/blobstorage/nodewarden/distconf_invoke_static_group.cpp +++ b/ydb/core/blobstorage/nodewarden/distconf_invoke_static_group.cpp @@ -192,13 +192,19 @@ namespace NKikimr::NStorage { for (const auto& group : ss.GetGroups()) { if (group.GetGroupID() == vdiskId.GroupID.GetRawId()) { try { + std::optional<TBridgePileId> bridgePileId = group.HasBridgePileId() + ? std::make_optional(TBridgePileId::FromProto(&group, &NKikimrBlobStorage::TGroupInfo::GetBridgePileId)) + : std::nullopt; + std::optional<TGroupId> bridgeProxyGroupId = group.HasBridgeProxyGroupId() + ? std::make_optional(TGroupId::FromProto(&group, &NKikimrBlobStorage::TGroupInfo::GetBridgeProxyGroupId)) + : std::nullopt; Self->AllocateStaticGroup(&config, vdiskId.GroupID, vdiskId.GroupGeneration + 1, TBlobStorageGroupType((TBlobStorageGroupType::EErasureSpecies)group.GetErasureSpecies()), smConfig.GetGeometry(), smConfig.GetPDiskFilter(), smConfig.HasPDiskType() ? std::make_optional(smConfig.GetPDiskType()) : std::nullopt, replacedDisks, forbid, maxSlotSize, &BaseConfig.value(), cmd.GetConvertToDonor(), cmd.GetIgnoreVSlotQuotaCheck(), - cmd.GetIsSelfHealReasonDecommit(), std::nullopt); + cmd.GetIsSelfHealReasonDecommit(), bridgePileId, bridgeProxyGroupId); } catch (const TExConfigError& ex) { STLOG(PRI_NOTICE, BS_NODE, NWDC76, "ReassignGroupDisk failed to allocate group", (SelfId, SelfId()), (Config, config), diff --git a/ydb/core/mind/bscontroller/config.cpp b/ydb/core/mind/bscontroller/config.cpp index 047d97a5677..7b79f09cb5d 100644 --- a/ydb/core/mind/bscontroller/config.cpp +++ b/ydb/core/mind/bscontroller/config.cpp @@ -1244,6 +1244,12 @@ namespace NKikimr::NBsController { if (groupInfo.BridgeGroupInfo) { group->MergeFrom(*groupInfo.BridgeGroupInfo); } + if (groupInfo.BridgeProxyGroupId) { + groupInfo.BridgeProxyGroupId->CopyToProto(group, &NKikimrBlobStorage::TGroupInfo::SetBridgeProxyGroupId); + } + if (groupInfo.BridgePileId) { + groupInfo.BridgePileId->CopyToProto(group, &NKikimrBlobStorage::TGroupInfo::SetBridgePileId); + } } void TBlobStorageController::SerializeSettings(NKikimrBlobStorage::TUpdateSettings *settings) { diff --git a/ydb/core/node_whiteboard/node_whiteboard.h b/ydb/core/node_whiteboard/node_whiteboard.h index eea69ca9bbf..748c153b1fa 100644 --- a/ydb/core/node_whiteboard/node_whiteboard.h +++ b/ydb/core/node_whiteboard/node_whiteboard.h @@ -24,7 +24,7 @@ using TTabletId = ui64; using TFollowerId = ui32; using TNodeId = ui32; -struct TEvWhiteboard{ +struct TEvWhiteboard { enum EEv { EvTabletStateUpdate = EventSpaceBegin(TKikimrEvents::ES_NODE_WHITEBOARD), EvTabletStateRequest, @@ -331,6 +331,12 @@ struct TEvWhiteboard{ Record.SetBlobDepotId(*groupInfo->BlobDepotId); } Record.SetGroupSizeInUnits(groupInfo->GroupSizeInUnits); + if (const auto& bridgeProxyGroupId = groupInfo->GetBridgeProxyGroupId()) { + bridgeProxyGroupId->CopyToProto(&Record, &decltype(Record)::SetBridgeProxyGroupId); + } + if (const auto& bridgePileId = groupInfo->GetBridgePileId()) { + bridgePileId->CopyToProto(&Record, &decltype(Record)::SetBridgePileId); + } } }; diff --git a/ydb/core/protos/blobstorage.proto b/ydb/core/protos/blobstorage.proto index f769dcb58f7..dad75084ef6 100644 --- a/ydb/core/protos/blobstorage.proto +++ b/ydb/core/protos/blobstorage.proto @@ -129,6 +129,8 @@ message TGroupInfo { optional NKikimrBlobStorage.TGroupDecommitStatus.E DecommitStatus = 16; repeated uint32 BridgeGroupIds = 17; // filled in for common group when operating in bridge mode optional uint32 GroupSizeInUnits = 18; + optional uint32 BridgeProxyGroupId = 19; // proxy group when running in Bridge mode + optional uint32 BridgePileId = 20; } message TEvVPatchStart { diff --git a/ydb/core/protos/node_whiteboard.proto b/ydb/core/protos/node_whiteboard.proto index 2f36bb5c9ee..bf168697823 100644 --- a/ydb/core/protos/node_whiteboard.proto +++ b/ydb/core/protos/node_whiteboard.proto @@ -270,6 +270,8 @@ message TBSGroupStateInfo { optional bool NoVDisksInGroup = 22 [(DefaultField) = true]; optional uint64 BlobDepotOnlineTime = 23 [(DefaultField) = true]; optional uint32 GroupSizeInUnits = 24; + optional uint32 BridgeProxyGroupId = 25; // when running in Bridge mode + optional uint32 BridgePileId = 26; // also in Bridge mode } message TEvBSGroupStateRequest { |