avoid extra missing shard warning

fix https://github.com/seaweedfs/seaweedfs/issues/7956
This commit is contained in:
Chris Lu
2026-01-04 00:38:53 -08:00
parent 63b2fe0d76
commit 0b5a65e00b
2 changed files with 57 additions and 1 deletions

View File

@@ -333,7 +333,15 @@ func (erb *ecRebuilder) prepareDataToRecover(rebuilder *EcNode, collection strin
}
}
for i, ecNodes := range locations {
targetShardCount := erasure_coding.TotalShardsCount
for i := erasure_coding.TotalShardsCount; i < len(locations); i++ {
if len(locations[i]) > 0 {
targetShardCount = i + 1
}
}
for i := 0; i < targetShardCount; i++ {
ecNodes := locations[i]
shardId := erasure_coding.ShardId(i)
if len(ecNodes) == 0 {
erb.write("missing shard %d.%d\n", volumeId, shardId)