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.99k stars 886 forks source link

prevote/vote中获取last_log_id()时,为什么需要去触发一下log flush呢,有什么考虑吗?是不是没有必要去做flush呢? #435

Open Tgianter opened 10 months ago

Tgianter commented 10 months ago

node.cpp:1634

const LogId last_log_id = _log_manager->last_log_id(true);

_log_manager->last_log_id(true)传true的话会触发log flush