raft: Set BatchApplyCh for more consistent batch sizes (#11907)

* raft: Set BatchApplyCh for more consistent batch sizes

* Add changelog file
This commit is contained in:
Brian Kassouf 2021-06-21 12:00:41 -07:00 committed by GitHub
parent 096a354626
commit a794a6244f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

3
changelog/11907.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
raft: Improve raft batch size selection
```

View File

@ -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
}