mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #15398 from xakdwch/feature-enhance
rafthttp: replace inline code with existing function
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user