avoid set currentMaster k8s svc.local discoveruy service domains

https://github.com/chrislusf/seaweedfs/issues/2589
This commit is contained in:
Konstantin Lebedev
2022-06-27 21:47:05 +05:00
parent b9f7b6fb9a
commit 6c20a3b622
3 changed files with 9 additions and 5 deletions

View File

@@ -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