baidu / braft

An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.
Apache License 2.0
3.93k stars 879 forks source link

`raft_send_entries` error #195

Closed GOGOYAO closed 4 years ago

GOGOYAO commented 4 years ago

W0320 21:44:51.506333 15335 /tmp/incubator-brpc/src/bvar/detail/percentile.cpp:121] Input=-277 to 'raft_send_entries' is negative, drop

W0320 21:44:51.506701 15335 /usr/local/include/bvar/recorder.h:254] Input=2147483647 to 'raft_send_entries_normalized' overflows

braft源码中对应的是g_send_entries_latency << cntl->latency_us();,为啥latency会成为一个负值呢?

Edward-xk commented 4 years ago

W0320 21:44:51.506333 15335 /tmp/incubator-brpc/src/bvar/detail/percentile.cpp:121] Input=-277 to 'raft_send_entries' is negative, drop

W0320 21:44:51.506701 15335 /usr/local/include/bvar/recorder.h:254] Input=2147483647 to 'raft_send_entries_normalized' overflows

braft源码中对应的是g_send_entries_latency << cntl->latency_us();,为啥latency会成为一个负值呢?

这儿应该是latency溢出了,https://github.com/apache/incubator-brpc/blob/2f8fc37d52c2a02ee6f348aaa52c7ded4a4844c3/src/bvar/recorder.h#L238 可以检查下当时磁盘或网络是否出问题了

PFZheng commented 4 years ago

看你在brpc的issue里也问了,戈神应该解释清楚了

GOGOYAO commented 4 years ago

嗯嗯。感谢