diff --git a/src/governor/mod.rs b/src/governor/mod.rs index 4439675948b1d5ef2b561e3c87387a0e9a9b8d9b..7dd84db70260591fcf97636bcfeee8ff5b7e1291 100644 --- a/src/governor/mod.rs +++ b/src/governor/mod.rs @@ -1,5 +1,5 @@ use std::borrow::Cow; -use std::collections::{HashMap, HashSet}; +use std::collections::HashMap; use std::iter::repeat; use std::rc::Rc; use std::time::Duration; @@ -466,32 +466,6 @@ impl Loop { return Continue; } - let res = (|| -> Result<()> { - // Promote the replication leaders again - // because of tarantool bugs - let replicasets = storage.replicasets.iter()?; - let masters = replicasets.map(|r| r.master_id).collect::<HashSet<_>>(); - let commit = raft_storage.commit()?.unwrap(); - let reqs = maybe_responding(&instances) - .filter(|instance| masters.contains(&instance.instance_id)) - .map(|instance| instance.instance_id.clone()) - .zip(repeat(replication::promote::Request { - term, - commit, - timeout: Self::SYNC_TIMEOUT, - })); - // TODO: don't hard code timeout - let res = call_all(pool, reqs, Duration::from_secs(3))?; - for (instance_id, resp) in res { - resp?; - tlog!(Debug, "promoted replicaset master"; "instance_id" => %instance_id); - } - Ok(()) - })(); - if let Err(e) = res { - tlog!(Warning, "failed to promote replicaset masters: {e}"); - } - tlog!(Info, "sharding is initialized"); return Continue;