B:BD[
2.3449] → [
2.3449:3489]
∅:D[
2.3489] → [
5.3989:4112]
B:BD[
5.3989] → [
5.3989:4112]
B:BD[
5.4112] → [
2.3490:3600]
let out = Command::new("systemctl")
.args(["start", "postgresql-repl"])
.output()
.await
.expect("failed to execute process");
std::io::stdout().write_all(&out.stdout).unwrap();
std::io::stderr().write_all(&out.stderr).unwrap();
std::fs::write(
std::path::Path::new(path).join("postgresql.auto.conf"),
format!(
"primary_conninfo = 'host={} port=5432 user=replication password={}'",
leader, password,
),
)
.unwrap();
let mut success = false;
while !success {
let out = Command::new("systemctl")
.args(["start", "postgresql-repl"])
.output()
.await
.expect("failed to execute process");
std::io::stdout().write_all(&out.stdout).unwrap();
std::io::stderr().write_all(&out.stderr).unwrap();
success = out.status.success();
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
}