mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-14 10:10:42 -07:00
Merge pull request #1938 from ripienaar/replication_info
ensure sources and mirror info is in stream list
This commit is contained in:
@@ -1353,7 +1353,7 @@ func (s *Server) jsStreamListRequest(sub *subscription, c *client, subject, repl
|
||||
}
|
||||
|
||||
for _, mset := range msets[offset:] {
|
||||
resp.Streams = append(resp.Streams, &StreamInfo{Created: mset.createdTime(), State: mset.state(), Config: mset.config()})
|
||||
resp.Streams = append(resp.Streams, &StreamInfo{Created: mset.createdTime(), State: mset.state(), Config: mset.config(), Mirror: mset.mirrorInfo(), Sources: mset.sourcesInfo()})
|
||||
if len(resp.Streams) >= JSApiListLimit {
|
||||
break
|
||||
}
|
||||
|
||||
@@ -1549,7 +1549,7 @@ func (js *jetStream) processStreamLeaderChange(mset *stream, isLeader bool) {
|
||||
resp.Error = jsError(err)
|
||||
s.sendAPIErrResponse(client, acc, subject, reply, _EMPTY_, s.jsonResponse(&resp))
|
||||
} else {
|
||||
resp.StreamInfo = &StreamInfo{Created: mset.createdTime(), State: mset.state(), Config: mset.config(), Cluster: js.clusterInfo(mset.raftGroup())}
|
||||
resp.StreamInfo = &StreamInfo{Created: mset.createdTime(), State: mset.state(), Config: mset.config(), Cluster: js.clusterInfo(mset.raftGroup()), Sources: mset.sourcesInfo(), Mirror: mset.mirrorInfo()}
|
||||
s.sendAPIResponse(client, acc, subject, reply, _EMPTY_, s.jsonResponse(&resp))
|
||||
if node := mset.raftNode(); node != nil {
|
||||
mset.sendCreateAdvisory()
|
||||
@@ -1831,7 +1831,7 @@ func (js *jetStream) processClusterUpdateStream(acc *Account, sa *streamAssignme
|
||||
resp.Error = jsError(err)
|
||||
s.sendAPIErrResponse(client, acc, subject, reply, _EMPTY_, s.jsonResponse(&resp))
|
||||
} else {
|
||||
resp.StreamInfo = &StreamInfo{Created: mset.createdTime(), State: mset.state(), Config: mset.config(), Cluster: js.clusterInfo(mset.raftGroup())}
|
||||
resp.StreamInfo = &StreamInfo{Created: mset.createdTime(), State: mset.state(), Config: mset.config(), Cluster: js.clusterInfo(mset.raftGroup()), Mirror: mset.mirrorInfo(), Sources: mset.sourcesInfo()}
|
||||
s.sendAPIResponse(client, acc, subject, reply, _EMPTY_, s.jsonResponse(&resp))
|
||||
}
|
||||
}
|
||||
@@ -4065,7 +4065,7 @@ func (mset *stream) handleClusterStreamInfoRequest(sub *subscription, c *client,
|
||||
s, js, config := mset.srv, mset.srv.js, mset.cfg
|
||||
mset.mu.RUnlock()
|
||||
|
||||
si := &StreamInfo{Created: mset.createdTime(), State: mset.state(), Config: config, Cluster: js.clusterInfo(mset.raftGroup())}
|
||||
si := &StreamInfo{Created: mset.createdTime(), State: mset.state(), Config: config, Cluster: js.clusterInfo(mset.raftGroup()), Sources: mset.sourcesInfo(), Mirror: mset.mirrorInfo()}
|
||||
b, _ := json.Marshal(si)
|
||||
s.sendInternalMsgLocked(reply, _EMPTY_, nil, b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user