raft: separate MaxCommittedSizePerReady config from MaxSizePerMsg

Prior to this change, MaxSizePerMsg was used both to cap the total byte size of
entries in messages as well as the total byte size of entries passed through
CommittedEntries in the Ready struct. This change adds a new Config parameter
MaxCommittedSizePerReady which defaults to MaxSizePerMsg and contols the second
of above descibed settings.
This commit is contained in:
Andrew Werner
2018-11-13 12:48:51 -05:00
parent ee9dcbca0d
commit e4af2be5bb
3 changed files with 19 additions and 8 deletions

View File

@@ -894,7 +894,7 @@ func TestAppendPagination(t *testing.T) {
func TestCommitPagination(t *testing.T) {
s := NewMemoryStorage()
cfg := newTestConfig(1, []uint64{1}, 10, 1, s)
cfg.MaxSizePerMsg = 2048
cfg.MaxCommittedSizePerReady = 2048
r := newRaft(cfg)
n := newNode()
go n.run(r)