aboutsummaryrefslogtreecommitdiff
path: root/weed/wdclient
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-06-27 21:47:05 +0500
committerKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-06-27 21:47:05 +0500
commit6c20a3b622c431f3245c9996b8ca093bd768c106 (patch)
tree17866b2648951b7547d0058d97ee1e8b1a180aaf /weed/wdclient
parentb9f7b6fb9a486a9509db7ca800c9f876911413ad (diff)
downloadseaweedfs-6c20a3b622c431f3245c9996b8ca093bd768c106.tar.xz
seaweedfs-6c20a3b622c431f3245c9996b8ca093bd768c106.zip
avoid set currentMaster k8s svc.local discoveruy service domains
https://github.com/chrislusf/seaweedfs/issues/2589
Diffstat (limited to 'weed/wdclient')
-rw-r--r--weed/wdclient/masterclient.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go
index fb681b523..0e58a3753 100644
--- a/weed/wdclient/masterclient.go
+++ b/weed/wdclient/masterclient.go
@@ -168,8 +168,8 @@ func (mc *MasterClient) tryConnectToMaster(master pb.ServerAddress) (nextHintedL
}
// check if it is the leader to determine whether to reset the vidMap
- if resp.VolumeLocation != nil && resp.VolumeLocation.Leader != "" {
- glog.V(0).Infof("redirected to leader %v", resp.VolumeLocation.Leader)
+ if resp.VolumeLocation != nil && resp.VolumeLocation.Leader != "" && string(master) != resp.VolumeLocation.Leader {
+ glog.V(0).Infof("master %v redirected to leader %v", master, resp.VolumeLocation.Leader)
nextHintedLeader = pb.ServerAddress(resp.VolumeLocation.Leader)
stats.MasterClientConnectCounter.WithLabelValues(stats.RedirectedToleader).Inc()
return nil