rafthttp: fix wrong stream name returned by pick

msgAppWriter uses streamAppV2 type, and it should return the correct name.
This commit is contained in:
Yicheng Qin 2015-10-20 08:17:06 -07:00
parent f725f6a552
commit 33231fccdd
2 changed files with 2 additions and 3 deletions

View File

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

View File

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