Skip to content

Commit 7a5921c

Browse files
committed
set MaxAppendEntries to max
1 parent 73aa0db commit 7a5921c

File tree

1 file changed

+6
-0
lines changed
  • pkg/experiment/metastore/raftnode

1 file changed

+6
-0
lines changed

Diff for: pkg/experiment/metastore/raftnode/node.go

+6
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ func (n *Node) Init() (err error) {
157157
raftConfig.SnapshotInterval = n.config.SnapshotInterval
158158
raftConfig.LocalID = raft.ServerID(n.config.ServerID)
159159

160+
// Maximum number of buffered commands (default: 64).
161+
// This sets the size of the channel used to queue commands
162+
// for the FSM to apply.
163+
raftConfig.MaxAppendEntries = 1 << 10
164+
raftConfig.BatchApplyCh = true
165+
160166
n.raft, err = raft.NewRaft(raftConfig, n.fsm, n.logStore, n.stableStore, n.snapshotStore, n.transport)
161167
if err != nil {
162168
return fmt.Errorf("starting raft node: %w", err)

0 commit comments

Comments
 (0)