Skip to content

Commit

Permalink
Change consensus pipeline backpressure to exclude consensus ordering …
Browse files Browse the repository at this point in the history
…latency (aptos-labs#8246)
  • Loading branch information
igor-aptos authored May 23, 2023
1 parent f7fe442 commit 3f08dfd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions consensus/src/block_storage/block_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ mod block_store_test;
#[path = "sync_manager.rs"]
pub mod sync_manager;

const MAX_ORDERING_PIPELINE_LATENCY_REDUCTION: Duration = Duration::from_secs(1);

fn update_counters_for_ordered_blocks(ordered_blocks: &[Arc<ExecutedBlock>]) {
for block in ordered_blocks {
observe_block(block.block().timestamp_usecs(), BlockStage::ORDERED);
Expand Down Expand Up @@ -540,13 +542,13 @@ impl BlockStore {
}

let latency_to_committed = latency_from_proposal(proposal_timestamp, committed_timestamp);
let latency_to_ordered = latency_from_proposal(proposal_timestamp, ordered_timestamp);

info!(
pending_rounds = pending_rounds,
ordered_round = ordered_round,
commit_round = commit_round,
latency_to_ordered_ms =
latency_from_proposal(proposal_timestamp, ordered_timestamp).as_millis() as u64,
latency_to_ordered_ms = latency_to_ordered.as_millis() as u64,
latency_to_committed_ms = latency_to_committed.as_millis() as u64,
latency_to_commit_cert_ms =
latency_from_proposal(proposal_timestamp, commit_cert_timestamp).as_millis() as u64,
Expand All @@ -557,6 +559,7 @@ impl BlockStore {
counters::CONSENSUS_PROPOSAL_PENDING_DURATION.observe(latency_to_committed.as_secs_f64());

latency_to_committed
.saturating_sub(latency_to_ordered.min(MAX_ORDERING_PIPELINE_LATENCY_REDUCTION))
}
}

Expand Down

0 comments on commit 3f08dfd

Please sign in to comment.