If a NATS system has multiple domains make sure to process those during a remote update before bailing.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-05-13 18:36:42 -07:00
parent a982bbcb73
commit 75d274a636

View File

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