Skip to content
Merged
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
8 changes: 7 additions & 1 deletion server/jetstream_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ type jetStreamCluster struct {
type inflightInfo struct {
rg *raftGroup
sync string
cfg *StreamConfig
}

// Used to guide placement of streams and meta controllers in clustered JetStream.
Expand Down Expand Up @@ -6496,6 +6497,11 @@ func (s *Server) jsClusteredStreamRequest(ci *ClientInfo, acc *Account, subject,
if rg == nil {
// Check inflight before proposing in case we have an existing inflight proposal.
if existing, ok := streams[cfg.Name]; ok {
if !reflect.DeepEqual(existing.cfg, cfg) {
resp.Error = NewJSStreamNameExistError()
s.sendAPIErrResponse(ci, acc, subject, reply, string(rmsg), s.jsonResponse(&resp))
return
}
// We have existing for same stream. Re-use same group and syncSubject.
rg, syncSubject = existing.rg, existing.sync
}
Expand Down Expand Up @@ -6523,7 +6529,7 @@ func (s *Server) jsClusteredStreamRequest(ci *ClientInfo, acc *Account, subject,
// on concurrent create requests while this stream assignment has
// possibly not been processed yet.
if streams, ok := cc.inflight[acc.Name]; ok && self == nil {
streams[cfg.Name] = &inflightInfo{rg, syncSubject}
streams[cfg.Name] = &inflightInfo{rg, syncSubject, cfg}
}
}
}
Expand Down
Loading