microsoft / microsoft/etcd3

Need a way to alter the hosts/endpoints at runtime?

Open
#157 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
546
Forks
76
Avg merge
22h 46m
Merged PRs (30d)
13

Description

In order for services to behave themselves while the underlying etcd cluster is mutating (old nodes being replaced by new nodes) how can I tell my Etcd3 instance to abandon certain endpoints and adopt new ones?

As I understand it, ClusterClient is for altering the shape of the cluster itself, which is not what I want.
I just want to just read/write data from the cluster, and to adapt the shape of a cluster after it has changed.

Presently, I use an SRV record to initialize the client with something like:

      ...
      let result = await resolveSrv(cfg.discoverySrv);
      cfg.hosts = result.filter((r) => r.port == 2379).map((r) => `https://${r.name}:${r.port}`);
      const root = new etcd3(cfg);
      ...

I would like to periodically check the SRV record at runtime, and update the hosts value in the Etcd client, but I don't see a way to do that.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the Etcd3 instance is constructed from cfg.hosts and how endpoint connections are maintained. Compare that behavior with the stated ClusterClient scope and the SRV-discovery example. Done means a client can abandon old endpoints and adopt new ones at runtime while continuing reads and writes without recreating the instance.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, nodejs, typescript
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.