aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_common_test.go
diff options
context:
space:
mode:
authorLisandro Pin <lisandro.pin@proton.ch>2025-01-30 18:26:45 +0100
committerGitHub <noreply@github.com>2025-01-30 09:26:45 -0800
commit331c1f0f3f1a227b76a6752aa051c031a3655903 (patch)
tree50ef161c8afe956da68d190fcde451dc23563891 /weed/shell/command_ec_common_test.go
parent551baa44b2f0884187a582f740ace515214ea34e (diff)
downloadseaweedfs-331c1f0f3f1a227b76a6752aa051c031a3655903.tar.xz
seaweedfs-331c1f0f3f1a227b76a6752aa051c031a3655903.zip
Improve EC shards balancing logic regarding replica placement settings. (#6491)
The replica placement type specifies numebr of _replicas_ on the same/different rack; that means we can have one EC shard copy on each, even if the replica setting is zero. This PR reworks replica placement parsing for EC rebalancing, so we check allow (replica placement + 1) when selecting racks and nodes to balance EC shards into.
Diffstat (limited to 'weed/shell/command_ec_common_test.go')
-rw-r--r--weed/shell/command_ec_common_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/shell/command_ec_common_test.go b/weed/shell/command_ec_common_test.go
index f76840f3c..87cf371d7 100644
--- a/weed/shell/command_ec_common_test.go
+++ b/weed/shell/command_ec_common_test.go
@@ -138,8 +138,8 @@ func TestPickRackToBalanceShardsInto(t *testing.T) {
{topologyEc, "6241", "123", []string{"rack1", "rack2", "rack3", "rack4", "rack5", "rack6"}, ""},
{topologyEc, "6242", "123", []string{"rack1", "rack2", "rack3", "rack4", "rack5", "rack6"}, ""},
// EC volumes.
- {topologyEc, "9577", "", nil, "shards 1 >= replica placement limit for other racks (0)"},
- {topologyEc, "9577", "111", nil, "shards 1 >= replica placement limit for other racks (1)"},
+ {topologyEc, "9577", "", nil, "shards 1 > replica placement limit for other racks (0)"},
+ {topologyEc, "9577", "111", []string{"rack1", "rack2", "rack3"}, ""},
{topologyEc, "9577", "222", []string{"rack1", "rack2", "rack3"}, ""},
{topologyEc, "10457", "222", []string{"rack1"}, ""},
{topologyEc, "12737", "222", []string{"rack2"}, ""},