55namespace NKikimr ::NBsController {
66
77 void TBlobStorageController::TConfigState::ExecuteStep (const NKikimrBlobStorage::TDefineStoragePool& cmd, TStatus& status) {
8+ TBoxId boxId = cmd.GetBoxId ();
9+ if (!boxId && Boxes.Get ().size () == 1 ) {
10+ boxId = Boxes.Get ().begin ()->first ;
11+ }
12+
813 ui64 storagePoolId = cmd.GetStoragePoolId ();
914 if (!storagePoolId) {
1015 ui64 maxPoolId = 0 ;
1116
1217 // TODO: optimize linear search
1318
1419 const auto &pools = StoragePools.Get ();
15- for (auto it = pools.lower_bound ({cmd. GetBoxId () , 0 });
16- it != pools.end () && std::get<0 >(it->first ) == cmd. GetBoxId () ;
20+ for (auto it = pools.lower_bound ({boxId , 0 });
21+ it != pools.end () && std::get<0 >(it->first ) == boxId ;
1722 ++it) {
1823 const ui64 id = std::get<1 >(it->first );
1924 const TStoragePoolInfo &info = it->second ;
@@ -39,7 +44,7 @@ namespace NKikimr::NBsController {
3944 }
4045 }
4146
42- const TBoxStoragePoolId id (cmd. GetBoxId () , storagePoolId);
47+ const TBoxStoragePoolId id (boxId , storagePoolId);
4348 const ui64 nextGen = CheckGeneration (cmd, StoragePools.Get (), id);
4449
4550 TStoragePoolInfo storagePool;
@@ -90,12 +95,12 @@ namespace NKikimr::NBsController {
9095 storagePool.RandomizeGroupMapping = cmd.GetRandomizeGroupMapping ();
9196
9297 for (const auto &userId : cmd.GetUserId ()) {
93- storagePool.UserIds .emplace (cmd. GetBoxId () , storagePoolId, userId);
98+ storagePool.UserIds .emplace (boxId , storagePoolId, userId);
9499 }
95100
96101 for (const auto &item : cmd.GetPDiskFilter ()) {
97102 TStoragePoolInfo::TPDiskFilter filter;
98- filter.BoxId = cmd. GetBoxId () ;
103+ filter.BoxId = boxId ;
99104 filter.StoragePoolId = storagePoolId;
100105
101106 bool hasTypeProperty = false ;
0 commit comments