diff --git a/src/raft/raft_server.cpp b/src/raft/raft_server.cpp index b776eccba..faa652033 100644 --- a/src/raft/raft_server.cpp +++ b/src/raft/raft_server.cpp @@ -246,6 +246,13 @@ void RaftServer::AppendToLog(const tx::TransactionId &tx_id, ++last_applied_; disk_storage_.Put(LogEntryKey(log_size), SerializeLogEntry(new_entry)); disk_storage_.Put(kLogSizeKey, std::to_string(log_size + 1)); + + // Force issuing heartbeats + TimePoint now = Clock::now(); + for (auto &peer_heartbeat : next_heartbeat_) + peer_heartbeat = now; + + state_changed_.notify_all(); } void RaftServer::Emplace(const database::StateDelta &delta) { diff --git a/tests/feature_benchmark/ha/raft.json b/tests/feature_benchmark/ha/raft.json index d45507bb1..464ee435b 100644 --- a/tests/feature_benchmark/ha/raft.json +++ b/tests/feature_benchmark/ha/raft.json @@ -1,6 +1,6 @@ { "election_timeout_min": 100, "election_timeout_max": 300, - "heartbeat_interval": 1, + "heartbeat_interval": 50, "replicate_timeout": 100 } diff --git a/tests/feature_benchmark/ha/runner.sh b/tests/feature_benchmark/ha/runner.sh index c48da6e26..b25d5c988 100755 --- a/tests/feature_benchmark/ha/runner.sh +++ b/tests/feature_benchmark/ha/runner.sh @@ -20,7 +20,7 @@ fi RESULTS="$DIR/.apollo_measurements" # Benchmark parameters -NODES=15000 +NODES=150000 ## Startup declare -a HA_PIDS