Matthias Radestock
c1d98ba59c
refactor: extract a helper
2016-04-17 12:40:34 +01:00
Matthias Radestock
a1823af745
refactor: make error returns less onerous
2016-04-17 12:40:34 +01:00
Matthias Radestock
4a01d23025
refactor: extract entry merging from ring merging
2016-04-17 12:40:34 +01:00
Matthias Radestock
27632b118f
prevent excessive ring fragmentation due to repeated space requests
...
Merging a ring now indicates whether the ring has been updated. This
prevents excessive allocation retries, which in turn can result in
repeated space requests - i.e. if an allocation cannot proceed due to
lack of space - which in turn can result in excessive ring
fragmentation since many of the requests will result in the creation
of a new ring entries, due to the need to split ranges.
Fixes #2181 .
2016-04-17 12:40:18 +01:00
Matthias Radestock
0e54de63cc
cosmetic
2016-04-17 09:33:52 +01:00
Matthias Radestock
8f54f83285
refactor: align test allocator names with indices
...
for easier debugging
2016-04-16 09:12:49 +01:00
Adam Harrison
a09986baa2
Rename consense -> prime
2016-04-14 12:46:03 +01:00
Bryan Boreham
61b0d0ba9e
Merge pull request #2149 from weaveworks/stop-test-router
...
stop ipam tests from leaking routers
2016-04-11 13:34:21 +01:00
Bryan Boreham
c10d26cf02
Fix up TestBootstrap after consensus changes
2016-04-11 13:20:54 +01:00
Matthias Radestock
695babf7ba
make Allocator.Stop() idempotent and non-blocking
...
So that tests don't have to be careful about ensuring that allocators
are stopped exactly once, or rely on the magic mesh.ChannelSize for
non-blocking behaviour.
2016-04-11 12:32:01 +01:00
Bryan Boreham
ecf1887e5b
Initialize Paxos quorum to 0 until this node needs to request consensus.
...
With a 0 quorum we will participate in voting, but will not actively
try to form a ring.
2016-04-11 11:42:24 +01:00
Matthias Radestock
4d352d6eb1
stop router created by makeNetworkOfAllocators
...
so that unit tests don't leave garbage behind
2016-04-10 11:22:57 +01:00
Bryan Boreham
c12a52d20e
Better log and status messages for Paxos observer
2016-04-07 12:50:52 +01:00
Bryan Boreham
0c59de40e7
Refactor Paxos status call to remove type assertion
2016-04-07 12:12:08 +01:00
Matthias Radestock
2e31087818
dump state on paxos test failure
...
to help diagnosis of #2132 and similar problems
2016-04-06 08:55:49 +01:00
Adam Harrison
436dc01f52
Merge pull request #2070 from weaveworks/issues/1721-quorum-callback
...
Use current target list to compute quorum
2016-03-29 11:11:30 +01:00
Bryan Boreham
aab86c38b7
Merge pull request #2093 from weaveworks/tools
...
Update tools to get misspell integration. Aho-Corasick FTW!
2016-03-24 14:09:45 +00:00
Bryan Boreham
cfa9b4f638
Assert that paxos quorum is set
2016-03-24 12:06:59 +00:00
Bryan Boreham
2b617633ae
Compute quorum based on the dynamic number of target peers
2016-03-24 12:06:59 +00:00
Matthias Radestock
b8abb22833
Merge branch '1.4'
2016-03-23 16:39:17 +00:00
Tom Wilkie
7a7867ae16
Fix spelling mistakes.
2016-03-23 16:09:43 +00:00
Bryan Boreham
6bc199a8bc
Change invariant fail on Merge() from panic to error
2016-03-23 15:26:26 +00:00
Adam Harrison
e9081c6607
Allow specification of initial IPAM ring via --ipam-seed
2016-03-21 09:49:54 +00:00
Bryan Boreham
09a6c2eda0
Get the owned ranges for test purposes via the actor loop, so we don't set off the race detector
2016-03-19 15:29:34 +00:00
Matthias Radestock
9f10b21c9c
use Space.NumFreeAddresses for calculating transferred ip count
...
...rather than Space.NumFreeAddressesInRange; we don't care about the
universe.
Alternatively we could make Space.AddRanges return the count. But
AddRanges doesn't know whether the ranges overlap with existing free
space - that is only guaranteed by the context - so would have to do
much the same before/after calculation.
Another alternative would be to add the range sizes in
AdminTakeoverRanges. But that is more code and less clear.
2016-03-19 14:41:36 +00:00
Matthias Radestock
62d823850c
make rmpeer report on size of transferred space, and not fail
...
Closes #2058 .
2016-03-19 14:40:26 +00:00
Matthias Radestock
c48eefa82d
refactor(ish): extract allocator logging commonality
...
and add warnf
2016-03-19 14:32:54 +00:00
Matthias Radestock
65eff683dd
Merge branch '1.4'
2016-03-19 14:30:38 +00:00
Matthias Radestock
f42e275884
broadcast ipam ring update after rmpeer
...
So that other peers notice the change more promptly.
Fixes #2068 .
2016-03-19 13:57:20 +00:00
Bryan Boreham
f11314ed3e
Introduce 'Count' type to avoid abusing 'Offset'
2016-03-19 11:47:34 +00:00
Matthias Radestock
bc7539c4ad
cosmetic: consistency
2016-03-18 11:56:10 +00:00
Matthias Radestock
9c2e9bab14
cosmetic(ish) refactor
2016-03-18 02:42:53 +00:00
Adam Harrison
2eeb754454
refactor: Introduce IPAM config object
2016-03-14 17:41:20 +00:00
Bryan Boreham
a57335738d
Don't do unnecessary clock skew check in IPAM
2016-03-10 11:41:47 +00:00
Adam Harrison
6584df274e
Implement weave consense
2016-03-03 18:52:09 +00:00
Adam Harrison
b84ef98de8
Support non-electing peers via --observer
2016-03-03 17:48:50 +00:00
Martynas Pumputis
9cfc104fc7
Add TestSpaceRequest test for allocator
...
Checks whether a donating peer does not leave one ip address
behind a block it donates (#2009 ).
2016-03-03 08:36:14 -08:00
Bryan Boreham
824329d4c9
Fix up unit tests to look at CIDRs instead of addresses.
2016-03-02 17:21:52 -08:00
Bryan Boreham
604309fb53
Parse CIDR strings without separating into subnet and address
2016-03-02 17:21:52 -08:00
Bryan Boreham
73f1a04d5f
Deal in subnets, not ranges, when requesting address allocation
2016-03-02 17:21:51 -08:00
Bryan Boreham
b76e2a87cf
Store address+subnet prefix for 'owned' addresses
2016-03-02 17:21:24 -08:00
Bryan Boreham
b6eec08247
Return all applicable results from Lookup
...
and stop erroring on Lookup not found; just return a blank result
2016-03-02 17:01:12 -08:00
Bryan Boreham
03563e847e
Remember addresses outside of the allocation range
2016-03-02 17:01:12 -08:00
Bryan Boreham
95cbc8940e
Sync 'owned' data with existing containers at startup
2016-03-02 11:35:24 -08:00
Bryan Boreham
f29716387f
Persist the 'owned' address set
2016-03-02 11:35:24 -08:00
Bryan Boreham
7453c7a5dd
Merge branch '1.4'
2016-02-29 08:22:22 -08:00
Adam Harrison
bceabe32a2
Try all pending allocations
...
We can have outstanding allocations for different ranges owned by
different peers, so we should not short circuit after the first space
request.
2016-02-25 14:56:33 +00:00
Bryan Boreham
546f9592f9
Hard-fail on persistence errors, otherwise the network can get confused on a restart.
...
Create `Allocator.fatalf()`, for consistency
2016-02-12 18:12:26 +00:00
Bryan Boreham
06f3793f05
Remove persisted IPAM ring data on peerName change
2016-02-12 18:12:26 +00:00
Bryan Boreham
f396c60402
Persist the Ring
2016-02-12 18:12:26 +00:00