Revert "Revert "Merge branch 'master' of https://github.com/seaweedfs/seaweedfs""
This reverts commit 8cb42c39
This commit is contained in:
@@ -243,8 +243,8 @@ func (n *Node) selectVolumes(fn func(v *master_pb.VolumeInformationMessage) bool
|
||||
}
|
||||
|
||||
func sortWritableVolumes(volumes []*master_pb.VolumeInformationMessage) {
|
||||
slices.SortFunc(volumes, func(a, b *master_pb.VolumeInformationMessage) bool {
|
||||
return a.Size < b.Size
|
||||
slices.SortFunc(volumes, func(a, b *master_pb.VolumeInformationMessage) int {
|
||||
return int(a.Size - b.Size)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -269,8 +269,8 @@ func balanceSelectedVolume(commandEnv *CommandEnv, diskType types.DiskType, volu
|
||||
|
||||
for hasMoved {
|
||||
hasMoved = false
|
||||
slices.SortFunc(nodesWithCapacity, func(a, b *Node) bool {
|
||||
return a.localVolumeRatio(capacityFunc) < b.localVolumeRatio(capacityFunc)
|
||||
slices.SortFunc(nodesWithCapacity, func(a, b *Node) int {
|
||||
return int(a.localVolumeRatio(capacityFunc) - b.localVolumeRatio(capacityFunc))
|
||||
})
|
||||
if len(nodesWithCapacity) == 0 {
|
||||
fmt.Printf("no volume server found with capacity for %s", diskType.ReadableString())
|
||||
|
||||
Reference in New Issue
Block a user