mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #13238 from sakateka/etcdserver-logs
etcdserver: remove code duplication from the peer.send func
This commit is contained in:
commit
752a206da4
@ -250,10 +250,9 @@ func (p *peer) send(m raftpb.Message) {
|
||||
if isMsgSnap(m) {
|
||||
p.r.ReportSnapshot(m.To, raft.SnapshotFailure)
|
||||
}
|
||||
if p.status.isActive() {
|
||||
if p.lg != nil {
|
||||
p.lg.Warn(
|
||||
"dropped internal Raft message since sending buffer is full (overloaded network)",
|
||||
"dropped internal Raft message since sending buffer is full",
|
||||
zap.String("message-type", m.Type.String()),
|
||||
zap.String("local-member-id", p.localID.String()),
|
||||
zap.String("from", types.ID(m.From).String()),
|
||||
@ -262,19 +261,6 @@ func (p *peer) send(m raftpb.Message) {
|
||||
zap.Bool("remote-peer-active", p.status.isActive()),
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if p.lg != nil {
|
||||
p.lg.Warn(
|
||||
"dropped internal Raft message since sending buffer is full (overloaded network)",
|
||||
zap.String("message-type", m.Type.String()),
|
||||
zap.String("local-member-id", p.localID.String()),
|
||||
zap.String("from", types.ID(m.From).String()),
|
||||
zap.String("remote-peer-id", p.id.String()),
|
||||
zap.String("remote-peer-name", name),
|
||||
zap.Bool("remote-peer-active", p.status.isActive()),
|
||||
)
|
||||
}
|
||||
}
|
||||
sentFailures.WithLabelValues(types.ID(m.To).String()).Inc()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user