Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable raft message batching (#1519) #3964

Merged
merged 2 commits into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ impl Consensus {
}
log::debug!("Local raft state found - skipping initialization");
};

let mut node = Node::new(&raft_config, state_ref.clone(), logger)?;
node.set_batch_append(true);

// Before consensus has started apply any unapplied committed entries
// They might have not been applied due to unplanned Qdrant shutdown
let _stop_consensus = state_ref.apply_entries(&mut node)?;
Expand Down Expand Up @@ -966,7 +969,7 @@ impl RaftMessageBroker {
}

fn message_sender(&self) -> (RaftMessageSender, RaftMessageSenderHandle) {
let (messages_tx, messages_rx) = tokio::sync::mpsc::channel(256);
let (messages_tx, messages_rx) = tokio::sync::mpsc::channel(128);
let (heartbeat_tx, heartbeat_rx) = tokio::sync::watch::channel(Default::default());

let task = RaftMessageSender {
Expand Down