diff --git a/server/monitor.go b/server/monitor.go index 11d85a8e..700f3345 100644 --- a/server/monitor.go +++ b/server/monitor.go @@ -740,6 +740,7 @@ func (s *Server) HandleConnz(w http.ResponseWriter, r *http.Request) { // Routez represents detailed information on current client connections. type Routez struct { ID string `json:"server_id"` + Name string `json:"server_name"` Now time.Time `json:"now"` Import *SubjectPermission `json:"import,omitempty"` Export *SubjectPermission `json:"export,omitempty"` @@ -759,6 +760,7 @@ type RoutezOptions struct { type RouteInfo struct { Rid uint64 `json:"rid"` RemoteID string `json:"remote_id"` + RemoteName string `json:"remote_name"` DidSolicit bool `json:"did_solicit"` IsConfigured bool `json:"is_configured"` IP string `json:"ip"` @@ -801,12 +803,14 @@ func (s *Server) Routez(routezOpts *RoutezOptions) (*Routez, error) { rs.Import = perms.Import rs.Export = perms.Export } + rs.Name = s.getOpts().ServerName addRoute := func(r *client) { r.mu.Lock() ri := &RouteInfo{ Rid: r.cid, RemoteID: r.route.remoteID, + RemoteName: r.route.remoteName, DidSolicit: r.route.didSolicit, IsConfigured: r.route.routeType == Explicit, InMsgs: atomic.LoadInt64(&r.inMsgs), diff --git a/server/raft.go b/server/raft.go index 9c7f7405..0c2d2021 100644 --- a/server/raft.go +++ b/server/raft.go @@ -2927,7 +2927,8 @@ func (n *raft) processAppendEntry(ae *appendEntry, sub *subscription) { // Are we receiving from another leader. if n.state == Leader { - if ae.term > n.term { + // If we are the same we should step down to break the tie. + if ae.term >= n.term { n.term = ae.term n.vote = noVote n.writeTermVote()