|
|
@ -180,7 +180,7 @@ func moveAwayOneEcVolume(commandEnv *CommandEnv, ecShardInfo *master_pb.VolumeEc |
|
|
|
|
|
|
|
func moveAwayOneNormalVolume(commandEnv *CommandEnv, volumeReplicas map[uint32][]*VolumeReplica, vol *master_pb.VolumeInformationMessage, thisNode *Node, otherNodes []*Node, applyChange bool) (hasMoved bool, err error) { |
|
|
|
sort.Slice(otherNodes, func(i, j int) bool { |
|
|
|
return otherNodes[i].localVolumeRatio(capacityByMaxVolumeCount(types.ToDiskType(vol.DiskType))) < otherNodes[j].localVolumeRatio(capacityByMaxVolumeCount(types.ToDiskType(vol.DiskType))) |
|
|
|
return otherNodes[i].localVolumeRatio(capacityByFreeVolumeCount(types.ToDiskType(vol.DiskType))) > otherNodes[j].localVolumeRatio(capacityByFreeVolumeCount(types.ToDiskType(vol.DiskType))) |
|
|
|
}) |
|
|
|
|
|
|
|
for i := 0; i < len(otherNodes); i++ { |
|
|
|