Skip to content

Commit

Permalink
[FIXED] Track all remote servers in a NATS system with different doma…
Browse files Browse the repository at this point in the history
…ins. (#4159)

Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison committed May 15, 2023
2 parents 3c4ed54 + 75d274a commit ea75bea
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions server/events.go
Expand Up @@ -1268,6 +1268,13 @@ func (s *Server) remoteServerUpdate(sub *subscription, c *client, _ *Account, su
}
si := ssm.Server

// Should do normal updates before bailing if wrong domain.
s.mu.Lock()
if s.running && s.eventsEnabled() && ssm.Server.ID != s.info.ID {
s.updateRemoteServer(&si)
}
s.mu.Unlock()

// JetStream node updates.
if !s.sameDomain(si.Domain) {
return
Expand All @@ -1293,11 +1300,6 @@ func (s *Server) remoteServerUpdate(sub *subscription, c *client, _ *Account, su
stats,
false, si.JetStream,
})
s.mu.Lock()
if s.running && s.eventsEnabled() && ssm.Server.ID != s.info.ID {
s.updateRemoteServer(&si)
}
s.mu.Unlock()
}

// updateRemoteServer is called when we have an update from a remote server.
Expand Down

0 comments on commit ea75bea

Please sign in to comment.