only copy required shards
This commit is contained in:
@@ -164,7 +164,7 @@ func collectEcShards(ctx context.Context, commandEnv *CommandEnv, nodeToEcIndexB
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
needToCopyEcIndexBits := ecIndexBits.Minus(exisitngEcIndexBits)
|
needToCopyEcIndexBits := ecIndexBits.Minus(exisitngEcIndexBits).MinusParityShards()
|
||||||
if needToCopyEcIndexBits.ShardIdCount() == 0 {
|
if needToCopyEcIndexBits.ShardIdCount() == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,3 +104,10 @@ func (b ShardBits) Minus(other ShardBits) ShardBits {
|
|||||||
func (b ShardBits) Plus(other ShardBits) ShardBits {
|
func (b ShardBits) Plus(other ShardBits) ShardBits {
|
||||||
return b | other
|
return b | other
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b ShardBits) MinusParityShards() ShardBits {
|
||||||
|
for i := DataShardsCount; i < TotalShardsCount; i++ {
|
||||||
|
b = b.RemoveShardId(ShardId(i))
|
||||||
|
}
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user