Vote for the incumbent if still reachable
Dependencies
- [2]
FIIWK33FFixing lock issues - [3]
NPSWSVZNInit - [4]
ENEREHTWRestart and rewind the server during failover (requires policykit)
Change contents
- replacement in src/main.rs at line 233
let mut lock = client.campaign("postrep", host.as_str(), id).await?;let candidate = {let l = leader.borrow().as_str().to_string();if l.is_empty() {host.clone()} else {use std::net::ToSocketAddrs;let s = (l.as_str(), 5432).to_socket_addrs().unwrap().next().unwrap();if tokio::time::timeout(std::time::Duration::from_secs(120),tokio::net::TcpStream::connect(&s),).await.is_ok(){l} else {host.clone()}}};let mut lock = client.campaign("postrep", candidate, id).await?;