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

Detect exact duplicates for URLs for routes, gateways or leafnodes. #2930

Merged
merged 2 commits into from
Mar 17, 2022

Conversation

derekcollison
Copy link
Member

If misconfigured could prevent the JetStream system from electing a leader. We will skip the entry and warn to the log.

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

/cc @nats-io/core

@derekcollison
Copy link
Member Author

@wallyqs could you double check my warnings logic, not as familiar with that as you are.

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

…, enter a warning and ignore.

If misconfigured could prevent the JetStream system from electing a leader.

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

Thanks.

Had a side effect that was making another test fail, so fixed that and want @wallyqs to eyeball the warning construction.

server/opts.go Outdated Show resolved Hide resolved
Co-authored-by: Waldemar Quevedo <wally@synadia.com>
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

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM.

Currently it reads like this:

examples/js-cluster.conf:9:6: invalid use of field "nats://127.0.0.1:6224": Duplicate route entry detected
examples/js-cluster.conf:11:6: invalid use of field "nats://127.0.0.1:6225": Duplicate route entry detected

The lines already point to the location so that is enough I think, but we could make the warning clearer by changing the field from the warning error so that it reads something like this:

examples/js-cluster.conf:9:6: invalid use of field "routes": Duplicate route "nats://127.0.0.1:6224" entry detected
examples/js-cluster.conf:11:6: invalid use of field "routes": Duplicate route "nats://127.0.0.1:6225" entry detected

Have a commit here with the change showing how it could look like: c7e357e

@derekcollison
Copy link
Member Author

I committed your suggestion already, maybe pull and see?

lmk

@derekcollison
Copy link
Member Author

Actually will merge and we can iterate on warning as needed.

@derekcollison derekcollison merged commit 69d2656 into main Mar 17, 2022
@derekcollison derekcollison deleted the dupe_urls_config branch March 17, 2022 23:23
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.

None yet

3 participants