m/node/core/consensus: always use member name as address
Instead of explicitly giving the consensus service an address to listen
on, we now just give it a hostname. Etcd will resolve the name itself on
startup. It's not yet known if it will re-resolve it and handle changes.
If that's not the case, we will have to implement a restarting
babysitter process instead.
Test Plan: E2e tests should cover this.
X-Origin-Diff: phab/D734
GitOrigin-RevId: c2255b2956137e2bbd705ac1965418c0540d0046
diff --git a/metropolis/node/core/cluster/manager.go b/metropolis/node/core/cluster/manager.go
index 6c85fb3..d7ffe5a 100644
--- a/metropolis/node/core/cluster/manager.go
+++ b/metropolis/node/core/cluster/manager.go
@@ -318,13 +318,12 @@
node := NewNode(cuk, ip, *cert.Leaf)
m.consensus = consensus.New(consensus.Config{
- Data: &m.storageRoot.Data.Etcd,
- Ephemeral: &m.storageRoot.Ephemeral.Consensus,
- NewCluster: true,
- Name: node.ID(),
- InitialCluster: ip.String(),
- ExternalHost: ip.String(),
- ListenHost: ip.String(),
+ Data: &m.storageRoot.Data.Etcd,
+ Ephemeral: &m.storageRoot.Ephemeral.Consensus,
+ NewCluster: true,
+ Name: node.ID(),
+ // STOPGAP: this will not be used after the manager rewrite.
+ ExternalHost: ip.String(),
})
if err := supervisor.Run(ctx, "consensus", m.consensus.Run); err != nil {
return fmt.Errorf("when starting consensus: %w", err)