Commit Graph
56 Commits
Author SHA1 Message Date
Bryan Boreham 6534cc6ae3 Merge pull request #919 from bboreham/915-not-again-again
Fixes #915
2015-06-15 17:06:30 +01:00
Bryan Boreham d25d0810af Extend the 'block' flag to block allocateAgain()
otherwise we can re-insert the entry into the map after a parallel
allocateAgain() has cleared the flag. And it /that/ happens in
parallel with a free() then the data-structure can get out of sync.
2015-06-15 16:51:27 +01:00
Matthias Radestock 36ba838f54 remove ipam.DummyAllocator and rely on new SurrogateGossiper
As a result it is possible to mix nodes with and without IPAM. Note
that the quorum only involves the former, and hence such mixed
environments will typically require a custom `-initpeercount`.
2015-06-15 11:24:07 +01:00
Matthias Radestock 0b3584a355 permit encoding of GossipData into multiple messages 2015-06-15 11:14:24 +01:00
Matthias Radestock afb31d3beb cosmetic: remove unused method 2015-06-14 11:49:03 +01:00
Matthias Radestock 882ed85d77 tiny refactor 2015-06-14 09:37:13 +01:00
Bryan Boreham 4c01af4e1d Check if container is still running right after allocating 2015-06-12 17:09:11 +01:00
Bryan Boreham 36f793c1f4 Delete entry from addresses map when slice is empty 2015-06-10 17:27:07 +01:00
Bryan Boreham c27cd5b4ab Extract lookup function for owned addresses 2015-06-10 17:27:07 +01:00
Bryan Boreham e9d194327a Reduce level of noise in debug logs from containers dying 2015-06-10 17:24:36 +01:00
Bryan Boreham a3d73be8b8 General tidying
tidy Address helper functions,
make ordering of members consistent in allocate and claim,
make linter happier,
remove some unused items, and
update some comments
2015-06-10 17:24:36 +01:00
Bryan Boreham fa0b0042b2 Eradicate the last vestiges of CIDR in Allocator 2015-06-10 17:24:36 +01:00
Bryan Boreham e21f66db0a Use address.Range instead of (start,end) pairs 2015-06-10 17:24:36 +01:00
Bryan Boreham a80e5cb028 Corrected space.Donate() to restrict the space donated to be in-range, and associated unit test changes 2015-06-10 17:24:36 +01:00
Bryan Boreham 40c9adc8d3 Extract common freelist-walking code 2015-06-10 17:24:36 +01:00
Bryan Boreham 147962d101 Clarify some unit test operations 2015-06-10 17:24:36 +01:00
Bryan Boreham 6536034ab6 Move default subnet outside of Allocator 2015-06-10 17:24:36 +01:00
Bryan Boreham e5113889f4 Move NumFreeAddresses() into test 2015-06-10 17:24:36 +01:00
Bryan Boreham 3a9af4413d Rationalize ipam arguments
- rename -defaultsubnet to -ipsubnet
- default subnet defaults to whole -iprange
- parse and check inside ipam package
- removes some error cases
2015-06-10 17:21:16 +01:00
Bryan Boreham ecbd514a83 Tighten error checking 2015-06-10 17:21:16 +01:00
Bryan Boreham 50eaccc60c Allocate() and Lookup() now return a CIDR, to simplify output 2015-06-10 17:21:16 +01:00
Bryan Boreham 2a00b0092d Extend 'Lookup' to multi-subnet 2015-06-10 17:21:16 +01:00
Bryan Boreham a617e7918c Introduce single-address Free() and rename the previous one to Delete() 2015-06-10 17:21:16 +01:00
Bryan Boreham 551394a831 Add subnet info to space requests from one peer to another 2015-06-10 17:21:16 +01:00
Bryan Boreham ff545feae3 Add some unit tests for multi-subnet 2015-06-10 17:21:16 +01:00
Bryan Boreham c7a9dfbb3f Remember multiple addresses owned by each container, for multi-subnet use 2015-06-10 17:21:16 +01:00
Bryan Boreham 2553850ed4 Initial implementation of multi-subnet IPAM 2015-06-10 17:21:16 +01:00
Bryan Boreham e6d230042d Introduce address.CIDR type 2015-06-10 17:21:16 +01:00
Bryan Boreham 2a244e5699 Simplify paxos.Consensus() call 2015-06-04 13:30:15 +01:00
Adam Harrison 4a8850afb3 Fix comment 2015-06-03 12:08:13 +01:00
Michael Bridgen 791584d9f3 Allow lookup of IPAM-allocated addresses 2015-06-02 17:31:25 +01:00
Bryan Boreham 6a1b658f59 Fix race condition in allocator fuzz-test
It was possible to free an address between deciding to re-test it
and actually re-testing it.  So introduced a flag 'block' to prevent
an address from being freed during the re-test.
2015-06-02 16:04:35 +01:00
Bryan Boreham 2698f3f376 Merge remote-tracking branch 'upstream/0.11' 2015-06-01 11:42:30 +01:00
Bryan Boreham cd1cca3df2 Reformat output of pending ipam requests 2015-06-01 10:55:01 +01:00
Bryan Boreham 1d6f1f7561 Improve ipam status message before and after pending consensus 2015-05-29 17:34:17 +01:00
Matthias Radestock e0f4da4641 Merge pull request #792 from rade/720_auto_assigned_dns_http_test_port
use an automatically assigned port for http tests

Fixes #720.
2015-05-29 15:51:38 +01:00
Matthias Radestock 08a17ec376 no need for sleeps to wait for http server
Since we start the tcp listener in the main thread now, connections
can be made immediately; they will just queue up until there is a
handler.
2015-05-29 14:17:03 +01:00
Matthias Radestock 3ad08c0f2a don't print the test port
it's of no interest whatsoever
2015-05-29 14:05:24 +01:00
Matthias Radestock fb721558af auto-assign port in ipam tests 2015-05-29 12:35:23 +01:00
Bryan Boreham adeb0d3934 Don't bypass the actor mechanism in unit tests, to avoid race conditions 2015-05-29 10:43:19 +01:00
Bryan Boreham 0ee872def4 Lock round mockGossipComms to avoid race conditions 2015-05-29 10:27:17 +01:00
Bryan Boreham e37f7de0ad Improve error reporting of too much free space 2015-05-29 09:44:24 +01:00
Bryan Boreham 72b30bc699 Fix incorrect calculation of free space
when granting a range that spans a token and inserting a new token, the
free space on the last token that we are handing over has to change.
Add unit test for this too.
2015-05-29 09:44:14 +01:00
Bryan Boreham 915bf392e9 Improve error reporting of too much free space 2015-05-28 18:15:04 +01:00
Bryan Boreham af5531cbf6 Fix incorrect calculation of free space
when granting a range that spans a token and inserting a new token, the
free space on the last token that we are handing over has to change.
Add unit test for this too.
2015-05-28 18:12:30 +01:00
Matthias Radestock ac8d7a5c55 cosmetic: this is somewhat gross, but the last barrier to linter bliss 2015-05-27 16:58:12 +01:00
Matthias Radestock 5920927a52 make the linter (almost) happy with ipam 2015-05-27 16:43:18 +01:00
Bryan Boreham 70b595c4a2 Clarify status message when allocator is awaiting consensus 2015-05-19 14:12:08 +01:00
Matthias Radestock f59facf5a6 Merge pull request #701 from bboreham/684-improve-errors
Improve ipam error messages

Closes #684.
2015-05-19 13:34:22 +01:00
Bryan Boreham 0e55f75d86 Oops 2015-05-19 13:16:36 +01:00