mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: add a test to verify not to send duplicated append responses
This commit is contained in:
@@ -1768,3 +1768,24 @@ func (s *snapTransporter) SendSnapshot(m snap.Message) {
|
||||
m.CloseWithError(nil)
|
||||
s.snapDoneC <- m
|
||||
}
|
||||
|
||||
type sendMsgAppRespTransporter struct {
|
||||
nopTransporter
|
||||
sendC chan int
|
||||
}
|
||||
|
||||
func newSendMsgAppRespTransporter() (rafthttp.Transporter, <-chan int) {
|
||||
ch := make(chan int, 1)
|
||||
tr := &sendMsgAppRespTransporter{sendC: ch}
|
||||
return tr, ch
|
||||
}
|
||||
|
||||
func (s *sendMsgAppRespTransporter) Send(m []raftpb.Message) {
|
||||
var send int
|
||||
for _, msg := range m {
|
||||
if msg.To != 0 {
|
||||
send++
|
||||
}
|
||||
}
|
||||
s.sendC <- send
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user