Skip to content

Commit

Permalink
[quorum store] constrain txn pull size to sender_max_batch_txns
Browse files Browse the repository at this point in the history
  • Loading branch information
bchocho committed Mar 14, 2024
1 parent 7af044d commit 40ab4f8
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_batch_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 40ab4f8

Please sign in to comment.