Explorar o código

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 %!s(int64=11) %!d(string=hai) anos
pai
achega
d5ceb26408
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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 {
-	return m.Type == raftpb.MsgAppResp
+	return m.Type == raftpb.MsgAppResp && m.Reject == false
 }