Browse Source

rafthttp: only batch good MsgAppResp

A MsgAppResp with Reject set should be sent back to the leader as soon
as possible instead of batching.
Yicheng Qin 11 years ago
parent
commit
d5ceb26408
1 changed files with 1 additions and 1 deletions
  1. 1 1
      rafthttp/batcher.go

+ 1 - 1
rafthttp/batcher.go

@@ -37,5 +37,5 @@ func (b *Batcher) Reset(t time.Time) {
 }
 }
 
 
 func canBatch(m raftpb.Message) bool {
 func canBatch(m raftpb.Message) bool {
-	return m.Type == raftpb.MsgAppResp
+	return m.Type == raftpb.MsgAppResp && m.Reject == false
 }
 }