Skip to content

Commit

Permalink
perf: do not flush wal when receive consensus msgs (Finschia#273)
Browse files Browse the repository at this point in the history
* perf: do not flush wal when receive consensus msgs
  • Loading branch information
wetcod authored and egonspace committed Jul 8, 2021
1 parent f2c6031 commit 776ea2e
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 776ea2e

Please sign in to comment.