Skip to content

Commit

Permalink
Add crash points, raft election.
Browse files Browse the repository at this point in the history
  • Loading branch information
Willfrit committed Jun 8, 2019
1 parent bd442be commit cef3641
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app_test/raft_election_crash_anim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ end

-- Vote Request RPC function, called by candidate to get votes
function request_vote(term, candidate_id)
-- CRASH POINT 1 2 3 4 5 : RECOVERY 0.5 : RANDOM 0.05
-- CRASH POINT 1 2 3 4 5 : RECOVERY 0.5 : RANDOM 0.02
aReceiveData(candidate_id, " RCP request_vote")

-- It the candidate is late - don't grant the vote
Expand All @@ -197,6 +197,10 @@ function request_vote(term, candidate_id)
set_election_timeout() -- reset the election timeout
end
aSendData(candidate_id, "SEND RESULT request_vote")

events.thread(function()
-- CRASH POINT 1 2 3 4 5 : RECOVERY 0.5 : RANDOM 0.05
end)
return persistent_state.current_term, vote_granted
end

Expand Down

0 comments on commit cef3641

Please sign in to comment.