fix(clustermgr): exclude old disk items which has empty node

. #1000925801

Signed-off-by: slasher <shenjie1@oppo.com>
This commit is contained in:
slasher 2026-06-02 16:49:57 +08:00
parent 8a4928b804
commit 5a17858611

View File

@ -398,6 +398,13 @@ func buildDisk(snaps []clustermgr.BlobNodeDiskInfo, droppedNodes map[proto.NodeI
for _, e := range slotMax {
s := e.snap
// Legacy disks from before node-id tracking: NodeID==0 with Repaired status means
// the node was decommissioned before node tracking existed; count as repaired but
// exclude from __total__ (no physical slot to track).
if s.NodeID == 0 && s.Status == proto.DiskStatusRepaired {
addEntry(proto.DiskStatusRepaired.String(), s.Idc, &s.DiskHeartBeatInfo)
continue
}
// Node is Dropped → treat all its disks as dropped regardless of disk status.
if _, nodeDropped := droppedNodes[s.NodeID]; nodeDropped || s.Status == proto.DiskStatusDropped {
addEntry(proto.DiskStatusDropped.String(), s.Idc, &s.DiskHeartBeatInfo)