8000 Handle range wrap-around when checking for allocations by bboreham · Pull Request #3708 · weaveworks/weave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Handle range wrap-around when checking for allocations #3708

Merged
merged 3 commits into from
Oct 15, 2019

Conversation

bboreham
Copy link
Contributor
@bboreham bboreham commented Oct 9, 2019

Fixes #3693

Ring wraps around at zero but Space doesn't know about this, so we have to normalise ranges coming out of Ring. In turn we may need to split one range into two, across the end of the Ring.

The unit tests passed because they are calling distance inside the Ring package, which understands the wrap-around. We may want to make them more realistic, maybe move up to ipam package.

Also log the event when we do accept another peer's token, since that should be a rare event, and it's important if we've made a mistake.

Ring wraps around at zero but Space doesn't know about this, so we
have to normalise ranges coming out of Ring.  In turn we may need to
split one range into two, across the end of the Ring.
Turn some Sprint() calls into `%v` in the outer format string.
Remove one debug log line on duplicate token, since that info is already logged.

Add an Info log line when we accept another peer's token, since that
should be a rare event, and it's important if we've made a mistake.
@bboreham bboreham added this to the 2.6 milestone Oct 12, 2019
@murali-reddy
Copy link
Contributor

LGTM

@bboreham bboreham merged commit cb4a876 into master Oct 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPAM ring inconsistency reconcilliation fails when range crosses zero
2 participants
0