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,30 +250,16 @@ func (p *peer) send(m raftpb.Message) {
|
|||||||
if isMsgSnap(m) {
|
if isMsgSnap(m) {
|
||||||
p.r.ReportSnapshot(m.To, raft.SnapshotFailure)
|
p.r.ReportSnapshot(m.To, raft.SnapshotFailure)
|
||||||
}
|
}
|
||||||
if p.status.isActive() {
|
if p.lg != nil {
|
||||||
if p.lg != nil {
|
p.lg.Warn(
|
||||||
p.lg.Warn(
|
"dropped internal Raft message since sending buffer is full",
|
||||||
"dropped internal Raft message since sending buffer is full (overloaded network)",
|
zap.String("message-type", m.Type.String()),
|
||||||
zap.String("message-type", m.Type.String()),
|
zap.String("local-member-id", p.localID.String()),
|
||||||
zap.String("local-member-id", p.localID.String()),
|
zap.String("from", types.ID(m.From).String()),
|
||||||
zap.String("from", types.ID(m.From).String()),
|
zap.String("remote-peer-id", p.id.String()),
|
||||||
zap.String("remote-peer-id", p.id.String()),
|
zap.String("remote-peer-name", name),
|
||||||
zap.String("remote-peer-name", name),
|
zap.Bool("remote-peer-active", p.status.isActive()),
|
||||||
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()
|
sentFailures.WithLabelValues(types.ID(m.To).String()).Inc()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user