Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ydb/core/cms/console/console_tenants_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ class TPoolManip : public TActorBootstrapped<TPoolManip> {
void AllocatePool(const TActorContext &ctx)
{
auto request = MakeHolder<TEvBlobStorage::TEvControllerConfigRequest>();
request->Record.MutableRequest()->AddCommand()->MutableDefineStoragePool()->CopyFrom(Pool->Config);
auto *pool = request->Record.MutableRequest()->AddCommand()->MutableDefineStoragePool();
pool->CopyFrom(Pool->Config);
if (!pool->GetKind()) {
pool->SetKind(Pool->Kind);
}

BLOG_D(LogPrefix << "send pool request: " << request->Record.ShortDebugString());

Expand Down
15 changes: 10 additions & 5 deletions ydb/core/mind/bscontroller/cmds_storage_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
namespace NKikimr::NBsController {

void TBlobStorageController::TConfigState::ExecuteStep(const NKikimrBlobStorage::TDefineStoragePool& cmd, TStatus& status) {
TBoxId boxId = cmd.GetBoxId();
if (!boxId && Boxes.Get().size() == 1) {
boxId = Boxes.Get().begin()->first;
}

ui64 storagePoolId = cmd.GetStoragePoolId();
if (!storagePoolId) {
ui64 maxPoolId = 0;

// TODO: optimize linear search

const auto &pools = StoragePools.Get();
for (auto it = pools.lower_bound({cmd.GetBoxId(), 0});
it != pools.end() && std::get<0>(it->first) == cmd.GetBoxId();
for (auto it = pools.lower_bound({boxId, 0});
it != pools.end() && std::get<0>(it->first) == boxId;
++it) {
const ui64 id = std::get<1>(it->first);
const TStoragePoolInfo &info = it->second;
Expand All @@ -39,7 +44,7 @@ namespace NKikimr::NBsController {
}
}

const TBoxStoragePoolId id(cmd.GetBoxId(), storagePoolId);
const TBoxStoragePoolId id(boxId, storagePoolId);
const ui64 nextGen = CheckGeneration(cmd, StoragePools.Get(), id);

TStoragePoolInfo storagePool;
Expand Down Expand Up @@ -90,12 +95,12 @@ namespace NKikimr::NBsController {
storagePool.RandomizeGroupMapping = cmd.GetRandomizeGroupMapping();

for (const auto &userId : cmd.GetUserId()) {
storagePool.UserIds.emplace(cmd.GetBoxId(), storagePoolId, userId);
storagePool.UserIds.emplace(boxId, storagePoolId, userId);
}

for (const auto &item : cmd.GetPDiskFilter()) {
TStoragePoolInfo::TPDiskFilter filter;
filter.BoxId = cmd.GetBoxId();
filter.BoxId = boxId;
filter.StoragePoolId = storagePoolId;

bool hasTypeProperty = false;
Expand Down