diff --git a/changelog/11907.txt b/changelog/11907.txt new file mode 100644 index 0000000000000..e2bbafe95e16f --- /dev/null +++ b/changelog/11907.txt @@ -0,0 +1,3 @@ +```release-note:improvement +raft: Improve raft batch size selection +``` diff --git a/physical/raft/raft.go b/physical/raft/raft.go index 6ca75043f3455..06b32220e67ce 100644 --- a/physical/raft/raft.go +++ b/physical/raft/raft.go @@ -671,6 +671,11 @@ func (b *RaftBackend) applyConfigSettings(config *raft.Config) error { config.NoSnapshotRestoreOnStart = true config.MaxAppendEntries = 64 + // Setting BatchApplyCh allows the raft library to enqueue up to + // MaxAppendEntries into each raft apply rather than relying on the + // scheduler. + config.BatchApplyCh = true + return nil }