Skip to content

Commit

Permalink
[quorum store] constrain txn pull size to sender_max_total_txns (#12532
Browse files Browse the repository at this point in the history
…) (#12550)

## Description

We were not constraining on the sender side, even though we check on the receiver side. It's an oversight. We hadn't run into this previously because the backpressure configs meant we never tried to pull more than the sender/receiver side limit.
  • Loading branch information
igor-aptos authored Mar 19, 2024
1 parent d708437 commit a4353ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion consensus/src/quorum_store/batch_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,11 @@ impl BatchGenerator {

let dynamic_pull_max_txn = std::cmp::max(
(since_last_non_empty_pull_ms as f64 / 1000.0 * dynamic_pull_txn_per_s as f64) as u64, 1);
let batches = self.handle_scheduled_pull(dynamic_pull_max_txn).await;
let pull_max_txn = std::cmp::min(
dynamic_pull_max_txn,
self.config.sender_max_total_txns as u64,
);
let batches = self.handle_scheduled_pull(pull_max_txn).await;
if !batches.is_empty() {
last_non_empty_pull = tick_start;

Expand Down

0 comments on commit a4353ea

Please sign in to comment.