diff --git a/server/etcdserver/api/rafthttp/pipeline.go b/server/etcdserver/api/rafthttp/pipeline.go index b8ff3dfca..958d8def2 100644 --- a/server/etcdserver/api/rafthttp/pipeline.go +++ b/server/etcdserver/api/rafthttp/pipeline.go @@ -103,7 +103,7 @@ func (p *pipeline) handle() { if err != nil { p.status.deactivate(failureType{source: pipelineMsg, action: "write"}, err.Error()) - if m.Type == raftpb.MsgApp && p.followerStats != nil { + if isMsgApp(m) && p.followerStats != nil { p.followerStats.Fail() } p.raft.ReportUnreachable(m.To) @@ -115,7 +115,7 @@ func (p *pipeline) handle() { } p.status.activate() - if m.Type == raftpb.MsgApp && p.followerStats != nil { + if isMsgApp(m) && p.followerStats != nil { p.followerStats.Succ(end.Sub(start)) } if isMsgSnap(m) { diff --git a/server/etcdserver/api/rafthttp/transport.go b/server/etcdserver/api/rafthttp/transport.go index f4af5f3c2..339c5734b 100644 --- a/server/etcdserver/api/rafthttp/transport.go +++ b/server/etcdserver/api/rafthttp/transport.go @@ -186,7 +186,7 @@ func (t *Transport) Send(msgs []raftpb.Message) { t.mu.RUnlock() if pok { - if m.Type == raftpb.MsgApp { + if isMsgApp(m) { t.ServerStats.SendAppendReq(m.Size()) } p.send(m)