Raft sendHeartbeat
Author: zhangshxiangCreated Jun 29, 2026Updated Jun 29, 2026
Labelstype/bugseverity/noneaffects/none
RaftPart::sendHeartbeat() { // If leader has not commit any logs in this term, it must commit all logs in // previous term, so heartbeat is send by appending one empty log. if (!replicatingLogs_.load(std::memory_order_acquire)) { folly::via(executor_.get(), [this] { std::string log = ""; appendLogAsync(clusterId_, LogType::NORMAL, std::move(log)); }); }
我认为这里应该加上 commitInThisTerm_ 的判断,leader 当选后只追加一次的 no-op,后面就算写入qps 少或者长时间不写入 也不应该一直写入空log,没有问题但是没必要
Source: vesoft-inc/nebula