Skip to content

Commit e39f39c

Browse files
alexvruStekPerepolnen
authored andcommitted
Report LayoutCorrect for static groups too (#15036)
1 parent 4866f86 commit e39f39c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ydb/core/mind/bscontroller/sys_view.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "sys_view.h"
22
#include "group_geometry_info.h"
33
#include "storage_stats_calculator.h"
4+
#include "group_layout_checker.h"
45

56
#include <ydb/core/base/feature_flags.h>
67
#include <ydb/core/blobstorage/base/utility.h>
@@ -517,6 +518,7 @@ void TBlobStorageController::UpdateSystemViews() {
517518

518519
const NKikimrBlobStorage::TVDiskMetrics zero;
519520
std::vector<TGroupDiskInfo> disks;
521+
std::vector<TPDiskId> pdiskIds;
520522
for (const auto& realm : group.GetRings()) {
521523
for (const auto& domain : realm.GetFailDomains()) {
522524
for (const auto& location : domain.GetVDiskLocations()) {
@@ -532,10 +534,28 @@ void TBlobStorageController::UpdateSystemViews() {
532534
if (disk.VDiskMetrics && disk.PDiskMetrics) {
533535
disks.push_back(std::move(disk));
534536
}
537+
pdiskIds.emplace_back(location.GetNodeID(), location.GetPDiskID());
535538
}
536539
}
537540
}
538541
CalculateGroupUsageStats(pb, disks, (TBlobStorageGroupType::EErasureSpecies)group.GetErasureSpecies());
542+
543+
if (auto groupInfo = TBlobStorageGroupInfo::Parse(group, nullptr, nullptr)) {
544+
NLayoutChecker::TGroupLayout layout(groupInfo->GetTopology());
545+
NLayoutChecker::TDomainMapper mapper;
546+
TGroupGeometryInfo geom(groupInfo->Type, SelfManagementEnabled
547+
? StorageConfig.GetSelfManagementConfig().GetGeometry()
548+
: NKikimrBlobStorage::TGroupGeometry());
549+
550+
Y_DEBUG_ABORT_UNLESS(pdiskIds.size() == groupInfo->GetTotalVDisksNum());
551+
552+
for (size_t i = 0; i < pdiskIds.size(); ++i) {
553+
const TPDiskId pdiskId = pdiskIds[i];
554+
layout.AddDisk({mapper, HostRecords->GetLocation(pdiskId.NodeId), pdiskId, geom}, i);
555+
}
556+
557+
pb->SetLayoutCorrect(layout.IsCorrect());
558+
}
539559
}
540560
}
541561
}

0 commit comments

Comments
 (0)