Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

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

Chris Lucde2d65c16f6
diff --git a/weed/shell/command_ec_common.go b/weed/shell/command_ec_common.go
index 0f8430cab0..8bef78394c 100644
--- a/weed/shell/command_ec_common.go
+++ b/weed/shell/command_ec_common.go
@@ -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
}