@@ -108,6 +108,7 @@ namespace NKikimr {
108
108
false , /* down */
109
109
false , /* seenOperational */
110
110
0 , /* groupSizeInUnits */
111
+ std::nullopt, /* bridgePileId */
111
112
StoragePoolId, /* storagePoolId */
112
113
0 , /* numFailRealms */
113
114
0 , /* numFailDomainsPerFailRealm */
@@ -120,22 +121,19 @@ namespace NKikimr {
120
121
auto & index = State.IndexGroupSpeciesToGroup .Unshare ();
121
122
index[species].push_back (mainGroupId);
122
123
123
- NKikimrBlobStorage::TGroupInfo mainGroup;
124
+ NKikimrBlobStorage::TGroupInfo& mainGroup = groupInfo-> BridgeGroupInfo . emplace () ;
124
125
const auto & bridgeInfo = State.BridgeInfo ;
125
126
Y_ABORT_UNLESS (bridgeInfo);
126
127
bridgeInfo->ForEachPile ([&](TBridgePileId bridgePileId) {
127
- const TGroupId groupId = CreateGroup (bridgePileId);
128
+ const TGroupId groupId = CreateGroup (bridgePileId, mainGroupId );
128
129
groupId.CopyToProto (&mainGroup, &NKikimrBlobStorage::TGroupInfo::AddBridgeGroupIds);
129
130
});
130
-
131
- const bool success = mainGroup.SerializeToString (&groupInfo->BridgeGroupInfo .ConstructInPlace ());
132
- Y_DEBUG_ABORT_UNLESS (success);
133
131
} else {
134
- CreateGroup (std::nullopt); // regular single group
132
+ CreateGroup (std::nullopt, std::nullopt ); // regular single group
135
133
}
136
134
}
137
135
138
- TGroupId CreateGroup (std::optional<TBridgePileId> bridgePileId) {
136
+ TGroupId CreateGroup (std::optional<TBridgePileId> bridgePileId, std::optional<TGroupId> bridgeProxyGroupId ) {
139
137
// //////////////////////////////////////////////////////////////////////////////////////////
140
138
// ALLOCATE GROUP ID FOR THE NEW GROUP
141
139
// //////////////////////////////////////////////////////////////////////////////////////////
@@ -187,12 +185,10 @@ namespace NKikimr {
187
185
TGroupInfo *groupInfo = State.Groups .ConstructInplaceNewEntry (groupId, groupId, 1 ,
188
186
0 , Geometry.GetErasure (), desiredPDiskCategory.GetOrElse (0 ), StoragePool.VDiskKind ,
189
187
StoragePool.EncryptionMode .GetOrElse (0 ), lifeCyclePhase, mainKeyId, encryptedGroupKey,
190
- groupKeyNonce, MainKeyVersion, false , false , groupSizeInUnits, StoragePoolId, Geometry. GetNumFailRealms () ,
191
- Geometry.GetNumFailDomainsPerFailRealm (), Geometry.GetNumVDisksPerFailDomain ());
188
+ groupKeyNonce, MainKeyVersion, false , false , groupSizeInUnits, bridgePileId, StoragePoolId ,
189
+ Geometry.GetNumFailRealms (), Geometry. GetNumFailDomainsPerFailRealm (), Geometry.GetNumVDisksPerFailDomain ());
192
190
193
- if (bridgePileId) {
194
- groupInfo->BridgePileId = *bridgePileId;
195
- }
191
+ groupInfo->BridgeProxyGroupId = bridgeProxyGroupId;
196
192
197
193
// bind group to storage pool
198
194
State.StoragePoolGroups .Unshare ().emplace (StoragePoolId, groupId);
@@ -216,10 +212,6 @@ namespace NKikimr {
216
212
throw TExFitGroupError () << " GroupId# " << groupId << " not found" ;
217
213
}
218
214
219
- std::optional<TBridgePileId> bridgePileId = groupInfo->BridgePileId
220
- ? std::make_optional (*groupInfo->BridgePileId )
221
- : std::nullopt;
222
-
223
215
TGroupMapper::TGroupDefinition group;
224
216
TGroupMapper::TGroupConstraintsDefinition softConstraints, hardConstraints;
225
217
bool layoutIsValid = true ;
@@ -376,7 +368,7 @@ namespace NKikimr {
376
368
STLOG (PRI_INFO, BS_CONTROLLER, BSCFG01, " Attempt to sanitize group layout" , (GroupId, groupId));
377
369
// Use group layout sanitizing algorithm on direct requests or when initial group layout is invalid
378
370
auto result = AllocateOrSanitizeGroup (groupId, group, {}, std::move (forbid), groupSizeInUnits, requiredSpace,
379
- AllowUnusableDisks, bridgePileId , &TGroupGeometryInfo::SanitizeGroup);
371
+ AllowUnusableDisks, groupInfo-> BridgePileId , &TGroupGeometryInfo::SanitizeGroup);
380
372
381
373
if (replacedSlots.empty ()) {
382
374
// update information about replaced disks
@@ -398,10 +390,10 @@ namespace NKikimr {
398
390
try {
399
391
TGroupMapper::MergeTargetDiskConstraints (hardConstraints, softConstraints);
400
392
AllocateOrSanitizeGroup (groupId, group, softConstraints, replacedDisks, std::move (forbid), groupSizeInUnits, requiredSpace,
401
- AllowUnusableDisks, bridgePileId , &TGroupGeometryInfo::AllocateGroup);
393
+ AllowUnusableDisks, groupInfo-> BridgePileId , &TGroupGeometryInfo::AllocateGroup);
402
394
} catch (const TExFitGroupError& ex) {
403
395
AllocateOrSanitizeGroup (groupId, group, hardConstraints, replacedDisks, std::move (forbid), groupSizeInUnits, requiredSpace,
404
- AllowUnusableDisks, bridgePileId , &TGroupGeometryInfo::AllocateGroup);
396
+ AllowUnusableDisks, groupInfo-> BridgePileId , &TGroupGeometryInfo::AllocateGroup);
405
397
}
406
398
}
407
399
if (!IgnoreVSlotQuotaCheck) {
@@ -797,7 +789,9 @@ namespace NKikimr {
797
789
798
790
enumerateGroups ([&](TGroupId groupId) {
799
791
fitter.CheckExistingGroup (groupId);
800
- ++numActualGroups;
792
+ if (const TGroupInfo *group = state.Groups .Find (groupId); group && !group->BridgePileId ) {
793
+ ++numActualGroups;
794
+ }
801
795
});
802
796
if (createNewGroups) {
803
797
if (numActualGroups < storagePool.NumGroups ) {
0 commit comments