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 f7065ef7831de..a4a0c53976ef9 100644 --- a/physical/raft/raft.go +++ b/physical/raft/raft.go @@ -663,6 +663,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 }