ec shard balancing

This commit is contained in:
Chris Lu
2019-06-10 21:32:56 -07:00
parent 9d9162ca35
commit f9d8bd51ad
6 changed files with 630 additions and 164 deletions

View File

@@ -123,7 +123,7 @@ func generateEcShards(ctx context.Context, grpcDialOption grpc.DialOption, volum
func spreadEcShards(ctx context.Context, commandEnv *CommandEnv, volumeId needle.VolumeId, collection string, existingLocations []wdclient.Location) (err error) {
allEcNodes, totalFreeEcSlots, err := collectEcNodes(ctx, commandEnv)
allEcNodes, totalFreeEcSlots, err := collectEcNodes(ctx, commandEnv, "")
if err != nil {
return err
}
@@ -191,7 +191,7 @@ func parallelCopyEcShardsFromSource(ctx context.Context, grpcDialOption grpc.Dia
err = copyErr
} else {
shardIdChan <- copiedShardIds
server.freeEcSlot -= len(copiedShardIds)
server.addEcVolumeShards(volumeId, collection, copiedShardIds)
}
}(server, startFromShardId, allocated[i])
startFromShardId += uint32(allocated[i])