Skip to content

Commit 340fbf8

Browse files
authored
Report LayoutCorrect for static groups too (#15036)
1 parent 735715d commit 340fbf8

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>
@@ -519,6 +520,7 @@ void TBlobStorageController::UpdateSystemViews() {
519520

520521
const NKikimrBlobStorage::TVDiskMetrics zero;
521522
std::vector<TGroupDiskInfo> disks;
523+
std::vector<TPDiskId> pdiskIds;
522524
for (const auto& realm : group.GetRings()) {
523525
for (const auto& domain : realm.GetFailDomains()) {
524526
for (const auto& location : domain.GetVDiskLocations()) {
@@ -534,10 +536,28 @@ void TBlobStorageController::UpdateSystemViews() {
534536
if (disk.VDiskMetrics && disk.PDiskMetrics) {
535537
disks.push_back(std::move(disk));
536538
}
539+
pdiskIds.emplace_back(location.GetNodeID(), location.GetPDiskID());
537540
}
538541
}
539542
}
540543
CalculateGroupUsageStats(pb, disks, (TBlobStorageGroupType::EErasureSpecies)group.GetErasureSpecies());
544+
545+
if (auto groupInfo = TBlobStorageGroupInfo::Parse(group, nullptr, nullptr)) {
546+
NLayoutChecker::TGroupLayout layout(groupInfo->GetTopology());
547+
NLayoutChecker::TDomainMapper mapper;
548+
TGroupGeometryInfo geom(groupInfo->Type, SelfManagementEnabled
549+
? StorageConfig.GetSelfManagementConfig().GetGeometry()
550+
: NKikimrBlobStorage::TGroupGeometry());
551+
552+
Y_DEBUG_ABORT_UNLESS(pdiskIds.size() == groupInfo->GetTotalVDisksNum());
553+
554+
for (size_t i = 0; i < pdiskIds.size(); ++i) {
555+
const TPDiskId pdiskId = pdiskIds[i];
556+
layout.AddDisk({mapper, HostRecords->GetLocation(pdiskId.NodeId), pdiskId, geom}, i);
557+
}
558+
559+
pb->SetLayoutCorrect(layout.IsCorrect());
560+
}
541561
}
542562
}
543563
}

0 commit comments

Comments
 (0)