5
5
namespace NKikimr ::NBsController {
6
6
7
7
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
+
8
13
ui64 storagePoolId = cmd.GetStoragePoolId ();
9
14
if (!storagePoolId) {
10
15
ui64 maxPoolId = 0 ;
11
16
12
17
// TODO: optimize linear search
13
18
14
19
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 ;
17
22
++it) {
18
23
const ui64 id = std::get<1 >(it->first );
19
24
const TStoragePoolInfo &info = it->second ;
@@ -39,7 +44,7 @@ namespace NKikimr::NBsController {
39
44
}
40
45
}
41
46
42
- const TBoxStoragePoolId id (cmd. GetBoxId () , storagePoolId);
47
+ const TBoxStoragePoolId id (boxId , storagePoolId);
43
48
const ui64 nextGen = CheckGeneration (cmd, StoragePools.Get (), id);
44
49
45
50
TStoragePoolInfo storagePool;
@@ -90,12 +95,12 @@ namespace NKikimr::NBsController {
90
95
storagePool.RandomizeGroupMapping = cmd.GetRandomizeGroupMapping ();
91
96
92
97
for (const auto &userId : cmd.GetUserId ()) {
93
- storagePool.UserIds .emplace (cmd. GetBoxId () , storagePoolId, userId);
98
+ storagePool.UserIds .emplace (boxId , storagePoolId, userId);
94
99
}
95
100
96
101
for (const auto &item : cmd.GetPDiskFilter ()) {
97
102
TStoragePoolInfo::TPDiskFilter filter;
98
- filter.BoxId = cmd. GetBoxId () ;
103
+ filter.BoxId = boxId ;
99
104
filter.StoragePoolId = storagePoolId;
100
105
101
106
bool hasTypeProperty = false ;
0 commit comments