Skip to content

Commit

Permalink
Fix reflect.DeepEqual both receiving pointers (#5854)
Browse files Browse the repository at this point in the history
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 {
```

<!-- Please make sure to read CONTRIBUTING.md, then delete this notice
and replace it with your PR description. The below sign-off certifies
that the contribution is your original work and that you license the
work to the project under the Apache-2.0 license. We cannot accept
contributions without it. -->

Signed-off-by: Maurice van Veen <[email protected]>
  • Loading branch information
derekcollison authored Sep 3, 2024
2 parents 19af691 + a5fa14d commit 656938a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/jetstream_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 656938a

Please sign in to comment.