Commit Graph

1414 Commits

Author SHA1 Message Date
Sean Chittenden
c8b2f7ce33 Flesh out the comment re: the client.rpcproxy.Run() task.
Requested by: Alex
2016-06-10 15:50:11 -04:00
Sean Chittenden
9de963497b Clean up various comments 2016-06-10 15:50:11 -04:00
Sean Chittenden
07799b636a Nuke the last of the explicit types in favor of using language idioms 2016-06-10 15:50:11 -04:00
Sean Chittenden
73c15603a9 Rename backupServerDeadline to consulPullHeartbeatDeadline
Suggested by: @alex
2016-06-10 15:50:11 -04:00
Sean Chittenden
66dc946852 Don't clobber the default consul config in tests 2016-06-10 15:50:11 -04:00
Sean Chittenden
4300cb31d9 Remove unused variable 2016-06-10 15:50:11 -04:00
Sean Chittenden
41904f262f Clean up some docs and comments to be more accurate 2016-06-10 15:50:11 -04:00
Sean Chittenden
445386bb3f Remove unused constants 2016-06-10 15:50:11 -04:00
Sean Chittenden
329057e22b Only actively test Consul when env CONSUL_HTTP_ADDR is set 2016-06-10 15:50:11 -04:00
Sean Chittenden
f9862d4043 Update godoc for newServer to reflect DNS and IP-based inputs
Requested by: alex
2016-06-10 15:50:11 -04:00
Sean Chittenden
453a7556b6 Pick the right DefaultConfig from the right package.
Overly zealous search && replace at work here.
2016-06-10 15:50:11 -04:00
Sean Chittenden
6908846086 Add a quick set of client/rpcproxy.ServerEndpoint equality tests 2016-06-10 15:50:11 -04:00
Sean Chittenden
ac174dbb6b Fix building tests that used DefaultConfig() but didn't pickup the package move. 2016-06-10 15:50:11 -04:00
Sean Chittenden
5b0a969a36 Fix the client/rpcproxy unit tests. 2016-06-10 15:50:11 -04:00
Sean Chittenden
ed30876186 Change the endpoint for /v1/agent/servers and fix tests.
When an agent is running a server, the list of servers includes the
Raft peers.  When the agent is running a client (which is always the
case?), include a list of the servers found in the Client's RpcProxy.
Dedupe and provide a unique list back to the caller.
2016-06-10 15:50:11 -04:00
Sean Chittenden
6785e7632c Provide a default ConsulConfig for client/config.DefaultConfig()
Change the unit test to only test if the consul link exists, not the
value of the link.  The old test was hostname specific and therefore
would always be different based on the environment running the tests.
2016-06-10 15:50:11 -04:00
Sean Chittenden
b9f230b7b2 Move client.DefaultConfig() to client/config.DefaultConfig()
Resolves an import cycle in testing and is more appropriate because
the default should reside next to its struct definition.
2016-06-10 15:50:11 -04:00
Sean Chittenden
c8bf53b0a8 Fix a comment to be more correct 2016-06-10 15:50:11 -04:00
Sean Chittenden
6264a8eff6 Unused code wasn't as unused as I thought. Restore. 2016-06-10 15:50:11 -04:00
Sean Chittenden
ab99e89bd9 Reconcile, clean up, and centralize API version numbers (major and minor).
Reduce future confusion by introducing a minor version that is gossiped out
via the `mvn` Serf tag (Minor Version Number, `vsn` is already being used for
to communicate `Major Version Number`).

