Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Use quorum=True for etcd reads in IPAM. #49

Merged
merged 1 commit into from
Nov 5, 2015

Conversation

spikecurtis
Copy link
Contributor

Fixes #47

handle_id,
attributes)
try:
ips = self._auto_assign_block(block_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is the last block and you get a KeyError (because the client creating this block hasn't written it yet) - shouldn't we be retrying rather than potentially creating a new affine block below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

allocated_ips = []

num_remaining = num
while num_remaining > 0:
try:
block_id = block_ids.next()
except StopIteration:
block_id = block_ids.pop()
Copy link
Contributor

Choose a reason for hiding this comment

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

pop(0) could have been used instead of needing to reverse the list - but not fussed either way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Today I Learned...

@robbrockbank
Copy link
Contributor

LGTM

spikecurtis pushed a commit that referenced this pull request Nov 5, 2015
Use quorum=True for etcd reads in IPAM.
@spikecurtis spikecurtis merged commit b0f22f8 into projectcalico:master Nov 5, 2015
@spikecurtis spikecurtis deleted the ipam-quorum-read branch November 5, 2015 01:30
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.

2 participants