Force issuing heartbeats when appending to Raft log

Summary:
Locally run HA feature benchmark:

```
duration: 20.66
executed_writes: 150007
write_per_second: 7527.89
```

Reviewers: msantl

Reviewed By: msantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1809
This commit is contained in:
Ivan Paljak 2019-01-16 10:45:40 +01:00
parent ac5c6bf0e8
commit 16752af614
3 changed files with 9 additions and 2 deletions

View File

@ -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) {

View File

@ -1,6 +1,6 @@
{
"election_timeout_min": 100,
"election_timeout_max": 300,
"heartbeat_interval": 1,
"heartbeat_interval": 50,
"replicate_timeout": 100
}

View File

@ -20,7 +20,7 @@ fi
RESULTS="$DIR/.apollo_measurements"
# Benchmark parameters
NODES=15000
NODES=150000
## Startup
declare -a HA_PIDS