mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(clustermgr): exclude old disk items which has empty node
. #1000925801 Signed-off-by: slasher <shenjie1@oppo.com>
This commit is contained in:
parent
8a4928b804
commit
5a17858611
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user