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.

Worker maintenance tasks now use non-default grpcPort if configured (#8407)

Chris Lu998c8d270285
diff --git a/weed/plugin/worker/vacuum_handler.go b/weed/plugin/worker/vacuum_handler.go
index ec0ebf056d..6326a45b1a 100644
--- a/weed/plugin/worker/vacuum_handler.go
+++ b/weed/plugin/worker/vacuum_handler.go
@@ -575,7 +575,7 @@ func buildVolumeMetrics(
metric := &workertypes.VolumeHealthMetrics{
VolumeID: volume.Id,
Server: node.Id,
- ServerAddress: node.Address,
+ ServerAddress: string(pb.NewServerAddressFromDataNode(node)),
DiskType: diskType,
DiskId: volume.DiskId,
DataCenter: dc.Id,
diff --git a/weed/worker/tasks/util/address.go b/weed/worker/tasks/util/address.go
index 516edb8dba..994acbff4c 100644
--- a/weed/worker/tasks/util/address.go
+++ b/weed/worker/tasks/util/address.go
@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/admin/topology"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
)
// ResolveServerAddress resolves a server ID to its network address using the active topology
@@ -16,8 +17,7 @@ func ResolveServerAddress(serverID string, activeTopology *topology.ActiveTopolo
if !exists {
return "", fmt.Errorf("server %s not found in topology", serverID)
}
- if nodeInfo.Address == "" {
- return "", fmt.Errorf("server %s has no address in topology", serverID)
- }
- return nodeInfo.Address, nil
+ // Note: We use NewServerAddressFromDataNode here because it encodes the GRPC port into the server address
+ // if it is non-zero, avoiding the default +10000 GRPC port offset.
+ return string(pb.NewServerAddressFromDataNode(nodeInfo)), nil
}