From e8537d7172f5aafcc97c60cb8e50b831e467c351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=BE=BD?= Date: Fri, 12 Jul 2024 23:09:51 +0800 Subject: [PATCH] Different disk labels should not use the same DiskUsages instance while master received volume heatbeat (#5770) --- weed/topology/data_node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go index 5e48056f7..715b5ed80 100644 --- a/weed/topology/data_node.go +++ b/weed/topology/data_node.go @@ -135,12 +135,12 @@ func (dn *DataNode) DeltaUpdateVolumes(newVolumes, deletedVolumes []storage.Volu } func (dn *DataNode) AdjustMaxVolumeCounts(maxVolumeCounts map[string]uint32) { - deltaDiskUsages := newDiskUsages() for diskType, maxVolumeCount := range maxVolumeCounts { if maxVolumeCount == 0 { // the volume server may have set the max to zero continue } + deltaDiskUsages := newDiskUsages() dt := types.ToDiskType(diskType) currentDiskUsage := dn.diskUsages.getOrCreateDisk(dt) currentDiskUsageMaxVolumeCount := atomic.LoadInt64(¤tDiskUsage.maxVolumeCount)