Skip to content

Commit

Permalink
ensure reshard input is deterministic when reading in
Browse files Browse the repository at this point in the history
  • Loading branch information
emostov committed Apr 22, 2024
1 parent 119ce01 commit 5984aa2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/qos_client/src/cli/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,13 +816,15 @@ pub fn generate_reshard_input(
let old_share_set = get_share_set(old_share_set_dir);
let new_share_set = get_share_set(new_share_set_dir);

let reshard_input = ReshardInput {
let mut reshard_input = ReshardInput {
quorum_keys,
new_share_set,
old_share_set,
enclave: nitro_config,
};

reshard_input.deterministic();

write_json_with_msg(
reshard_input_path.as_ref(),
&reshard_input,
Expand Down Expand Up @@ -2461,8 +2463,9 @@ fn read_reshard_input(file: String) -> Result<ReshardInput, Error> {
error: e.to_string(),
})?;

let reshard_input: ReshardInput = serde_json::from_slice(&buf)
let mut reshard_input: ReshardInput = serde_json::from_slice(&buf)
.map_err(|e| Error::FileDidNotHaveValidReshardInput(e.to_string()))?;
reshard_input.deterministic();

Ok(reshard_input)
}
Expand Down

0 comments on commit 5984aa2

Please sign in to comment.