Browse Source

ed.decode prefers servers with most data shards

pull/1171/head
Chris Lu 5 years ago
parent
commit
1ad34a2487
  1. 5
      weed/shell/command_ec_decode.go

5
weed/shell/command_ec_decode.go

@ -149,8 +149,9 @@ func collectEcShards(ctx context.Context, commandEnv *CommandEnv, nodeToEcIndexB
maxShardCount := 0 maxShardCount := 0
var exisitngEcIndexBits erasure_coding.ShardBits var exisitngEcIndexBits erasure_coding.ShardBits
for loc, ecIndexBits := range nodeToEcIndexBits { for loc, ecIndexBits := range nodeToEcIndexBits {
if ecIndexBits.ShardIdCount() > maxShardCount {
maxShardCount = ecIndexBits.ShardIdCount()
toBeCopiedShardCount := ecIndexBits.MinusParityShards().ShardIdCount()
if toBeCopiedShardCount > maxShardCount {
maxShardCount = toBeCopiedShardCount
targetNodeLocation = loc targetNodeLocation = loc
exisitngEcIndexBits = ecIndexBits exisitngEcIndexBits = ecIndexBits
} }

Loading…
Cancel
Save