Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store JetStream Config in node info map #2824

Merged
merged 1 commit into from
Jan 31, 2022
Merged

Store JetStream Config in node info map #2824

merged 1 commit into from
Jan 31, 2022

Conversation

variadico
Copy link
Contributor

@variadico variadico commented Jan 27, 2022

Currently, we don't update the JetStream configuration in Server.nodeToInfo. This can cause a problem if the user doesn't explicitly configure JetStream MaxStore or MaxMem. It's a problem because some code expects MaxStore=-1 to be resolved to a real non-negative amount of bytes. Specifically, this check fails: https://github.com/nats-io/nats-server/blob/main/server/jetstream_cluster.go#L3683

This is what the call stack looks like.

  • jetStreamCluster.selectPeerGroup - returns nil because ni.cfg.MaxStore > int64(used) is false because MaxStore=-1
  • jetStream.createGroupForStream - returns nil because selectPeerGroup returned nil
  • Server.jsClusteredStreamRequest - returns "insufficient resources"

The included test fails to js.AddStream with the error "insufficient resources" on the main branch, but passes on this branch.

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants