Skip to content

Commit

Permalink
Topologies, raft anim.
Browse files Browse the repository at this point in the history
  • Loading branch information
Willfrit committed May 29, 2019
1 parent f410fb5 commit a310cca
Show file tree
Hide file tree
Showing 10 changed files with 312 additions and 495 deletions.
3 changes: 2 additions & 1 deletion app_test/raft.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
--[[
Complete Raft implementation
Complete Raft implementation - Election + log replication (not finished)
Helped with https://web.stanford.edu/~ouster/cgi-bin/papers/raft-atc14
Work in progress
--]]
require("splay.base")
local json = require("json")
Expand Down
235 changes: 0 additions & 235 deletions app_test/raft_anim.lua

This file was deleted.

10 changes: 5 additions & 5 deletions app_test/raft_election.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ persistent_state = {
log = {} -- Array of {term = associated_term, data = <change_state>}
}

-- Minimal timeout for each purpose in second
election_timeout = 1.5
rpc_timeout = 0.4
heartbeat_timeout = 0.8
-- Timeout for each purpose in second
election_timeout = 1.5 -- random: [election_timeout, 2 * election_timeout]
rpc_timeout = 0.5
heartbeat_timeout = 0.6

-- Timeout variable (to check if timeout has been canceled)
election_time = nil
Expand Down Expand Up @@ -222,7 +222,7 @@ events.run(function()
-- Election manage
set_election_timeout()

-- After 10 second the node will exit no matter what
-- After 100 second the node will exit no matter what
events.sleep(100)
events.exit()
end)
Loading

0 comments on commit a310cca

Please sign in to comment.