Skip to content

Commit

Permalink
server.go: refine log when not in online state (#688)
Browse files Browse the repository at this point in the history
as expected to write fails, make it not a tedious error log
  • Loading branch information
july2993 committed Jul 25, 2019
1 parent 47163d0 commit 1a2bba3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pump/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ func (s *Server) writeBinlog(ctx context.Context, in *binlog.WriteBinlogReq, isF

errHandle:
lossBinlogCacheCounter.Add(1)
log.Error("write binlog failed", zap.Error(err))
if strings.HasPrefix(err.Error(), "no online") {
log.Warn("reject write binlog for not online state", zap.String("state", s.node.NodeStatus().State))
} else {
log.Error("write binlog failed", zap.Error(err))
}
ret.Errmsg = err.Error()
return ret, err
}
Expand Down

0 comments on commit 1a2bba3

Please sign in to comment.