Skip to content

Commit

Permalink
Enhance the example which showcases the snapshot maintenance operatio…
Browse files Browse the repository at this point in the history
…n. (#83)

* Snapshot hash is sent after the first occurance of `r.remaining_bytes() == 0`.
  See etcd-io/etcd#11896 for more information.

* If the snapshot operation is performed as shown in the example previously,
  restarting the etcd on the stored data from this won't succeed unless etcd
  is started with `--skip-hash-check=true`.
  This isn't necessary anymore since the final `msg.message().await` fetches
  the snapshot hash information.
  • Loading branch information
renormalize authored Aug 18, 2024
1 parent efdf099 commit 512a1f4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/maintenance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ async fn main() -> Result<(), Error> {
}
}
}
let resp = msg.message().await?;
if let Some(r) = resp {
// snapshot hash is sent after r.remaining_bytes() == 0
println!(
"Received snapshot hash {:?} of len {}",
r.blob(),
r.blob().len()
);
}

// Mover leader
let resp = client.member_list().await?;
Expand Down

0 comments on commit 512a1f4

Please sign in to comment.