mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
* master: warn when a volume server registers in the default data center or rack A volume server started without -dataCenter or -rack lands in DefaultDataCenter/DefaultRack. Next to servers with explicit placement it becomes its own failure domain for placement and balancing. Log a warning when such a server registers while other servers name their data center, or other racks of the same data center are named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: warn about volume servers left in the default data center or rack The Volume Servers page lists the servers that fell back to DefaultDataCenter or DefaultRack while other servers name theirs, with their volume and EC shard counts, so the stray failure domain shows up before placement and balancing act on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: cluster.check warns about volume servers in the default data center or rack Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: cluster.check prints placement warnings before the capacity checks A disk type with no free slots made cluster.check return before the default data center/rack warnings were printed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: list each data center's rack once in the default placement check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.1 KiB
Go
32 lines
1.1 KiB
Go
package dash
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/topology"
|
|
)
|
|
|
|
func TestDefaultPlacementServers(t *testing.T) {
|
|
servers := []VolumeServer{
|
|
{Address: "a:8080", DataCenter: "dc1", Rack: "r1", Volumes: 3},
|
|
{Address: "b:8080", DataCenter: "dc1", Rack: "r2"},
|
|
{Address: "c:8080", DataCenter: topology.DefaultDataCenter, Rack: topology.DefaultRack, EcShards: 2030},
|
|
{Address: "d:8080", DataCenter: "dc1", Rack: topology.DefaultRack},
|
|
}
|
|
got := defaultPlacementServers(servers)
|
|
if len(got) != 2 || got[0].Address != "c:8080" || got[1].Address != "d:8080" {
|
|
t.Fatalf("defaultPlacementServers = %+v, want c:8080 and d:8080", got)
|
|
}
|
|
if got[0].EcShards != 2030 {
|
|
t.Fatalf("EC shard count not carried: %d", got[0].EcShards)
|
|
}
|
|
|
|
allDefault := []VolumeServer{
|
|
{Address: "a:8080", DataCenter: topology.DefaultDataCenter, Rack: topology.DefaultRack},
|
|
{Address: "b:8080", DataCenter: topology.DefaultDataCenter, Rack: topology.DefaultRack},
|
|
}
|
|
if got := defaultPlacementServers(allDefault); len(got) != 0 {
|
|
t.Fatalf("all-default cluster flagged: %+v", got)
|
|
}
|
|
}
|