From af7cf6ab8a9c3533788f20676714c8cb30480bcc Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 7 Aug 2026 01:27:40 -0700 Subject: [PATCH] chore(weed/topology): drop the unused DataNode volume id listing (#10618) GetVolumeIds ranged over a slice and collected the loop indices, so it reported 0-99 rather than the node's volume ids. Nothing calls it: the disk-level GetVolumeIds, which ranges over a map and is correct, is what ToDiskInfo and ToMap use. Its private getVolumes helper went with it, having no other caller. --- weed/topology/data_node.go | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go index 8c013f001..8c8a43343 100644 --- a/weed/topology/data_node.go +++ b/weed/topology/data_node.go @@ -2,7 +2,6 @@ package topology import ( "fmt" - "slices" "sync/atomic" "github.com/seaweedfs/seaweedfs/weed/glog" @@ -392,28 +391,3 @@ func (dn *DataNode) UpdateDiskTags(tags []*master_pb.DiskTag) { dn.diskMetas = metas dn.Unlock() } - -// GetVolumeIds returns the human readable volume ids limited to count of max 100. -func (dn *DataNode) GetVolumeIds() string { - dn.RLock() - defer dn.RUnlock() - existingVolumes := dn.getVolumes() - ids := make([]int, 0, len(existingVolumes)) - - for k := range existingVolumes { - ids = append(ids, int(k)) - } - - slices.Sort(ids) - - return util.HumanReadableIntsMax(100, ids...) -} - -func (dn *DataNode) getVolumes() []storage.VolumeInfo { - var existingVolumes []storage.VolumeInfo - for _, c := range dn.children { - disk := c.(*Disk) - existingVolumes = append(existingVolumes, disk.GetVolumes()...) - } - return existingVolumes -}