calculate disk usage in case of race condition

related to https://github.com/chrislusf/seaweedfs/issues/2357
This commit is contained in:
Chris Lu 2021-10-04 23:32:07 -07:00
parent 4ed2994555
commit 8a66306064

View file

@ -110,6 +110,9 @@ func (dn *DataNode) DeltaUpdateVolumes(newVolumes, deletedVolumes []storage.Volu
for _, v := range deletedVolumes { for _, v := range deletedVolumes {
disk := dn.getOrCreateDisk(v.DiskType) disk := dn.getOrCreateDisk(v.DiskType)
if _, found := disk.volumes[v.Id]; !found {
continue
}
delete(disk.volumes, v.Id) delete(disk.volumes, v.Id)
deltaDiskUsages := newDiskUsages() deltaDiskUsages := newDiskUsages()