From 64c5dde2f321dbdc24b3cdc00a17c7b6b2c8f0bd Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 15 Jul 2025 10:51:00 -0700 Subject: support multiple masters fix https://github.com/seaweedfs/seaweedfs/issues/6988 --- weed/admin/dash/client_management.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'weed/admin/dash/client_management.go') diff --git a/weed/admin/dash/client_management.go b/weed/admin/dash/client_management.go index 7bebc6dd2..974d996fc 100644 --- a/weed/admin/dash/client_management.go +++ b/weed/admin/dash/client_management.go @@ -16,11 +16,7 @@ import ( // WithMasterClient executes a function with a master client connection func (s *AdminServer) WithMasterClient(f func(client master_pb.SeaweedClient) error) error { - masterAddr := pb.ServerAddress(s.masterAddress) - - return pb.WithMasterClient(false, masterAddr, s.grpcDialOption, false, func(client master_pb.SeaweedClient) error { - return f(client) - }) + return s.masterClient.WithClient(false, f) } // WithFilerClient executes a function with a filer client connection @@ -78,7 +74,8 @@ func (s *AdminServer) getDiscoveredFilers() []string { }) if err != nil { - glog.Warningf("Failed to discover filers from master %s: %v", s.masterAddress, err) + currentMaster := s.masterClient.GetMaster(context.Background()) + glog.Warningf("Failed to discover filers from master %s: %v", currentMaster, err) // Return cached filers even if expired, better than nothing return s.cachedFilers } -- cgit v1.2.3