Skip to content

Commit

Permalink
Merge pull request #3882 from nats-io/replica-warn
Browse files Browse the repository at this point in the history
[FIXED] Do not warn if consumer replicas configured to 0
  • Loading branch information
derekcollison committed Feb 18, 2023
2 parents 35526b0 + e270e95 commit 9de8c08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/stream.go
Expand Up @@ -5111,7 +5111,9 @@ func (mset *stream) checkConsumerReplication() {
s, acc := mset.srv, mset.acc
for _, o := range mset.consumers {
o.mu.RLock()
if mset.cfg.Replicas != o.cfg.Replicas {
// Consumer replicas 0 can be a legit config for the replicas and we will inherit from the stream
// when this is the case.
if mset.cfg.Replicas != o.cfg.Replicas && o.cfg.Replicas != 0 {
s.Errorf("consumer '%s > %s > %s' MUST match replication (%d vs %d) of stream with interest policy",
acc, mset.cfg.Name, o.cfg.Name, mset.cfg.Replicas, o.cfg.Replicas)
}
Expand Down

0 comments on commit 9de8c08

Please sign in to comment.