Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions server/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -1735,18 +1735,18 @@ func (s *Server) remoteServerUpdate(sub *subscription, c *client, _ *Account, su
node := getHash(si.Name)
accountNRG := si.AccountNRG()
oldInfo, _ := s.nodeToInfo.Swap(node, nodeInfo{
si.Name,
si.Version,
si.Cluster,
si.Domain,
si.ID,
si.Tags,
cfg,
stats,
false,
si.JetStreamEnabled(),
si.BinaryStreamSnapshot(),
accountNRG,
name: si.Name,
version: si.Version,
cluster: si.Cluster,
domain: si.Domain,
id: si.ID,
tags: si.Tags,
cfg: cfg,
stats: stats,
offline: false,
js: si.JetStreamEnabled(),
binarySnapshots: si.BinaryStreamSnapshot(),
accountNRG: accountNRG,
})
if oldInfo == nil || accountNRG != oldInfo.(nodeInfo).accountNRG {
// One of the servers we received statsz from changed its mind about
Expand Down Expand Up @@ -1789,18 +1789,18 @@ func (s *Server) processNewServer(si *ServerInfo) {
// Only update if non-existent
if _, ok := s.nodeToInfo.Load(node); !ok {
s.nodeToInfo.Store(node, nodeInfo{
si.Name,
si.Version,
si.Cluster,
si.Domain,
si.ID,
si.Tags,
nil,
nil,
false,
si.JetStreamEnabled(),
si.BinaryStreamSnapshot(),
si.AccountNRG(),
name: si.Name,
version: si.Version,
cluster: si.Cluster,
domain: si.Domain,
id: si.ID,
tags: si.Tags,
cfg: nil,
stats: nil,
offline: false,
js: si.JetStreamEnabled(),
binarySnapshots: si.BinaryStreamSnapshot(),
accountNRG: si.AccountNRG(),
})
}
}
Expand Down
16 changes: 14 additions & 2 deletions server/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -2346,8 +2346,20 @@ func (s *Server) addRoute(c *client, didSolicit, sendDelayedInfo bool, gossipMod
if doOnce {
// check to be consistent and future proof. but will be same domain
if s.sameDomain(info.Domain) {
s.nodeToInfo.Store(rHash,
nodeInfo{rn, s.info.Version, s.info.Cluster, info.Domain, id, nil, nil, nil, false, info.JetStream, false, false})
s.nodeToInfo.Store(rHash, nodeInfo{
name: rn,
version: s.info.Version,
cluster: s.info.Cluster,
domain: info.Domain,
id: id,
tags: nil,
cfg: nil,
stats: nil,
offline: false,
js: info.JetStream,
binarySnapshots: true, // Updated default to true. Versions 2.10.0+ support it.
accountNRG: false,
})
}
}

Expand Down
21 changes: 12 additions & 9 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -841,15 +841,18 @@ func NewServer(opts *Options) (*Server, error) {
if opts.JetStream {
ourNode := getHash(serverName)
s.nodeToInfo.Store(ourNode, nodeInfo{
serverName,
VERSION,
opts.Cluster.Name,
opts.JetStreamDomain,
info.ID,
opts.Tags,
&JetStreamConfig{MaxMemory: opts.JetStreamMaxMemory, MaxStore: opts.JetStreamMaxStore, CompressOK: true},
nil,
false, true, true, true,
name: serverName,
version: VERSION,
cluster: opts.Cluster.Name,
domain: opts.JetStreamDomain,
id: info.ID,
tags: opts.Tags,
cfg: &JetStreamConfig{MaxMemory: opts.JetStreamMaxMemory, MaxStore: opts.JetStreamMaxStore, CompressOK: true},
stats: nil,
offline: false,
js: true,
binarySnapshots: true,
accountNRG: true,
})
}

Expand Down