Sean Chittenden
fc82b351b8
Use the server's address in debug logging, not the c.lastServer, which may be nil
2016-02-02 15:51:28 -08:00
Sean Chittenden
58225e0ee3
Remove unnecessary check, test was moved further up in scope
2016-02-02 11:13:58 -08:00
Sean Chittenden
6452b498e1
Use panic instead of returning a sentinel UUID values in unit tests
2016-02-01 23:15:19 -08:00
Sean Chittenden
ef8bbca48f
Continually rebalance client connections
...
Introduce a low-level background connection expiration mechanism wherein connections will be recycled periodically based on the size and health of the cluster.
For the vast majority of consul users, this will mean an average connection age of 150s. For 10K node clusters it will take ~3min for clusters to rebalance their connections. In the pathological case for a 100K cluster where 99K clients are in the minority talking to 1x server it will take ~26min to rebalance all connections.
It's possibe for clients recovering from a parititon to become fixated on a single server until the server or agent is restarted. This is of particular interest to long-running environments with stable agents, where `allow_stale` is true, and partitions occur periodically.
2016-01-30 17:13:50 -08:00
Sean Chittenden
8a37e76cb0
Use rand.Int31n() vs unconditionally using modulus
2016-01-30 15:47:58 -08:00
Sean Chittenden
727bb42b1d
Merge branch 'f-consul-lib' of ssh://github.com/hashicorp/consul into b-redistribute-clients
2016-01-30 15:40:54 -08:00
Sean Chittenden
b216d4c11f
Rename clientRPCCache to clientRPCConnMaxIdle, change value
...
Increase the max idle time for agents talking to servers from 30s to 127s in order to allow for the reuse of connections that are being initiated by cron.
127s was chosen as the first prime above 120s (arbitrarily chose to use a prime) with the intent of reusing connections who are used by once-a-minute cron(8) jobs *and* who use a 60s jitter window (e.g. in vixie cron job execution can drift by up to 59s per job, or 119s for a once-a-minute cron job).
2016-01-30 15:27:46 -08:00
Sean Chittenden
e83a5b7a70
Reuse the results from gettimeofday(2)...
...
Inside of a single RPC call, reuse time.Now().
2016-01-30 14:39:17 -08:00
Sean Chittenden
c470553b6b
Factor out duplicate functions into a lib package
...
Consolidate code duplication and tests into a single lib package. Most of these functions were from various **/util.go functions that couldn't be imported due to cyclic imports. The consul/lib package is intended to be a terminal node in an import DAG and a place to stash various consul-only helper functions. Pulled in hashicorp/go-uuid instead of consolidating UUID access.
2016-01-29 16:57:45 -08:00
James Phillips
0010b788ed
Prevents watches from being orphaned when KVS blocking queries loop.
2016-01-20 07:18:47 -08:00
James Phillips
e0ae4878f6
Merge pull request #948 from hashicorp/iface-down-fix
...
Don't try to bind on address from inactive interface
2016-01-14 17:00:54 -08:00
Ryan Uber
e3ac96679e
consul: address comments
2016-01-05 09:45:36 -08:00
Ryan Uber
689698eefa
consul: disable serf snapshots in dev mode
2015-12-26 20:39:49 -05:00
Ryan Uber
ce4cf8a542
consul: dev mode works
2015-12-26 20:19:36 -05:00
James Phillips
533c79bd2b
Cleans up some small `go vet` findings.
2015-12-18 22:14:48 -08:00
James Phillips
92531812b6
Adds source address logging on RPC errors.
2015-12-16 14:03:03 -08:00
James Phillips
38bdcc9907
Adds a check to make sure query names can't be registered twice.
2015-12-02 09:04:51 -08:00
Armon Dadgar
a033d7aed2
consul: shrink yamux recv buffer on idle streams
2015-11-27 17:20:57 -08:00
James Phillips
0e3f4af4ac
Makes all the query ops the correct type.
2015-11-17 09:27:10 -08:00
James Phillips
86bc3db7b3
Returns a zero index for a lookup error case.
2015-11-17 09:25:20 -08:00
James Phillips
bc60491890
Removes a useless empty import and fixes some stale comments.
2015-11-17 08:29:20 -08:00
James Phillips
f4943c1613
Makes UUID regex case-insensitive.
2015-11-16 22:57:47 -08:00
James Phillips
a1e02996e5
Moves conversion of nil slices up to HTTP layer for prepared queries.
2015-11-15 17:06:00 -08:00
James Phillips
c032dee945
Adds a paranoia set of the nodes slice to nil.
2015-11-15 17:06:00 -08:00
James Phillips
a0211db3b9
Adds a test to ensure we don't return a nil slice.
2015-11-15 17:06:00 -08:00
James Phillips
375312f07a
Gets rid of some unused constants.
2015-11-15 17:06:00 -08:00
James Phillips
e6ccf5b9ed
Returns a 404 from a get or execute of a nonexistent query.
2015-11-15 17:06:00 -08:00
James Phillips
c9ef552385
Plumbs the service name back and uses agent-specific TTL settings as a fallback.
2015-11-15 17:06:00 -08:00
James Phillips
cad6938474
Adds unit tests for prepared queries and DNS, using existing tests for equivalence.
2015-11-15 17:06:00 -08:00
James Phillips
7762a828d3
Adds query metadata to prepared query execute response.
2015-11-15 17:06:00 -08:00
James Phillips
0c02365bf2
Makes an empty prepared query list an empty slice, not a nil one.
2015-11-15 17:06:00 -08:00
James Phillips
3029906254
Adds a unit test for the new RTT getDatacentersByDistance fn.
2015-11-15 17:06:00 -08:00
James Phillips
697e2f4e71
Completes FSM support for prepared queries.
2015-11-15 17:06:00 -08:00
James Phillips
124410b66c
Adds an HTTP endpoint for prepared queries.
2015-11-15 17:06:00 -08:00
James Phillips
b209c2afe2
Adds an RPC endpoint injection method for testing.
2015-11-15 17:06:00 -08:00
James Phillips
4051db4e88
Changes Lookup to Get since we don't need it (only Execute does).
2015-11-15 17:06:00 -08:00
James Phillips
095806584d
Always increments the failovers counter, even for error-ed DCs.
2015-11-15 17:06:00 -08:00
James Phillips
07361d3e96
Adds test for remote datacenter selection and query logic.
2015-11-15 17:06:00 -08:00
James Phillips
6a1c571a38
Adds a test for the server wrapper.
2015-11-15 17:06:00 -08:00
James Phillips
9428f025f9
Adds tag filter tests.
2015-11-15 17:06:00 -08:00
James Phillips
da5cf9cdf2
Adds execute tests for prepared queries.
2015-11-15 17:06:00 -08:00
James Phillips
7c8404df4c
Adds status information about failovers to query results.
2015-11-15 17:06:00 -08:00
James Phillips
dc517aa288
Removes unused ACL filter.
2015-11-15 17:06:00 -08:00
James Phillips
00ea015770
Adds execute leader forward test for prepared queries.
2015-11-15 17:06:00 -08:00
James Phillips
264e86e533
Adds a leader forwarding case for prepared queries.
2015-11-15 17:06:00 -08:00
James Phillips
bb0f136412
Adds tests for query lookup and list endpoints.
2015-11-15 17:06:00 -08:00
James Phillips
495d00c0b8
Adds query parsing unit tests.
2015-11-15 17:06:00 -08:00
James Phillips
72f6c8a261
Adds ACL cases for apply.
2015-11-15 17:06:00 -08:00
James Phillips
76a55eed53
Completes non-ACL version of apply test.
2015-11-15 17:06:00 -08:00
James Phillips
bc0fba43d8
Adds lookup and list endpoints and basic end-to-end apply test.
2015-11-15 17:06:00 -08:00