Skip to content

Commit

Permalink
[Sharded-Execution] Fix a race condition while fetching the state val…
Browse files Browse the repository at this point in the history
…ues on a shard from a remote stateview (aptos-labs#10320)

[Sharded-Execution] Fix a race condition while fetching the state values on a shard from a remote stateview
  • Loading branch information
manudhundi authored and Zekun Wang committed Oct 13, 2023
1 parent 3d5db50 commit 2addd5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions execution/executor-service/src/remote_state_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ impl RemoteStateViewClient {
}

fn pre_fetch_state_values(&self, state_keys: Vec<StateKey>) {
state_keys.clone().into_iter().for_each(|state_key| {
self.state_view.read().unwrap().insert_state_key(state_key);
});
state_keys
.chunks(REMOTE_STATE_KEY_BATCH_SIZE)
.map(|state_keys_chunk| state_keys_chunk.to_vec())
Expand All @@ -128,9 +131,6 @@ impl RemoteStateViewClient {
Self::send_state_value_request(shard_id, sender, state_keys);
});
});
state_keys.into_iter().for_each(|state_key| {
self.state_view.read().unwrap().insert_state_key(state_key);
});
}

fn send_state_value_request(
Expand Down

0 comments on commit 2addd5e

Please sign in to comment.