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

Report an error if we fail to load an account on a stream assignment. #2076

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

derekcollison
Copy link
Member

We expected an account load to not fail but this is possible with resolvers.
If we can not load the account report back to the metaleader the error.

Consumers overlay the same peer group and need to exist prior, so I believe we only need to check on creating a stream, not on update or creating a consumer.

Signed-off-by: Derek Collison derek@nats.io

/cc @nats-io/core

Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM but would do a little change to the test failure report.


_, err := js.AddStream(&nats.StreamConfig{Name: "F", Replicas: 3})
if err == nil || !strings.Contains(err.Error(), "account not found") {
t.Fatalf("Expected an 'account not found' error but got none")
Copy link
Member

Choose a reason for hiding this comment

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

Would change to .. but got %v, since it could be nil or an unexpected error.

…end error back to metaleader.

Signed-off-by: Derek Collison <derek@nats.io>
Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 16941c7 into master Apr 7, 2021
@derekcollison derekcollison deleted the account_load branch April 7, 2021 21:40
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.

2 participants