m3 icon indicating copy to clipboard operation
m3 copied to clipboard

Dynamic Cluster Client Configuration

Open nerd0 opened this issue 7 years ago • 2 comments

Issue

The m3 cluster client interface which is only implemented for ETCD uses static configurations to define the endpoint list for an ETCD cluster. ETCD will use this list to internally load balance this list of endpoints. Combine that feature with the AutoSyncInterval configuration, an ETCD client is able to maintain an up to date list of ETCD cluster members to internally balance against. However if the ETCD cluster members completely change, the static configuration can drift from the active list. Perhaps dynamic configuration generation can address this short coming, however it would be convenient if the endpoint list could provide in a more dynamic fashion during runtime of the process.

Potential Solutions

  1. Implement a standard option and interface pattern which allows for a cluster client channel to be used startup of services such as the dbnode currently allows.

    Pros:

    • Allows users to dynamically update the ETCD client during startup of the service process.

    Cons:

    • Does not reduce the amount of other main.go initialising of various objects required to startup of a service process.
  2. Refactor main.go files for each services (aggregator, dbnode, etc.) to only perform configuration file parsing afterwards call a Setup() or Init() function which has an input parameter of a parsed configuration data structure.

    Pros:

    • Allows users to dynamically update the configuration for services during startup enabling the process to ensure configuration values are up to date.
    • Simple refactor and readability of code does not decrease by much.

    Cons:

    • Would require users to maintain a separate main.go to dynamically update the configuration data structure.
    • Modifying the configuration data structure directly could prove difficult to debug since the configuration values are not deterministic as the configuration inputs can change in an unexpected ways.
    • Unconventional coding style for the Go language.
  3. Redesign the ETCD client implementation of the cluster client interface.

    Pros:

    • Allows the client implementation to be modernize with latest Go paradigms and address short comings discovered over the years.

    Cons:

    • Riskiest approach due to ensuring backwards compatibility with pre-existing usage.
    • If a version two of the ETCD client was created, that could lead to confusion among users.

nerd0 avatar Jul 18 '19 20:07 nerd0

@schallert @mway any opinions?

nerd0 avatar Jul 18 '19 21:07 nerd0

Sorry, this slipped through the cracks.

I'll set up some time for us to discuss; there are a handful of solutions here (several of which you called out), but I'd like to discuss the tradeoffs in a bit more detail.

mway avatar Aug 06 '19 14:08 mway