Mixed mode improvements.

1. When in mixed mode and only running the global account we now will check the account for JS.
2. Added code to decrease the cluster set size if we guessed wrong in mixed mode setup.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2021-04-09 14:20:55 -07:00
parent da4430fc8d
commit e438d2f5fa
6 changed files with 165 additions and 5 deletions

View File

@@ -912,7 +912,7 @@ func (s *Server) remoteServerShutdown(sub *subscription, _ *client, subject, rep
}
// Additional processing here.
node := string(getHash(si.Name))
s.nodeToInfo.Store(node, nodeInfo{si.Name, si.Cluster, si.ID, true})
s.nodeToInfo.Store(node, nodeInfo{si.Name, si.Cluster, si.ID, true, true})
}
// remoteServerUpdate listens for statsz updates from other servers.
@@ -930,7 +930,7 @@ func (s *Server) remoteServerUpdate(sub *subscription, _ *client, subject, reply
s.sendStatsz(fmt.Sprintf(serverStatsSubj, s.info.ID))
s.mu.Unlock()
}
s.nodeToInfo.Store(node, nodeInfo{si.Name, si.Cluster, si.ID, false})
s.nodeToInfo.Store(node, nodeInfo{si.Name, si.Cluster, si.ID, false, si.JetStream})
}
// updateRemoteServer is called when we have an update from a remote server.
@@ -961,7 +961,7 @@ func (s *Server) processNewServer(ms *ServerInfo) {
s.ensureGWsInterestOnlyForLeafNodes()
// Add to our nodeToName
node := string(getHash(ms.Name))
s.nodeToInfo.Store(node, nodeInfo{ms.Name, ms.Cluster, ms.ID, false})
s.nodeToInfo.Store(node, nodeInfo{ms.Name, ms.Cluster, ms.ID, false, ms.JetStream})
}
// If GW is enabled on this server and there are any leaf node connections,