Skip to content

Commit

Permalink
[storage] change async commit queue length (aptos-labs#2357)
Browse files Browse the repository at this point in the history
  • Loading branch information
lightmark authored Jul 31, 2022
1 parent 656e0c9 commit abea67d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion storage/aptosdb/src/state_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type StateValueBatch = aptos_jellyfish_merkle::StateValueBatch<StateKey, StateVa
pub const MAX_VALUES_TO_FETCH_FOR_KEY_PREFIX: usize = 10_000;
// We assume TARGET_SNAPSHOT_INTERVAL_IN_VERSION > block size.
const MAX_WRITE_SETS_AFTER_SNAPSHOT: LeafCount = buffered_state::TARGET_SNAPSHOT_INTERVAL_IN_VERSION
* ((buffered_state::ASYNC_COMMIT_CHANNEL_BUFFER_SIZE + 2) * 2 - 1)
* (buffered_state::ASYNC_COMMIT_CHANNEL_BUFFER_SIZE + 2 + 1/* Rendezvous channel */)
* 2;

#[derive(Debug)]
Expand Down
5 changes: 3 additions & 2 deletions storage/aptosdb/src/state_store/state_snapshot_committer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! This file defines the state snapshot committer running in background thread within StateStore.
use crate::state_merkle_db::StateMerkleDb;
use crate::state_store::buffered_state::{CommitMessage, ASYNC_COMMIT_CHANNEL_BUFFER_SIZE};
use crate::state_store::buffered_state::CommitMessage;
use crate::state_store::state_merkle_batch_committer::{
StateMerkleBatch, StateMerkleBatchCommitter,
};
Expand All @@ -27,8 +27,9 @@ impl StateSnapshotCommitter {
state_merkle_db: Arc<StateMerkleDb>,
state_snapshot_commit_receiver: Receiver<CommitMessage<Arc<StateDelta>>>,
) -> Self {
// Rendezvous channel
let (state_merkle_batch_commit_sender, state_merkle_batch_commit_receiver) =
mpsc::sync_channel(ASYNC_COMMIT_CHANNEL_BUFFER_SIZE as usize);
mpsc::sync_channel(0);
let arc_state_merkle_db = Arc::clone(&state_merkle_db);
let join_handle = std::thread::Builder::new()
.name("state_merkle_batch_committer".to_string())
Expand Down

0 comments on commit abea67d

Please sign in to comment.