mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-21 02:17:57 +08:00
correcting free volume count, factor it during ec encoding to ensure enough disk space available
fix https://github.com/seaweedfs/seaweedfs/issues/6163
This commit is contained in:
@@ -315,15 +315,31 @@ func collectVolumeIdsForEcEncode(commandEnv *CommandEnv, selectedCollection stri
|
||||
}
|
||||
if v.Collection == selectedCollection && v.ModifiedAtSecond+quietSeconds < nowUnixSeconds {
|
||||
if float64(v.Size) > fullPercentage/100*float64(volumeSizeLimitMb)*1024*1024 {
|
||||
vidMap[v.Id] = true
|
||||
if good, found := vidMap[v.Id]; found {
|
||||
if good {
|
||||
if diskInfo.FreeVolumeCount < 1 {
|
||||
glog.V(0).Infof("skip %d.%d on %s, no free disk", v.Id, v.Collection, dn.Id)
|
||||
vidMap[v.Id] = false
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if diskInfo.FreeVolumeCount < 1 {
|
||||
glog.V(0).Infof("skip %d.%d on %s, no free disk", v.Id, v.Collection, dn.Id)
|
||||
vidMap[v.Id] = false
|
||||
} else {
|
||||
vidMap[v.Id] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
for vid := range vidMap {
|
||||
vids = append(vids, needle.VolumeId(vid))
|
||||
for vid, good := range vidMap {
|
||||
if good {
|
||||
vids = append(vids, needle.VolumeId(vid))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
|
Reference in New Issue
Block a user