aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-12-24 00:00:45 -0800
committerChris Lu <chris.lu@gmail.com>2019-12-24 00:00:45 -0800
commit1ad34a2487a3e8625f5fea82e38431d0e54794b6 (patch)
tree389ae316cb23ecdb827ea58f3e872b507edce459
parenta18f62bbe7e5e477fd891849b44ec5a25d8988d2 (diff)
downloadseaweedfs-1ad34a2487a3e8625f5fea82e38431d0e54794b6.tar.xz
seaweedfs-1ad34a2487a3e8625f5fea82e38431d0e54794b6.zip
ed.decode prefers servers with most data shards
-rw-r--r--weed/shell/command_ec_decode.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/shell/command_ec_decode.go b/weed/shell/command_ec_decode.go
index 4ec1a7e8f..b49ab2c58 100644
--- a/weed/shell/command_ec_decode.go
+++ b/weed/shell/command_ec_decode.go
@@ -149,8 +149,9 @@ func collectEcShards(ctx context.Context, commandEnv *CommandEnv, nodeToEcIndexB
maxShardCount := 0
var exisitngEcIndexBits erasure_coding.ShardBits
for loc, ecIndexBits := range nodeToEcIndexBits {
- if ecIndexBits.ShardIdCount() > maxShardCount {
- maxShardCount = ecIndexBits.ShardIdCount()
+ toBeCopiedShardCount := ecIndexBits.MinusParityShards().ShardIdCount()
+ if toBeCopiedShardCount > maxShardCount {
+ maxShardCount = toBeCopiedShardCount
targetNodeLocation = loc
exisitngEcIndexBits = ecIndexBits
}