mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
rafthttp: fix wrong stream name returned by pick
msgAppWriter uses streamAppV2 type, and it should return the correct name.
This commit is contained in:
parent
f725f6a552
commit
33231fccdd
@ -45,7 +45,6 @@ const (
|
|||||||
// to hold all proposals.
|
// to hold all proposals.
|
||||||
maxPendingProposals = 4096
|
maxPendingProposals = 4096
|
||||||
|
|
||||||
streamApp = "streamMsgApp"
|
|
||||||
streamAppV2 = "streamMsgAppV2"
|
streamAppV2 = "streamMsgAppV2"
|
||||||
streamMsg = "streamMsg"
|
streamMsg = "streamMsg"
|
||||||
pipelineMsg = "pipeline"
|
pipelineMsg = "pipeline"
|
||||||
@ -266,7 +265,7 @@ func (p *peer) pick(m raftpb.Message) (writec chan<- raftpb.Message, picked stri
|
|||||||
if isMsgSnap(m) {
|
if isMsgSnap(m) {
|
||||||
return p.pipeline.msgc, pipelineMsg
|
return p.pipeline.msgc, pipelineMsg
|
||||||
} else if writec, ok = p.msgAppWriter.writec(); ok && canUseMsgAppStream(m) {
|
} else if writec, ok = p.msgAppWriter.writec(); ok && canUseMsgAppStream(m) {
|
||||||
return writec, streamApp
|
return writec, streamAppV2
|
||||||
} else if writec, ok = p.writer.writec(); ok {
|
} else if writec, ok = p.writer.writec(); ok {
|
||||||
return writec, streamMsg
|
return writec, streamMsg
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ func TestPeerPick(t *testing.T) {
|
|||||||
{
|
{
|
||||||
true, true,
|
true, true,
|
||||||
raftpb.Message{Type: raftpb.MsgApp, Term: 1, LogTerm: 1},
|
raftpb.Message{Type: raftpb.MsgApp, Term: 1, LogTerm: 1},
|
||||||
streamApp,
|
streamAppV2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
true, true,
|
true, true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user