currentMaster redirected

This commit is contained in:
Konstantin Lebedev 2022-06-27 21:55:16 +05:00
parent 6c20a3b622
commit 9bff097b01

View file

@ -188,8 +188,8 @@ func (mc *MasterClient) tryConnectToMaster(master pb.ServerAddress) (nextHintedL
if resp.VolumeLocation != nil { if resp.VolumeLocation != nil {
// maybe the leader is changed // maybe the leader is changed
if resp.VolumeLocation.Leader != "" { if resp.VolumeLocation.Leader != "" && string(mc.currentMaster) != resp.VolumeLocation.Leader {
glog.V(0).Infof("redirected to leader %v", resp.VolumeLocation.Leader) glog.V(0).Infof("currentMaster %v redirected to leader %v", mc.currentMaster, resp.VolumeLocation.Leader)
nextHintedLeader = pb.ServerAddress(resp.VolumeLocation.Leader) nextHintedLeader = pb.ServerAddress(resp.VolumeLocation.Leader)
stats.MasterClientConnectCounter.WithLabelValues(stats.RedirectedToleader).Inc() stats.MasterClientConnectCounter.WithLabelValues(stats.RedirectedToleader).Inc()
return nil return nil