mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
only copy required shards
This commit is contained in:
parent
c7d5a0b00c
commit
a18f62bbe7
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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…
Reference in a new issue