Skip to content

Commit 5984aa2

Browse files
committed
ensure reshard input is deterministic when reading in
1 parent 119ce01 commit 5984aa2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/qos_client/src/cli/services.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,13 +816,15 @@ pub fn generate_reshard_input(
816816
let old_share_set = get_share_set(old_share_set_dir);
817817
let new_share_set = get_share_set(new_share_set_dir);
818818

819-
let reshard_input = ReshardInput {
819+
let mut reshard_input = ReshardInput {
820820
quorum_keys,
821821
new_share_set,
822822
old_share_set,
823823
enclave: nitro_config,
824824
};
825825

826+
reshard_input.deterministic();
827+
826828
write_json_with_msg(
827829
reshard_input_path.as_ref(),
828830
&reshard_input,
@@ -2461,8 +2463,9 @@ fn read_reshard_input(file: String) -> Result<ReshardInput, Error> {
24612463
error: e.to_string(),
24622464
})?;
24632465

2464-
let reshard_input: ReshardInput = serde_json::from_slice(&buf)
2466+
let mut reshard_input: ReshardInput = serde_json::from_slice(&buf)
24652467
.map_err(|e| Error::FileDidNotHaveValidReshardInput(e.to_string()))?;
2468+
reshard_input.deterministic();
24662469

24672470
Ok(reshard_input)
24682471
}

0 commit comments

Comments
 (0)