Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 703fb0a commit 6405167Copy full SHA for 6405167
src/kvstore/raftex/RaftPart.cpp
@@ -1876,6 +1876,10 @@ void RaftPart::checkAndResetPeers(const std::vector<HostAddr>& peers) {
1876
}
1877
1878
bool RaftPart::leaseValid() {
1879
+ std::lock_guard<std::mutex> g(raftLock_);
1880
+ if (hosts_.empty()) {
1881
+ return true;
1882
+ }
1883
// When majority has accepted a log, leader obtains a lease which last for heartbeat.
1884
// However, we need to take off the net io time. On the left side of the inequality is
1885
// the time duration since last time leader send a log (the log has been accepted as well)
0 commit comments