فهرست منبع

rafthttp: fix wrong stream name returned by pick

msgAppWriter uses streamAppV2 type, and it should return the correct name.
Yicheng Qin 10 سال پیش
والد
کامیت
33231fccdd
2فایلهای تغییر یافته به همراه2 افزوده شده و 3 حذف شده
  1. 1 2
      rafthttp/peer.go
  2. 1 1
      rafthttp/peer_test.go

+ 1 - 2
rafthttp/peer.go

@@ -45,7 +45,6 @@ const (
 	// to hold all proposals.
 	maxPendingProposals = 4096
 
-	streamApp   = "streamMsgApp"
 	streamAppV2 = "streamMsgAppV2"
 	streamMsg   = "streamMsg"
 	pipelineMsg = "pipeline"
@@ -266,7 +265,7 @@ func (p *peer) pick(m raftpb.Message) (writec chan<- raftpb.Message, picked stri
 	if isMsgSnap(m) {
 		return p.pipeline.msgc, pipelineMsg
 	} else if writec, ok = p.msgAppWriter.writec(); ok && canUseMsgAppStream(m) {
-		return writec, streamApp
+		return writec, streamAppV2
 	} else if writec, ok = p.writer.writec(); ok {
 		return writec, streamMsg
 	}

+ 1 - 1
rafthttp/peer_test.go

@@ -35,7 +35,7 @@ func TestPeerPick(t *testing.T) {
 		{
 			true, true,
 			raftpb.Message{Type: raftpb.MsgApp, Term: 1, LogTerm: 1},
-			streamApp,
+			streamAppV2,
 		},
 		{
 			true, true,