From a5fa14d0e6ed5a23656760de490eb64ed000a30c Mon Sep 17 00:00:00 2001 From: Maurice van Veen Date: Mon, 2 Sep 2024 11:28:52 +0200 Subject: [PATCH] Fix reflect.DeepEqual both receiving pointers In `processClusterCreateStream` there was a call to `reflect.DeepEqual` with different types making it always fail. `mset.config()` is the config itself, whereas `sa.Config` is a pointer to the config. So we need to pass `mset.config()` as a pointer instead. In `processClusterCreateConsumer` this was done as well: ```go cfg := o.config() if isConfigUpdate = !reflect.DeepEqual(&cfg, ca.Config); isConfigUpdate { ``` Signed-off-by: Maurice van Veen --- server/jetstream_cluster.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/jetstream_cluster.go b/server/jetstream_cluster.go index a59ae021234..58de6debeb1 100644 --- a/server/jetstream_cluster.go +++ b/server/jetstream_cluster.go @@ -3799,7 +3799,8 @@ func (js *jetStream) processClusterCreateStream(acc *Account, sa *streamAssignme } mset.setStreamAssignment(sa) // Check if our config has really been updated. - if !reflect.DeepEqual(mset.config(), sa.Config) { + cfg := mset.config() + if !reflect.DeepEqual(&cfg, sa.Config) { if err = mset.updateWithAdvisory(sa.Config, false, false); err != nil { s.Warnf("JetStream cluster error updating stream %q for account %q: %v", sa.Config.Name, acc.Name, err) if osa != nil {