Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Implement claiming addresses from other peers #1159

Merged
merged 7 commits into from
Jul 17, 2015
Merged

Conversation

bboreham
Copy link
Contributor

Addresses #1150

@tomwilkie
Copy link
Contributor

My only suggestion is that you extend TestAllocatorFuzz for this operation, and perhaps add a simple smoke test too.

@rade
Copy link
Member

rade commented Jul 16, 2015

I am somewhat worried about this causing excessive fragmentation. Say we had a running cluster, nicely segmented three-ways in the IP space. With lots of containers. Then we bounce it and the space allocation is different. Since we issue claims one-by-one, won't we end up with a ring containing as many tokes as there are containers?

I'm not suggesting we should necessarily attempt to fix this here, but might be worth leaving a comment in the code.

@bboreham
Copy link
Contributor Author

Yes, I think your analysis is correct. With a more sophisticated request-management system, we could coalesce all contiguous requests into one, thus mostly removing the fragmentation.

There is another potential pitfall with the simple way requests are managed at present: if we do not hear back from the current owner we will hang the caller. And it's quite easy to get into a state where the current owner is actually shut down.

@rade
Copy link
Member

rade commented Jul 16, 2015

We could grant larger ranges than requested. e.g. when receiving a request we grant a range s.t. we minimise the creation of tokens. There are downsides to that too obviously.

@tomwilkie
Copy link
Contributor

Instead of hanging forever, could we detect when the current owner has gone
(from peers.go) and tell the user? Is that worth doing?

On Thu, Jul 16, 2015 at 10:45 AM, Bryan Boreham [email protected]
wrote:

Yes, I think your analysis is correct. With a more sophisticated
request-management system, we could coalesce all contiguous requests into
one, thus mostly removing the fragmentation.

There is another potential pitfall with the simple way requests are
managed at present: if we do not hear back from the current owner we will
hang the caller. And it's quite easy to get into a state where the current
owner is actually shut down.


Reply to this email directly or view it on GitHub
#1159 (comment).

@rade
Copy link
Member

rade commented Jul 16, 2015

Instead of hanging forever, could we detect when the current owner has gone (from peers.go) and tell the user? Is that worth doing?

They could come back. All of IPAM makes that assumption, so it would be strange to do something different here.

@bboreham
Copy link
Contributor Author

claim is a bit different - sometimes it sends back a nil answer meaning "I don't know yet but I'll try later" - so @tomwilkie's suggestion seems fair. More precisely, if the 'send-unicast' errors, then we would return to the caller while leaving the claim pending.

@bboreham
Copy link
Contributor Author

Note that peers, on receipt of a request for space, typically donate half of it. This is rounded up, so a single IP works, but if we coalesced space then we'd need further work to make that behave as required. I think this would still be backwards-compatible - if you request 8 addresses from a back-version peer then you will get 4, so request another 4, get 2, and eventually satisfy the need.

Edit: just noticed you said grant larger ranges than requested, which makes much of the above irrelevant.

@bboreham
Copy link
Contributor Author

Added fuzz test, smoke test and non-hanging. Granting larger ranges turned out to have subtleties so left for another day.

@tomwilkie
Copy link
Contributor

Gee, thanks!

@rade
Copy link
Member

rade commented Jul 16, 2015

Gee, thanks!

Really want your expert eyes on this.

@bboreham
Copy link
Contributor Author

Just rebased against master and push-f'd

@tomwilkie
Copy link
Contributor

I've given it a read through and can't spot anything obvious. Do you normally squash this kinda thing?

I'll think on corner cases overnight, unless there is a rush.

@rade
Copy link
Member

rade commented Jul 16, 2015

Do you normally squash this kinda thing?

Can't see anything obviously squash-worthy.

tomwilkie added a commit that referenced this pull request Jul 17, 2015
Implement claiming addresses from other peers
@tomwilkie tomwilkie merged commit f10e0e4 into master Jul 17, 2015
@tomwilkie tomwilkie deleted the 1150-claim-from-peer branch July 17, 2015 10:21
@rade rade added this to the 1.1.0 milestone Jul 21, 2015
@rade
Copy link
Member

rade commented Jul 27, 2015

We are not seeing any coverage of Allocator.spaceRequestDenied. Is that expected?

@rade
Copy link
Member

rade commented Jul 27, 2015

We are not seeing any coverage of Allocator.spaceRequestDenied. Is that expected?

False alarm. Problem turns out to be #1220.

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.

3 participants