Skip to content
Snippets Groups Projects
Commit e2f78e54 authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

fix(governor): don't promote masters after vshard.*.cfg

parent 84d85a83
No related branches found
No related tags found
1 merge request!425dont promote masters after vshard
Pipeline #14258 failed
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment