Skip to content

Commit

Permalink
raft: Set BatchApplyCh for more consistent batch sizes (#11907)
Browse files Browse the repository at this point in the history
* raft: Set BatchApplyCh for more consistent batch sizes

* Add changelog file
  • Loading branch information
briankassouf committed Jun 21, 2021
1 parent f42070a commit 053a7f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/11907.txt
@@ -0,0 +1,3 @@
```release-note:improvement
raft: Improve raft batch size selection
```
5 changes: 5 additions & 0 deletions physical/raft/raft.go
Expand Up @@ -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
}

Expand Down

0 comments on commit 053a7f2

Please sign in to comment.