ec candidate selection needs to adjust same rack count compare (#7106)

ec needs to adjust same rack count compare
This commit is contained in:
Chris Lu 2025-08-07 00:09:51 -07:00 committed by GitHub
parent b4d9618efc
commit cde2d65c16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -932,8 +932,8 @@ func (ecb *ecBalancer) pickEcNodeToBalanceShardsInto(vid needle.VolumeId, existi
}
shards := nodeShards[node]
if ecb.replicaPlacement != nil && shards > ecb.replicaPlacement.SameRackCount {
details += fmt.Sprintf(" Skipped %s because shards %d > replica placement limit for the rack (%d)\n", node.info.Id, shards, ecb.replicaPlacement.SameRackCount)
if ecb.replicaPlacement != nil && shards > ecb.replicaPlacement.SameRackCount+1 {
details += fmt.Sprintf(" Skipped %s because shards %d > replica placement limit for the rack (%d + 1)\n", node.info.Id, shards, ecb.replicaPlacement.SameRackCount)
continue
}