diff options
author | Alex Auvolat <alex@adnab.me> | 2021-03-05 16:22:29 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-03-05 16:22:29 +0100 |
commit | d7e005251dad73eb7d6f2154c6082f61d16554d0 (patch) | |
tree | a160bf1dfff3555bcf8a3c52a40863cde2cc4a51 /src/rpc/membership.rs | |
parent | 3882d5ba36f48751fdf6e5b82eae0dd990238655 (diff) | |
download | garage-d7e005251dad73eb7d6f2154c6082f61d16554d0.tar.gz garage-d7e005251dad73eb7d6f2154c6082f61d16554d0.zip |
Not fully tested: new multi-dc MagLev
Diffstat (limited to 'src/rpc/membership.rs')
-rw-r--r-- | src/rpc/membership.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/rpc/membership.rs b/src/rpc/membership.rs index f9047b35..44d7122a 100644 --- a/src/rpc/membership.rs +++ b/src/rpc/membership.rs @@ -218,12 +218,7 @@ impl System { .unwrap_or("<invalid utf-8>".to_string()), }; - let mut ring = Ring { - config: net_config, - ring: Vec::new(), - n_datacenters: 0, - }; - ring.rebuild_ring(); + let ring = Ring::new(net_config); let (update_ring, ring) = watch::channel(Arc::new(ring)); let rpc_path = MEMBERSHIP_RPC_PATH.to_string(); @@ -531,10 +526,7 @@ impl System { let ring: Arc<Ring> = self.ring.borrow().clone(); if adv.version > ring.config.version { - let mut ring = ring.as_ref().clone(); - - ring.config = adv.clone(); - ring.rebuild_ring(); + let ring = Ring::new(adv.clone()); update_lock.1.broadcast(Arc::new(ring))?; drop(update_lock); |