-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic Server Lists/Client Bootstrapping #1201
Merged
Merged
Changes from 1 commit
Commits
Show all changes
166 commits
Select commit
Hold shift + click to select a range
a1cb3f1
Use consul/lib's RateScaledInterval
sean- 7db2eb0
Use consul/lib's RandomStagger
sean- 2d23927
Use `rand.Int*n()` where appropriate
sean- 2846614
Fix small typo
sean- 3f9d385
Seed random once in main
sean- 4030e38
Use the correctly typed `rand.Int*` variant
sean- 0e1bdad
Rename consul.ConsulConfig to consul.AgentConfig
sean- 4fed6b0
Rename client/config/config's ConsulConfig to ConsulAgentConfig
sean- 1f7bfb3
Rename consulConfig to consulAgentConfig
sean- 8e25647
Rename ConsulConfig to ConsulAgentConfig
sean- af72200
Distill config.Config.ConsulConfig down to config.Config.Consul
sean- 7bf6af8
Fix copy pasta comment.
sean- 092e07f
Create a `nomad/structs/config` to break an import cycle.
sean- d84d718
Rename client/consul/sync.ConsulService to client/consul/sync.Syncer
sean- f280c59
Rename client/consul/sync.PeriodicSync to Run
sean- 7c6ad53
Rename NewConsulService to NewSyncer
sean- ffcd233
Rebalance Nomad client RPCs among different Nomad servers.
sean- f6e3587
Define a type for the PeriodicCallback handlers and ShutdownChannel
sean- d268dcb
Reduce all forms of ConsulConfig down to a single struct
sean- e07e77b
s/availble/runChecks/g
sean- 8da18b6
Alpha sort config keys for Consul
sean- 89d48c8
Revise Agent.syncAgentServicesWithConsul()'s interface
sean- c159e77
An Agent's consulSyncer is always not nil now.
sean- 17927c8
Only poll Consul for servers when Nomad heartbeats begin to fail
sean- 4e4f0a1
Remove unused code
sean- fc56585
index on f-dyn-server-list: bd38cb4 Remove unused code
sean- 05bbbd2
Reconcile renamed structures during rebase
sean- 90023c3
Rename RpcProxy's internal filename to match
sean- 681a7d6
Remove testing for an API that doesn't exist any more.
sean- 7125b85
Correct a mismerge
sean- 71dde1b
Reconcile consul's address configuration section.
sean- bc94ce8
Rename `mergedNomadMap` to `mergedPrimaryMap`. Gratuitous, but more c…
sean- e6397da
Centralize the creation of a consul/api.Config struct.
sean- 990a094
Use `rand.Int*n()` where appropriate
sean- 07fa0c5
Use the correctly typed `rand.Int*` variant
sean- 5e0d76f
Rename client/config/config's ConsulConfig to ConsulAgentConfig
sean- 4d30c98
Rename consulConfig to consulAgentConfig
sean- 6fae3db
Rename ConsulConfig to ConsulAgentConfig
sean- 16b4e5c
Rebalance Nomad client RPCs among different Nomad servers.
sean- 1fa43a0
Reduce all forms of ConsulConfig down to a single struct
sean- 3728771
Remove unused code
sean- a703c8a
Rename RpcProxy's internal filename to match
sean- 22bd2b5
Rename manager_test.go to rpc_proxy_test.go
sean- 7cdf0ed
Rename the package from `client/rpc_proxy` to `client/rpcproxy`
sean- 0a5fa55
Fix package name in comments
sean- cbed88a
Move struct member to reduce diff context
sean- 1e3feae
Bump shuffle interval per suggestion from Alex
sean- 1034e76
s/RpcVersion/RPCVersion/g
sean- 916d93c
Bump the cluster test minimums to 10min.
sean- b293cf3
Fix typo in the comment to reflect the actual function name.
sean- ce8c03d
Advertise the server's RPC endpoint, not its HTTP endpoint.
sean- bc86e89
Register two services each for clients and servers, http and rpc.
sean- 4d47eed
Teach Client to reuse an Agent's consulSyncer.
sean- 9a93496
Consolidate all consul sync periodic go routines to handlers.
sean- bccf131
Invert check definition so the error is first
sean- 2abd37c
Silence unused variable warning
sean- 7034c50
Pass the datacenter name in the heartbeat
sean- 57bb374
Fix unit tests
sean- 3d22c22
Remove types.ShutdownChannel and replace with `chan struct{}`
sean- 49266fa
Invert error handling logic
sean- 9bd2882
Nuke trace-level logging in heartbeats
sean- ca0f2d9
Nuke a.consulConfig in favor of a.consul.Config
sean- 9998573
Clear the backup server list when a Nomad heartbeat arives with servers
sean- bf4f031
Remove unused function.
sean- 8a393d7
Improve language re: fingerprinting
sean- 90f7eb4
When clearing the backup servers, set the length to zero.
sean- 6cdc055
Change the constants used to match the struct definitions
sean- d6769f5
Create a weak decoder to parse time.Duration.
sean- 6b8a9b4
Update the `nomad_server_service` default from `nomad-server` to just…
sean- b235759
Register the serf service with the Nomad server service.
sean- ab99e89
Reconcile, clean up, and centralize API version numbers (major and mi…
sean- 6264a8e
Unused code wasn't as unused as I thought. Restore.
sean- c8bf53b
Fix a comment to be more correct
sean- b9f230b
Move client.DefaultConfig() to client/config.DefaultConfig()
sean- 6785e76
Provide a default ConsulConfig for client/config.DefaultConfig()
sean- ed30876
Change the endpoint for `/v1/agent/servers` and fix tests.
sean- 5b0a969
Fix the client/rpcproxy unit tests.
sean- a553956
Fix tests for client.TestAgent_ServerConfig
sean- 37e7038
Fix config_parse_test to reflect that `consul.addr` does not exist.
sean- f037658
Add some trace-level logging for /v1/agent/servers when writing
sean- ac174db
Fix building tests that used `DefaultConfig()` but didn't pickup the …
sean- 6908846
Add a quick set of client/rpcproxy.ServerEndpoint equality tests
sean- 453a755
Pick the right `DefaultConfig` from the right package.
sean- f9862d4
Update godoc for newServer to reflect DNS and IP-based inputs
sean- 329057e
Only actively test Consul when env `CONSUL_HTTP_ADDR` is set
sean- 503c6a9
Fix test TestClientConfigCommand_UpdateServers()
sean- 445386b
Remove unused constants
sean- 41904f2
Clean up some docs and comments to be more accurate
sean- 4300cb3
Remove unused variable
sean- ab434b4
Fix typo in comment
sean- 66dc946
Don't clobber the default consul config in tests
sean- 7538667
Push down the server list even on node registration and evaluation
sean- f15d84e
Use a monotonically incrementing number to create unique node names.
sean- 73c1560
Rename `backupServerDeadline` to `consulPullHeartbeatDeadline`
sean- 07799b6
Nuke the last of the explicit types in favor of using language idioms
sean- 9de9634
Clean up various comments
sean- c8b2f7c
Flesh out the comment re: the client.rpcproxy.Run() task.
sean- 8dd833f
Use the client configCopy and lock appropriately.
sean- 8d478b9
Make the locking protocol more explicit in client.NewClient
sean- f0c6b70
Fix up the comments
sean- 1ec5374
Rename rpcproxy.UpdateFromNodeUpdateResponse to RefreshServerLists
sean- cf052e5
Line wrap long line.
sean- 8bbd763
Use client.getAllocRunners() where appropriate.
sean- 998f285
Ensure that all accesses to Client.alloc are wrapped by allocLock.
sean- 86b5d31
Move `const` block to the top of the file.
sean- bbf7348
Bump the default Consul client timeout from 500ms to 5s.
sean- 273e8cf
Collapse rpcproxy_internal_test.go into rpcproxy_test.go
sean- 68f7afc
Collapse server_endpoint_internal_test.go into server_endpoint_test.go
sean- 4e03dc5
Remove named return parameters
sean- 1352f7f
Change client/consul.NewSyncer() to accept a shutdown channel
sean- 107fc1b
Rename createCheck() to createDelegatedCheck() for clarity
sean- acb3d58
Refine Nomad's Consul `port` handling.
sean- a208115
Rename structs.Services to structs.ConsulServices
sean- cf8beb7
Change the signature of the PeriodicCallback to return an error
sean- 74e691c
Change the API signature of Syncer.SyncServices().
sean- e858928
Rename Syncer.SetServiceIdentifier to SetServiceRegPrefix()
sean- 57c2c81
Move package client/consul/sync to command/agent/consul.
sean- b6a2ec2
Remove Syncer.registerService()
sean- 54838b9
Rename structs.Task's `Service` attribute to `ConsulService`
sean- 3052e74
Move the start of the UniversalExecutor's consulSyncer to initialize …
sean- 7ad5cd5
Begin leveraging the Agent-level consul.Syncer
sean- 802a8c4
Rename command/agent/consul/sync.go to syncer.go
sean- 3e95ca6
Per-comment, remove structs.Allocation's Services attribute.
sean- a4f605a
Initialize Consul for the Nomad Agent in a more uniform way.
sean- 8be79cf
Add "Service Groups" to the Syncer.
sean- d87c697
Update Syncer.Run() to call SyncServices().
sean- 5913acf
Rename runChecks to consulAvailable
sean- d1ab21f
Generate and sync Consul ServiceIDs consistently
sean- d2dcf27
Populate the RPC Proxy's server list if heartbeat did not include a l…
sean- 19f765e
Sync services with Consul by comparing the AgentServiceReg w/ ConsulS…
sean- 7d060c2
Sync checks with Consul by comparing the AgentCheckReg w/ ConsulService
sean- 9b984d0
Update the structure of ConsulService to match reality.
sean- 27f6ffd
On Syncer Shutdown, remove all services that match a Syncer's prefix.
sean- d810590
Create a consulContext using a client's consul config.
sean- f7b2949
Properly cover Syncer attributes with the registryLock.
sean- 05e713c
Skip nil check for agent's consulSyncer is always not nil
sean- 69aa8e8
Don't spam the consul if Consul is not available.
sean- c426b85
Hand wave over the syncer tests atm, these will be fixed shortly.
sean- 8f83c2e
Move RPCProxy.New() adjacent to its struct definition
sean- 4b5310e
Properly guard consulPullHeartbeatDeadline behind heartbeatLock
sean- 5757e50
Only return the Client's server addresses, never mix-in server peers
sean- a423f07
Stash client and server registration behind consul.auto_register
sean- a55d3f1
Rename `updateNodeUpdateResponse` to `constructNodeServerInfoResponse`
sean- 8c8f33d
Always pass in a snapshot before calling constructNodeServerInfoRespo…
sean- b57f7c9
Style nit: remove `var` block
sean- 709b6bd
Fold RaftPeers() into its only call site now
sean- a7047bb
Prefix all log entries in client/rpcproxy with client.rpcproxy
sean- f07c910
Formatting nit: remove brackets
sean- dbdebca
golint(1) police
sean- ecd84f4
Nomad does not use Serf at the client level. Use a hard lock.
sean- 83e3df0
Rename listLock to activatedListLock
sean- 2ac7ecb
Remove useless statement
sean- 61a36a6
Commit miss, bump to 5s
sean- aff951c
Always create a consul.Syncer. Use a default Consul Config if necessary.
sean- 91582dc
Always create a consul.Syncer. Use a default Consul Config if necessary.
sean- a0902c3
Prevent duplicate servers being added in AddPrimaryServer.
sean- 4e543b6
Restore old behavior and have AddPrimaryServer() return a pointer to …
sean- 4826728
Fix another unit test not expecting ServiceID
sean- 5ffd970
Expose rpcproxy's `ServerEndpoint()` constructor, `newServer()` as `N…
sean- 6819f2b
Query for the Nomad service across multiple Consul datacenters.
sean- 5331ea7
goling(1) compliance pass (e.g. Rpc* -> RPC)
sean- 2879c33
Perform a nil-check for Executor's consulServices.
sean- 183b51d
Remove default values and use nil for the executor. Much better.
sean- a8b53b0
Prefer `%+q` over `%q` in log messages.
sean- 8d0b798
Walk the DCs from nearest to most remote, no limit on the search.
sean- 006d1a3
Walk the DCs from nearest to most remote.
sean- File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prefer
%+q
over %q
in log messages.
- Loading branch information
commit a8b53b05b481caf41c80335bdcee5298a1c87c39
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably get rid of this and just use something like: https://play.golang.org/p/BnIufB8mJu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I explicitly did this so that each element is quoted:
"foo", "bar"
vsfoo, bar
because I wanted to make sure any spaces or non-ascii characters are quoted and escaped. But, good point, I forgot the+
format verb modifier%+q
:https://play.golang.org/p/7xkB1onztD