Skip to content

Commit

Permalink
Enhance the example which showcases the snapshot maintenance operation.
Browse files Browse the repository at this point in the history
* Snapshot hash is sent after the first occurence 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 committed Aug 16, 2024
1 parent 0443300 commit 618f583
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 618f583

Please sign in to comment.