From abea67d81c59e05456767131102b6eef3804c75f Mon Sep 17 00:00:00 2001 From: Aaron Date: Sat, 30 Jul 2022 23:36:12 -0700 Subject: [PATCH] [storage] change async commit queue length (#2357) --- storage/aptosdb/src/state_store/mod.rs | 2 +- storage/aptosdb/src/state_store/state_snapshot_committer.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/storage/aptosdb/src/state_store/mod.rs b/storage/aptosdb/src/state_store/mod.rs index 547dec3e47a98..81b25e9ec207c 100644 --- a/storage/aptosdb/src/state_store/mod.rs +++ b/storage/aptosdb/src/state_store/mod.rs @@ -51,7 +51,7 @@ type StateValueBatch = aptos_jellyfish_merkle::StateValueBatch 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)] diff --git a/storage/aptosdb/src/state_store/state_snapshot_committer.rs b/storage/aptosdb/src/state_store/state_snapshot_committer.rs index c63d9b44bc1b3..f9135ff091831 100644 --- a/storage/aptosdb/src/state_store/state_snapshot_committer.rs +++ b/storage/aptosdb/src/state_store/state_snapshot_committer.rs @@ -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, }; @@ -27,8 +27,9 @@ impl StateSnapshotCommitter { state_merkle_db: Arc, state_snapshot_commit_receiver: Receiver>>, ) -> 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())