Skip to content
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 166 commits into from
Jun 11, 2016
Merged

Dynamic Server Lists/Client Bootstrapping #1201

merged 166 commits into from
Jun 11, 2016

Commits on Jun 10, 2016

  1. Configuration menu
    Copy the full SHA
    a1cb3f1 View commit details
    Browse the repository at this point in the history
  2. Use consul/lib's RandomStagger

    Removes four redundant copies of the method in the process.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    7db2eb0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2d23927 View commit details
    Browse the repository at this point in the history
  4. Fix small typo

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    2846614 View commit details
    Browse the repository at this point in the history
  5. Seed random once in main

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    3f9d385 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4030e38 View commit details
    Browse the repository at this point in the history
  7. Rename consul.ConsulConfig to consul.AgentConfig

    There were two `ConsulConfig` structs running around, one of them
    needed to go away.  Rely on the package's path to provide context
    for the type of AgentConfig.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    0e1bdad View commit details
    Browse the repository at this point in the history
  8. Rename client/config/config's ConsulConfig to ConsulAgentConfig

    A follow up commit to the previous rename.  More to come.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    4fed6b0 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1f7bfb3 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    8e25647 View commit details
    Browse the repository at this point in the history
  11. Distill config.Config.ConsulConfig down to config.Config.Consul

    The enclosed struct provides the necessary context
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    af72200 View commit details
    Browse the repository at this point in the history
  12. Fix copy pasta comment.

    These parameters are used to bootstrap Nomad servers, not Consul servers.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    7bf6af8 View commit details
    Browse the repository at this point in the history
  13. Create a nomad/structs/config to break an import cycle.

    Flattening and normalizing the various Consul config structures and
    services has led to an import cycle.  Break this by creating a new package
    that is intended to be terminal in the import DAG.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    092e07f View commit details
    Browse the repository at this point in the history
  14. Rename client/consul/sync.ConsulService to client/consul/sync.Syncer

    Syncer describes the responsibility and actions of the type.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    d84d718 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    f280c59 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    7c6ad53 View commit details
    Browse the repository at this point in the history
  17. Rebalance Nomad client RPCs among different Nomad servers.

    Implement client/rpc_proxy.RpcProxy.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    ffcd233 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    f6e3587 View commit details
    Browse the repository at this point in the history
  19. 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.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    d268dcb View commit details
    Browse the repository at this point in the history
  20. s/availble/runChecks/g

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    e07e77b View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    8da18b6 View commit details
    Browse the repository at this point in the history
  22. Revise Agent.syncAgentServicesWithConsul()'s interface

    Reduce down to its lowest common helper function denominator.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    89d48c8 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    c159e77 View commit details
    Browse the repository at this point in the history
  24. Only poll Consul for servers when Nomad heartbeats begin to fail

    When a deadline timer of 2x Server's last requested TTL expires,
    begin polling Consul for Nomad Servers.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    17927c8 View commit details
    Browse the repository at this point in the history
  25. Remove unused code

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    4e4f0a1 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    fc56585 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    05bbbd2 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    90023c3 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    681a7d6 View commit details
    Browse the repository at this point in the history
  30. Correct a mismerge

    Somewhere along the lines when rebasing I mis-merged a patch.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    7125b85 View commit details
    Browse the repository at this point in the history
  31. Reconcile consul's address configuration section.

    There were conflicting directives previously, both consul.addr and
    consul.address were required to achieve the desired behavior.  The
    documentation said `consul.address` was the canonical name for the
    parameter, so consolidate configuration parameters to `consul.address`.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    71dde1b View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    bc94ce8 View commit details
    Browse the repository at this point in the history
  33. 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.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    e6397da View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    990a094 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    07fa0c5 View commit details
    Browse the repository at this point in the history
  36. Rename client/config/config's ConsulConfig to ConsulAgentConfig

    A follow up commit to the previous rename.  More to come.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    5e0d76f View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    4d30c98 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    6fae3db View commit details
    Browse the repository at this point in the history
  39. Rebalance Nomad client RPCs among different Nomad servers.

    Implement client/rpc_proxy.RpcProxy.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    16b4e5c View commit details
    Browse the repository at this point in the history
  40. 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.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    1fa43a0 View commit details
    Browse the repository at this point in the history
  41. Remove unused code

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    3728771 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    a703c8a View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    22bd2b5 View commit details
    Browse the repository at this point in the history
  44. Rename the package from client/rpc_proxy to client/rpcproxy

    Also rename `NewRpcProxy()` to just `New()` to avoid package stutter.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    7cdf0ed View commit details
    Browse the repository at this point in the history
  45. Fix package name in comments

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    0a5fa55 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    cbed88a View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    1e3feae View commit details
    Browse the repository at this point in the history
  48. s/RpcVersion/RPCVersion/g

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    1034e76 View commit details
    Browse the repository at this point in the history
  49. 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.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    916d93c View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    b293cf3 View commit details
    Browse the repository at this point in the history
  51. Advertise the server's RPC endpoint, not its HTTP endpoint.

    Rename c.serverRpcAddr to serverRpcAddr.  This will be broken out
    into in additional set of services in a subsequent commit.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    ce8c03d View commit details
    Browse the repository at this point in the history
  52. 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.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    bc86e89 View commit details
    Browse the repository at this point in the history
  53. Teach Client to reuse an Agent's consulSyncer.

    "There can be only one."
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    4d47eed View commit details
    Browse the repository at this point in the history
  54. Consolidate all consul sync periodic go routines to handlers.

    Only one pump and periodic loop now.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    9a93496 View commit details
    Browse the repository at this point in the history
  55. Configuration menu
    Copy the full SHA
    bccf131 View commit details
    Browse the repository at this point in the history
  56. Silence unused variable warning

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    2abd37c View commit details
    Browse the repository at this point in the history
  57. Pass the datacenter name in the heartbeat

    Servers that are part of a different datacenter are added as backup
    servers instead of primary servers.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    7034c50 View commit details
    Browse the repository at this point in the history
  58. Fix unit tests

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    57bb374 View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    3d22c22 View commit details
    Browse the repository at this point in the history
  60. Invert error handling logic

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    49266fa View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    9bd2882 View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    ca0f2d9 View commit details
    Browse the repository at this point in the history
  63. 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.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    9998573 View commit details
    Browse the repository at this point in the history
  64. Remove unused function.

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    bf4f031 View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    8a393d7 View commit details
    Browse the repository at this point in the history
  66. Configuration menu
    Copy the full SHA
    90f7eb4 View commit details
    Browse the repository at this point in the history
  67. Configuration menu
    Copy the full SHA
    6cdc055 View commit details
    Browse the repository at this point in the history
  68. Create a weak decoder to parse time.Duration.

    Hat tip to Alex for pointing this out (vs patching mapstructure)
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    d6769f5 View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    6b8a9b4 View commit details
    Browse the repository at this point in the history
  70. Register the serf service with the Nomad server service.

    This will be unused in this PR.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    b235759 View commit details
    Browse the repository at this point in the history
  71. Reconcile, clean up, and centralize API version numbers (major and mi…

    …nor).
    
    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
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    ab99e89 View commit details
    Browse the repository at this point in the history
  72. Configuration menu
    Copy the full SHA
    6264a8e View commit details
    Browse the repository at this point in the history
  73. Configuration menu
    Copy the full SHA
    c8bf53b View commit details
    Browse the repository at this point in the history
  74. 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.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    b9f230b View commit details
    Browse the repository at this point in the history
  75. 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.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    6785e76 View commit details
    Browse the repository at this point in the history
  76. 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.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    ed30876 View commit details
    Browse the repository at this point in the history
  77. Configuration menu
    Copy the full SHA
    5b0a969 View commit details
    Browse the repository at this point in the history
  78. Fix tests for client.TestAgent_ServerConfig

    Add similar logic in Agent `serverConfig()` to set up the
    `serverSerfAddr` the same as `serverHttpAddr` and `serverRpcAddr`.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    a553956 View commit details
    Browse the repository at this point in the history
  79. Fix config_parse_test to reflect that consul.addr does not exist.

    `consul.address` does, but not `consul.addr`.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    37e7038 View commit details
    Browse the repository at this point in the history
  80. Add some trace-level logging for /v1/agent/servers when writing

    This endpoint shouldn't be hit often, but this could be useful in
    logs down the road.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    f037658 View commit details
    Browse the repository at this point in the history
  81. Configuration menu
    Copy the full SHA
    ac174db View commit details
    Browse the repository at this point in the history
  82. Configuration menu
    Copy the full SHA
    6908846 View commit details
    Browse the repository at this point in the history
  83. Pick the right DefaultConfig from the right package.

    Overly zealous search && replace at work here.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    453a755 View commit details
    Browse the repository at this point in the history
  84. Update godoc for newServer to reflect DNS and IP-based inputs

    Requested by: alex
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    f9862d4 View commit details
    Browse the repository at this point in the history
  85. Configuration menu
    Copy the full SHA
    329057e View commit details
    Browse the repository at this point in the history
  86. Fix test TestClientConfigCommand_UpdateServers()

    Now that hostnames are validated on input, switch to IPs since they
    bypass DNS resolution.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    503c6a9 View commit details
    Browse the repository at this point in the history
  87. Remove unused constants

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    445386b View commit details
    Browse the repository at this point in the history
  88. Configuration menu
    Copy the full SHA
    41904f2 View commit details
    Browse the repository at this point in the history
  89. Remove unused variable

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    4300cb3 View commit details
    Browse the repository at this point in the history
  90. Fix typo in comment

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    ab434b4 View commit details
    Browse the repository at this point in the history
  91. Configuration menu
    Copy the full SHA
    66dc946 View commit details
    Browse the repository at this point in the history
  92. Push down the server list even on node registration and evaluation

    Be mindful of the cost of taking a snapshot from the statestore and
    reuse the snapshot if one has already been taken.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    7538667 View commit details
    Browse the repository at this point in the history
  93. Use a monotonically incrementing number to create unique node names.

    Also remove the space from the "name" of the node
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    f15d84e View commit details
    Browse the repository at this point in the history
  94. Configuration menu
    Copy the full SHA
    73c1560 View commit details
    Browse the repository at this point in the history
  95. Configuration menu
    Copy the full SHA
    07799b6 View commit details
    Browse the repository at this point in the history
  96. Clean up various comments

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    9de9634 View commit details
    Browse the repository at this point in the history
  97. Flesh out the comment re: the client.rpcproxy.Run() task.

    Requested by: Alex
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    c8b2f7c View commit details
    Browse the repository at this point in the history
  98. Configuration menu
    Copy the full SHA
    8dd833f View commit details
    Browse the repository at this point in the history
  99. Make the locking protocol more explicit in client.NewClient

    With an over abundance of caution, preevnt future copy/pasta by
    using the right locks when bootstrapping a Client.  Strictly speaking
    this is not necessary, but it makes explicit the locking semantics
    and guards against future concurrent or parallel initialization.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    8d478b9 View commit details
    Browse the repository at this point in the history
  100. Fix up the comments

    Pointed out by: @dadgar
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    f0c6b70 View commit details
    Browse the repository at this point in the history
  101. Rename rpcproxy.UpdateFromNodeUpdateResponse to RefreshServerLists

    While breaking the API within this PR, break out the individual
    arguments to RefreshServerLists.  The servers parameter is reusing
    `structs.NodeServerInfo` for the time being, but this can be revisited
    if the needs of the strucutre diverge in the future.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    1ec5374 View commit details
    Browse the repository at this point in the history
  102. Line wrap long line.

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    cf052e5 View commit details
    Browse the repository at this point in the history
  103. Configuration menu
    Copy the full SHA
    8bbd763 View commit details
    Browse the repository at this point in the history
  104. Configuration menu
    Copy the full SHA
    998f285 View commit details
    Browse the repository at this point in the history
  105. Move const block to the top of the file.

    Requested by: @dadgar
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    86b5d31 View commit details
    Browse the repository at this point in the history
  106. Configuration menu
    Copy the full SHA
    bbf7348 View commit details
    Browse the repository at this point in the history
  107. Configuration menu
    Copy the full SHA
    273e8cf View commit details
    Browse the repository at this point in the history
  108. Configuration menu
    Copy the full SHA
    68f7afc View commit details
    Browse the repository at this point in the history
  109. Remove named return parameters

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    4e03dc5 View commit details
    Browse the repository at this point in the history
  110. Change client/consul.NewSyncer() to accept a shutdown channel

    In addition to the API changing, consul.Syncer can now be signaled
    to shutdown via the Shutdown() method, which will call the Run()'ing
    sync task to exit gracefully.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    1352f7f View commit details
    Browse the repository at this point in the history
  111. Configuration menu
    Copy the full SHA
    107fc1b View commit details
    Browse the repository at this point in the history
  112. Refine Nomad's Consul port handling.

    Previously this would immediately default to '127.0.0.1' if the
    config was set to `:some-port-number`.  Now it uses the BindAddr
    if available.  Also, if the `port` option is set to just a port`
    number (e.g. '1234'), attempt to parse the port number by itself
    to allow statically configured ports to work, even when no host is
    specified.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    acb3d58 View commit details
    Browse the repository at this point in the history
  113. Configuration menu
    Copy the full SHA
    a208115 View commit details
    Browse the repository at this point in the history
  114. Change the signature of the PeriodicCallback to return an error

    I *KNEW* I should have done this when I wrote it, but didn't want to
    go back and audit the handlers to include the appropriate return
    handling, but now that the code is taking shape, make this change.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    cf8beb7 View commit details
    Browse the repository at this point in the history
  115. Change the API signature of Syncer.SyncServices().

    SyncServices() immediately attempts to sync whatever information
    the process has with Consul.  Previously this method would take an
    argument of the exclusive list of services that should exist,
    however this is not condusive to having a Nomad Client and Nomad
    Server share the same consul.Syncer.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    74e691c View commit details
    Browse the repository at this point in the history
  116. Rename Syncer.SetServiceIdentifier to SetServiceRegPrefix()

    This attribute isn't actually an identifier because it can represent
    a collection of services.  Rename `serviceIdentifier` to
    `serviceRegPrefix which more accurately conveys the intention of this
    Syncer attribute.
    
    While here, also rename `SetServiceIdentifier()` to `SetServiceRegPrefix()`
    and `GenerateServiceIdentifier()` to `GenerateServicePrefix()`.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    e858928 View commit details
    Browse the repository at this point in the history
  117. Move package client/consul/sync to command/agent/consul.

    This has been done to allow the Server and Client to reuse the same
    Syncer because the Agent may be running Client, Server, or both
    simultaneously and we only want one Syncer object alive in the agent.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    57c2c81 View commit details
    Browse the repository at this point in the history
  118. Remove Syncer.registerService()

    This call is obsolete by a future commit that changes the canonical
    source of truth to be consul.AgentServiceRegistration structs, which
    means it is not necessary to construct AgentServiceRegistration
    objects every time a registration is made, we just reuse the existing
    object.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    b6a2ec2 View commit details
    Browse the repository at this point in the history
  119. Configuration menu
    Copy the full SHA
    54838b9 View commit details
    Browse the repository at this point in the history
  120. Move the start of the UniversalExecutor's consulSyncer to initialize …

    …once
    
    This should be handled via a sync.Once primative, but I don't want to
    unpack that atm.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    3052e74 View commit details
    Browse the repository at this point in the history
  121. Configuration menu
    Copy the full SHA
    7ad5cd5 View commit details
    Browse the repository at this point in the history
  122. Configuration menu
    Copy the full SHA
    802a8c4 View commit details
    Browse the repository at this point in the history
  123. Per-comment, remove structs.Allocation's Services attribute.

    Nuke PopulateServiceIDs() now that it's also no longer needed.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    3e95ca6 View commit details
    Browse the repository at this point in the history
  124. Initialize Consul for the Nomad Agent in a more uniform way.

    Decompose Client and Server registration into `setupClient()` and
    `setupServer()`, respectively.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    a4f605a View commit details
    Browse the repository at this point in the history
  125. Add "Service Groups" to the Syncer.

    Now the right way to register services with the Syncer is to call
    `SetServices(groupName, []*services)`.  This was required to allow
    the Syncer to sync either the Client, Server, or Both using a
    single Syncer.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    8be79cf View commit details
    Browse the repository at this point in the history
  126. Configuration menu
    Copy the full SHA
    d87c697 View commit details
    Browse the repository at this point in the history
  127. Rename runChecks to consulAvailable

    Apologies in advance for the variable thrash, the fingerprinter is
    no longer used to gate whether or not Consul is available any more.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    5913acf View commit details
    Browse the repository at this point in the history
  128. Configuration menu
    Copy the full SHA
    d1ab21f View commit details
    Browse the repository at this point in the history
  129. Populate the RPC Proxy's server list if heartbeat did not include a l…

    …eader.
    
    It's possible that a Nomad Client is heartbeating with a Nomad server that
    has become issolated from the quorum of Nomad Servers.  When 3x the
    heartbeatTTL has been exceeded, append the Consul server list to the primary
    primary server list.  When the next RPCProxy rebalance occurs, there is a
    chance one of the servers discovered from Consul will be in the majority.
    When client reattaches to a Nomad Server in the majority, it will include
    a heartbeat and will reset the TTLs *AND* will clear the primary server list
    to include only values from the heartbeat.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    d2dcf27 View commit details
    Browse the repository at this point in the history
  130. Sync services with Consul by comparing the AgentServiceReg w/ ConsulS…

    …ervice
    
    The source of truth is the local Nomad Agent.  Any services not local that
    have a matching prefix are removed.  Changed services are re-registered
    and missing services are re-added.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    19f765e View commit details
    Browse the repository at this point in the history
  131. Sync checks with Consul by comparing the AgentCheckReg w/ ConsulService

    The source of truth is the local Nomad Agent.  Any checks are not local that
    have a matching prefix are removed.  Changed checks are re-registered
    and missing checks are re-added.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    7d060c2 View commit details
    Browse the repository at this point in the history
  132. Update the structure of ConsulService to match reality.

    ConsulService is the configuration for a Consul Service
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    9b984d0 View commit details
    Browse the repository at this point in the history
  133. Configuration menu
    Copy the full SHA
    27f6ffd View commit details
    Browse the repository at this point in the history
  134. Create a consulContext using a client's consul config.

    This is wrong and should be the Agent's Consul Config.  This is a
    step in the right direction, so committing to mark the necessary
    future change.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    d810590 View commit details
    Browse the repository at this point in the history
  135. Properly cover Syncer attributes with the registryLock.

    trackedServices, delegateChecks, trackedChecks, and checkRunners
    should all be covered.  This lock needs to be reasonably narrow and
    can't use defer due to possible recursive locking concerns further
    downstream from the call sites.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    f7b2949 View commit details
    Browse the repository at this point in the history
  136. Configuration menu
    Copy the full SHA
    05e713c View commit details
    Browse the repository at this point in the history
  137. Don't spam the consul if Consul is not available.

    Log once when Consul goes away, and log when Consul comes back.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    69aa8e8 View commit details
    Browse the repository at this point in the history
  138. Configuration menu
    Copy the full SHA
    c426b85 View commit details
    Browse the repository at this point in the history
  139. Configuration menu
    Copy the full SHA
    8f83c2e View commit details
    Browse the repository at this point in the history
  140. Configuration menu
    Copy the full SHA
    4b5310e View commit details
    Browse the repository at this point in the history
  141. Configuration menu
    Copy the full SHA
    5757e50 View commit details
    Browse the repository at this point in the history
  142. Configuration menu
    Copy the full SHA
    a423f07 View commit details
    Browse the repository at this point in the history
  143. Configuration menu
    Copy the full SHA
    a55d3f1 View commit details
    Browse the repository at this point in the history
  144. Configuration menu
    Copy the full SHA
    8c8f33d View commit details
    Browse the repository at this point in the history
  145. Style nit: remove var block

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    b57f7c9 View commit details
    Browse the repository at this point in the history
  146. Configuration menu
    Copy the full SHA
    709b6bd View commit details
    Browse the repository at this point in the history
  147. Configuration menu
    Copy the full SHA
    a7047bb View commit details
    Browse the repository at this point in the history
  148. Formatting nit: remove brackets

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    f07c910 View commit details
    Browse the repository at this point in the history
  149. golint(1) police

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    dbdebca View commit details
    Browse the repository at this point in the history
  150. Configuration menu
    Copy the full SHA
    ecd84f4 View commit details
    Browse the repository at this point in the history
  151. Configuration menu
    Copy the full SHA
    83e3df0 View commit details
    Browse the repository at this point in the history
  152. Remove useless statement

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    2ac7ecb View commit details
    Browse the repository at this point in the history
  153. Commit miss, bump to 5s

    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    61a36a6 View commit details
    Browse the repository at this point in the history
  154. Configuration menu
    Copy the full SHA
    aff951c View commit details
    Browse the repository at this point in the history
  155. Configuration menu
    Copy the full SHA
    91582dc View commit details
    Browse the repository at this point in the history
  156. Prevent duplicate servers being added in AddPrimaryServer.

    This logic was already present elsewhere and was missed in this one
    place.
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    a0902c3 View commit details
    Browse the repository at this point in the history
  157. Restore old behavior and have AddPrimaryServer() return a pointer to …

    …the existing server (vs nil when the server already exists).
    sean- committed Jun 10, 2016
    Configuration menu
    Copy the full SHA
    4e543b6 View commit details
    Browse the repository at this point in the history
  158. Configuration menu
    Copy the full SHA
    4826728 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2016

  1. Expose rpcproxy's ServerEndpoint() constructor, newServer() as `N…

    …ewServerEndpoint()`
    sean- committed Jun 11, 2016
    Configuration menu
    Copy the full SHA
    5ffd970 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6819f2b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5331ea7 View commit details
    Browse the repository at this point in the history
  4. Perform a nil-check for Executor's consulServices.

    Executors can `Shutdown()` before calling `SyncServices()`.
    sean- committed Jun 11, 2016
    Configuration menu
    Copy the full SHA
    2879c33 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    183b51d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a8b53b0 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8d0b798 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    006d1a3 View commit details
    Browse the repository at this point in the history