From 3c9c124b94345ef7e44a143be214bfe693f59d2d Mon Sep 17 00:00:00 2001 From: Neil Twigg Date: Fri, 11 Aug 2023 14:15:49 +0100 Subject: [PATCH] When checking replica count when updating retention, make sure stream assignment is set first Signed-off-by: Neil Twigg --- server/stream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/stream.go b/server/stream.go index ab1e2983..d99ff949 100644 --- a/server/stream.go +++ b/server/stream.go @@ -1787,7 +1787,7 @@ func (mset *stream) updateWithAdvisory(config *StreamConfig, sendAdvisory bool) // a subsequent update to an existing tier will then move from existing past tier to existing new tier } - if mset.isLeader() && ocfg.Retention != cfg.Retention && cfg.Retention == InterestPolicy { + if mset.isLeader() && mset.sa != nil && ocfg.Retention != cfg.Retention && cfg.Retention == InterestPolicy { // Before we can update the retention policy for the consumer, we need // the replica count of all consumers to match the stream. for _, c := range mset.sa.consumers {