Merge pull request #15398 from xakdwch/feature-enhance

rafthttp: replace inline code with existing function
This commit is contained in:
Piotr Tabor
2023-03-03 10:47:09 +01:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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)