Browse Source

only copy required shards

pull/1167/head
Chris Lu 5 years ago
parent
commit
a18f62bbe7
  1. 2
      weed/shell/command_ec_decode.go
  2. 7
      weed/storage/erasure_coding/ec_volume_info.go

2
weed/shell/command_ec_decode.go

@ -164,7 +164,7 @@ func collectEcShards(ctx context.Context, commandEnv *CommandEnv, nodeToEcIndexB
continue
}
needToCopyEcIndexBits := ecIndexBits.Minus(exisitngEcIndexBits)
needToCopyEcIndexBits := ecIndexBits.Minus(exisitngEcIndexBits).MinusParityShards()
if needToCopyEcIndexBits.ShardIdCount() == 0 {
continue
}

7
weed/storage/erasure_coding/ec_volume_info.go

@ -104,3 +104,10 @@ func (b ShardBits) Minus(other ShardBits) ShardBits {
func (b ShardBits) Plus(other ShardBits) ShardBits {
return b | other
}
func (b ShardBits) MinusParityShards() ShardBits {
for i := DataShardsCount; i < TotalShardsCount; i++ {
b = b.RemoveShardId(ShardId(i))
}
return b
}
Loading…
Cancel
Save