Browse Source

Different disk labels should not use the same DiskUsages instance while master received volume heatbeat (#5770)

pull/5775/head
小羽 6 months ago
committed by GitHub
parent
commit
e8537d7172
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      weed/topology/data_node.go

2
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) { func (dn *DataNode) AdjustMaxVolumeCounts(maxVolumeCounts map[string]uint32) {
deltaDiskUsages := newDiskUsages()
for diskType, maxVolumeCount := range maxVolumeCounts { for diskType, maxVolumeCount := range maxVolumeCounts {
if maxVolumeCount == 0 { if maxVolumeCount == 0 {
// the volume server may have set the max to zero // the volume server may have set the max to zero
continue continue
} }
deltaDiskUsages := newDiskUsages()
dt := types.ToDiskType(diskType) dt := types.ToDiskType(diskType)
currentDiskUsage := dn.diskUsages.getOrCreateDisk(dt) currentDiskUsage := dn.diskUsages.getOrCreateDisk(dt)
currentDiskUsageMaxVolumeCount := atomic.LoadInt64(&currentDiskUsage.maxVolumeCount) currentDiskUsageMaxVolumeCount := atomic.LoadInt64(&currentDiskUsage.maxVolumeCount)

Loading…
Cancel
Save