Background: hashicorp/consul/issues/1346#issuecomment-151663152
2016-06-10 15:50:11 -04:00
Sean Chittenden
b2357598ba Register the serf service with the Nomad server service.
This will be unused in this PR.
2016-06-10 15:50:11 -04:00
Sean Chittenden
6b8a9b435c Update the nomad_server_service default from nomad-server to just nomad. 2016-06-10 15:50:11 -04:00
Sean Chittenden
6cdc0556de Change the constants used to match the struct definitions 2016-06-10 15:50:11 -04:00
Sean Chittenden
90f7eb42fb When clearing the backup servers, set the length to zero. 2016-06-10 15:50:11 -04:00
Sean Chittenden
8a393d7517 Improve language re: fingerprinting 2016-06-10 15:50:11 -04:00
Sean Chittenden
bf4f0310b4 Remove unused function. 2016-06-10 15:50:11 -04:00
Sean Chittenden
9998573298 Clear the backup server list when a Nomad heartbeat arives with servers
If Nomad is heartbeating during a transition from using backup servers
to Nomad servers, make Nomad the canonical source of servers and flush
the list of servers populated from Consul.
2016-06-10 15:50:11 -04:00
Sean Chittenden
3d22c22bf5 Remove types.ShutdownChannel and replace with chan struct{} 2016-06-10 15:50:11 -04:00
Sean Chittenden
57bb374236 Fix unit tests 2016-06-10 15:50:11 -04:00
Sean Chittenden
7034c50d2f Pass the datacenter name in the heartbeat
Servers that are part of a different datacenter are added as backup
servers instead of primary servers.
2016-06-10 15:50:11 -04:00
Sean Chittenden
9a93496475 Consolidate all consul sync periodic go routines to handlers.
Only one pump and periodic loop now.
2016-06-10 15:50:11 -04:00
Sean Chittenden
4d47eedd58 Teach Client to reuse an Agent's consulSyncer.
"There can be only one."
2016-06-10 15:50:11 -04:00
Sean Chittenden
bc86e897ed Register two services each for clients and servers, http and rpc.
In order to give clients a fighting chance to talk to the right port,
differentiate RPC services from HTTP services by registering two
services with different tags.  This yields
`rpc.nomad-server.service.consul` and
`http.nomad-server.service.consul` which is immensely more useful to
clients attempting to bootstrap their world.
2016-06-10 15:50:11 -04:00
Sean Chittenden
916d93c9ab Bump the cluster test minimums to 10min.
These ranges aren't too useful with the default 600s rebalance, but
will be useful if that default ever changes in the future.
2016-06-10 15:50:11 -04:00
Sean Chittenden
1034e766a4 s/RpcVersion/RPCVersion/g 2016-06-10 15:50:11 -04:00
Sean Chittenden
1e3feae8f9 Bump shuffle interval per suggestion from Alex 2016-06-10 15:50:11 -04:00
Sean Chittenden
cbed88a808 Move struct member to reduce diff context 2016-06-10 15:50:11 -04:00
Sean Chittenden
0a5fa55e8f Fix package name in comments 2016-06-10 15:50:11 -04:00
Sean Chittenden
7cdf0edcfe Rename the package from client/rpc_proxy to client/rpcproxy
Also rename `NewRpcProxy()` to just `New()` to avoid package stutter.
2016-06-10 15:50:11 -04:00
Sean Chittenden
22bd2b5ef2 Rename manager_test.go to rpc_proxy_test.go 2016-06-10 15:50:11 -04:00
Sean Chittenden
a703c8a42f Rename RpcProxy's internal filename to match 2016-06-10 15:50:11 -04:00
Sean Chittenden
3728771060 Remove unused code 2016-06-10 15:50:11 -04:00
Sean Chittenden
1fa43a09dd Reduce all forms of ConsulConfig down to a single struct
nomad/structs/config/consul.go's ConsulConfig is the canonical definition
for all things Consul now.
2016-06-10 15:50:11 -04:00
Sean Chittenden
16b4e5c9be Rebalance Nomad client RPCs among different Nomad servers.
Implement client/rpc_proxy.RpcProxy.
2016-06-10 15:50:11 -04:00
Sean Chittenden
6fae3db12e Rename ConsulConfig to ConsulAgentConfig 2016-06-10 15:50:11 -04:00
Sean Chittenden
e6397da738 Centralize the creation of a consul/api.Config struct.
While documented, the consul.timeout parameter wasn't ever set
except one-off in the Consul fingerprinter.
2016-06-10 15:50:11 -04:00
Sean Chittenden
bc94ce8aa6 Rename mergedNomadMap to mergedPrimaryMap. Gratuitous, but more correct. 2016-06-10 15:50:11 -04:00
Sean Chittenden
7125b85744 Correct a mismerge
Somewhere along the lines when rebasing I mis-merged a patch.
2016-06-10 15:50:11 -04:00
Sean Chittenden
90023c3639 Rename RpcProxy's internal filename to match 2016-06-10 15:50:11 -04:00
Sean Chittenden
fc5658521c index on f-dyn-server-list: bd38cb4 Remove unused code 2016-06-10 15:50:11 -04:00