add sortEcNodesByFreeslotsDecending and sortEcNodesByFreeslotsAscending

addressing https://github.com/chrislusf/seaweedfs/issues/1111
This commit is contained in:
Chris Lu
2019-11-12 13:47:36 -08:00
parent f056baa384
commit 40514c5362
3 changed files with 11 additions and 5 deletions

View File

@@ -111,7 +111,7 @@ func rebuildEcVolumes(commandEnv *CommandEnv, allEcNodes []*EcNode, collection s
return fmt.Errorf("ec volume %d is unrepairable with %d shards\n", vid, shardCount)
}
sortEcNodes(allEcNodes)
sortEcNodesByFreeslotsDecending(allEcNodes)
if allEcNodes[0].freeEcSlot < erasure_coding.TotalShardsCount {
return fmt.Errorf("disk space is not enough")