Skip to content

Commit

Permalink
perf: do not flush wal when receive consensus msgs (#273)
Browse files Browse the repository at this point in the history
* perf: do not flush wal when receive consensus msgs
  • Loading branch information
egonspace committed Jul 8, 2021
1 parent 162c63c commit 50cffac
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -844,12 +844,8 @@ func (cs *State) receiveRoutine(maxSteps int) {
cs.handleMsg(mi)

case mi = <-cs.internalMsgQueue:
err := cs.wal.WriteSync(mi) // NOTE: fsync
if err != nil {
panic(fmt.Sprintf(
"failed to write %v msg to consensus WAL due to %v; check your file system and restart the node",
mi, err,
))
if err := cs.wal.Write(mi); err != nil {
cs.Logger.Error("failed writing to WAL", "err", err)
}

if _, ok := mi.Msg.(*VoteMessage); ok {
Expand Down

0 comments on commit 50cffac

Please sign in to comment.