Skip to content

Commit b2e8185

Browse files
authored
Fix setting InferPDiskSlotCountMax value in BSC (merge from main #25680) (#25699)
2 parents 23e3464 + dba48f9 commit b2e8185

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

ydb/core/mind/bscontroller/cmds_host_config.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ namespace NKikimr::NBsController {
2424
driveInfo.ReadCentric = drive.GetReadCentric();
2525
driveInfo.Kind = drive.GetKind();
2626
driveInfo.InferPDiskSlotCountFromUnitSize = drive.GetInferPDiskSlotCountFromUnitSize();
27+
driveInfo.InferPDiskSlotCountMax = drive.GetInferPDiskSlotCountMax();
2728

2829
if (drive.HasPDiskConfig()) {
2930
TString config;
@@ -48,6 +49,7 @@ namespace NKikimr::NBsController {
4849
driveInfo.ReadCentric = false;
4950
driveInfo.Kind = 0;
5051
driveInfo.InferPDiskSlotCountFromUnitSize = 0;
52+
driveInfo.InferPDiskSlotCountMax = 0;
5153
driveInfo.PDiskConfig = defaultPDiskConfig;
5254

5355
for (const auto& path : field) {

ydb/core/mind/bscontroller/cmds_storage_pool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ namespace NKikimr::NBsController {
609609
x->SetExpectedSlotCount(pdisk.ExpectedSlotCount);
610610
x->SetDecommitStatus(NKikimrBlobStorage::EDecommitStatus::DECOMMIT_NONE);
611611
x->SetInferPDiskSlotCountFromUnitSize(pdisk.InferPDiskSlotCountFromUnitSize);
612+
x->SetInferPDiskSlotCountMax(pdisk.InferPDiskSlotCountMax);
612613
if (pdisk.PDiskMetrics) {
613614
x->MutablePDiskMetrics()->CopyFrom(*pdisk.PDiskMetrics);
614615
x->MutablePDiskMetrics()->ClearPDiskId();

ydb/core/mind/bscontroller/config.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ namespace NKikimr::NBsController {
116116
pdisk->SetExpectedSerial(pdiskInfo.ExpectedSerial);
117117
pdisk->SetManagementStage(Self->SerialManagementStage);
118118
pdisk->SetInferPDiskSlotCountFromUnitSize(pdiskInfo.InferPDiskSlotCountFromUnitSize);
119+
pdisk->SetInferPDiskSlotCountMax(pdiskInfo.InferPDiskSlotCountMax);
119120
if (pdiskInfo.PDiskConfig && !pdisk->MutablePDiskConfig()->ParseFromString(pdiskInfo.PDiskConfig)) {
120121
// TODO(alexvru): report this somehow
121122
}
@@ -973,6 +974,7 @@ namespace NKikimr::NBsController {
973974
drive.SetReadCentric(value.ReadCentric);
974975
drive.SetKind(value.Kind);
975976
drive.SetInferPDiskSlotCountFromUnitSize(value.InferPDiskSlotCountFromUnitSize);
977+
drive.SetInferPDiskSlotCountMax(value.InferPDiskSlotCountMax);
976978

977979
if (const auto& config = value.PDiskConfig) {
978980
NKikimrBlobStorage::TPDiskConfig& pb = *drive.MutablePDiskConfig();
@@ -1114,6 +1116,9 @@ namespace NKikimr::NBsController {
11141116
if (pdisk.InferPDiskSlotCountFromUnitSize) {
11151117
pb->SetInferPDiskSlotCountFromUnitSize(pdisk.InferPDiskSlotCountFromUnitSize);
11161118
}
1119+
if (pdisk.InferPDiskSlotCountMax) {
1120+
pb->SetInferPDiskSlotCountMax(pdisk.InferPDiskSlotCountMax);
1121+
}
11171122
}
11181123

11191124
void TBlobStorageController::Serialize(NKikimrBlobStorage::TVSlotId *pb, TVSlotId id) {

ydb/core/mind/bscontroller/config_fit_pdisks.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ namespace NKikimr {
191191
disk.Serial = serial;
192192
disk.SharedWithOs = driveInfo.SharedWithOs;
193193
disk.InferPDiskSlotCountFromUnitSize = driveInfo.InferPDiskSlotCountFromUnitSize;
194+
disk.InferPDiskSlotCountMax = driveInfo.InferPDiskSlotCountMax;
194195

195196
auto diskId = disk.GetId();
196197
auto [_, inserted] = disks.try_emplace(diskId, std::move(disk));

ydb/core/mind/bscontroller/register_node.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,9 @@ void TBlobStorageController::ReadPDisk(const TPDiskId& pdiskId, const TPDiskInfo
490490
if (pdisk.InferPDiskSlotCountFromUnitSize) {
491491
pDisk->SetInferPDiskSlotCountFromUnitSize(pdisk.InferPDiskSlotCountFromUnitSize);
492492
}
493+
if (pdisk.InferPDiskSlotCountMax) {
494+
pDisk->SetInferPDiskSlotCountMax(pdisk.InferPDiskSlotCountMax);
495+
}
493496
}
494497
pDisk->SetExpectedSerial(pdisk.ExpectedSerial);
495498
pDisk->SetManagementStage(SerialManagementStage);

0 commit comments

Comments
 (0)