Skip to main content

Module discovery

Module discovery 

Source
Expand description

SRV-005 R1: seed-node discovery over beamr distribution.

Beamr does not run EPMD; distribution callers supply a NodeResolver that maps a node name to a socket address. A liminal operator configures seed addresses, not names — the peer’s real distribution name is only learned from the authenticated handshake. We bridge the two with ClusterResolver:

  • Each configured seed gets a synthetic dial label (seed-{i}@{addr}) mapped to its address. Discovery dials those labels.
  • ConnectionManager::connect re-keys the connection table by the name the peer advertises in the handshake — the synthetic label is throwaway and never becomes a table key, so it cannot collide with a real node name.
  • After a successful dial we learn the peer’s real name and register real_name -> addr in the resolver, so beamr can re-dial that peer by name later (e.g. an outbound send after a transient drop) without us re-deriving the address.

The SAME resolver instance is handed to the channel-supervisor scheduler’s [DistributionConfig] and used here to dial seeds, so every distribution component resolves names consistently.

Structs§

ClusterResolver
A distribution node resolver that learns name -> address mappings at runtime.
SeedConnectOutcome
Outcome of attempting to connect to the configured seeds (R1).

Functions§

as_resolver
Coerces a concrete cluster resolver into the shared distribution Resolver handle the scheduler’s DistributionConfig expects.
connect_seeds
Dials every seed label through connections, learning each reachable peer’s real name into resolver (R1).
register_seed_labels
Registers a synthetic dial label per seed onto an EXISTING resolver.
seed_resolver
Builds a ClusterResolver pre-seeded with a synthetic dial label per seed address and returns it alongside those labels (in seed order).