Browse Source
Different disk labels should not use the same DiskUsages instance while master received volume heatbeat (#5770)
pull/5775/head
小羽
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
1 additions and
1 deletions
-
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) |
|
|
|