Skip to main content

Crate tellus_bootstrap_dns

Crate tellus_bootstrap_dns 

Source
Expand description

DNS seed discovery for tellus cluster bootstrap: DnsSeeds implements SeedDiscovery, resolving seed addresses from SRV records, which carry address and port (e.g. a Kubernetes headless service), or from A/AAAA records paired with a configured port. Pass it to bootstrap, which resolves it every resolve_interval and joins through the resolved addresses on every resolution, retrying resolve failures, e.g. records still appearing while an orchestrator starts the other nodes. Only forming a new cluster waits for the view to settle. SRV targets resolve concurrently; a failing target is skipped while any other resolves, and a set resolving no address at all remains an error so bootstrap does not settle on it. Nothing here distinguishes a stale target from a transient failure, because the resolver does not either, so both are skipped alike. A partial view does settle, so a target failing throughout the settle window shrinks the universe a FormationProvider counts its majority against.

Whatever is queried must resolve to one address per node, since bootstrap counts addresses and a peer is only admitted at the address it advertises; on Kubernetes that makes the headless service single stack, see this crate’s README.

The default resolver keeps no response cache. Bootstrap polls DNS to see nodes come and go, and a cached answer would hide a node registered after it for the record’s TTL, e.g. a sibling restarting a moment later than this one. A resolver given via DnsSeeds::with_resolver is used as configured.

Structs§

DnsSeeds
Seed discovery via DNS, the SeedDiscovery for clusters whose nodes are named by DNS records instead of configured addresses.
DnsSeedsError
A DNS resolution failure; bootstrap logs and retries it.

Enums§

Query
What DnsSeeds resolves, deserializable with the serde feature: a config file names either form as a single key, srv: _tellus._udp.example or ip: { name: nodes.example, port: 7000 }.