Commit Graph

135 Commits (e3322b65d54fdae1161622ab5551c69c671846ef)

Author SHA1 Message Date
Xiang Li e3322b65d5 Merge branch 'snapshotLoop' into newSnapshotLoop 2013-07-18 10:21:03 -07:00
Xiang Li bcdc237b3e Merge https://github.com/coreos/go-raft 2013-07-17 14:24:31 -07:00
Ben Johnson e3b06c530a [Fix #74] Refactor to use binary log and binary RPCs. 2013-07-17 07:45:53 -06:00
Xiang Li 5bfda2c28e remove nitro package 2013-07-16 18:00:16 -07:00
Xiang Li b743f48d71 add snapshotting state 2013-07-16 17:40:19 -07:00
Xiang Li 1bbbf7ca6a remove nitro 2013-07-16 13:23:05 -07:00
Xiang Li 5c9cec3f74 keep recent log entries after snapshot 2013-07-16 13:16:33 -07:00
Xiang Li 10f8b9f836 Merge https://github.com/benbjohnson/go-raft 2013-07-16 12:28:52 -07:00
Xiang Li 557c735f69 move MLPR frmo log to server 2013-07-14 22:48:41 -07:00
Xiang Li 9cafa8fe1d add nitro tool to go-raft lib 2013-07-11 12:56:34 -07:00
Xiang Li 2abebe3065 refactor 2013-07-10 22:19:57 -07:00
Xiang Li b9e1da8ac2 let knowen peer to rejoin to the cluster 2013-07-10 20:02:24 -07:00
Xiang Li d0da319e26 Merge https://github.com/benbjohnson/go-raft 2013-07-10 16:35:00 -07:00
Xiang Li 75e0a229e9 commit a NOP after the server becomes leader. Commit ohter commands, after the majority of the peers synced by the NOP command 2013-07-10 16:07:14 -07:00
Ben Johnson 2ee061c60f Fix state check in candidate inner loop. 2013-07-10 11:46:11 -06:00
Xiang Li 62ddd377a0 add encoding speed test and gofmt 2013-07-10 10:31:56 -07:00
Ben Johnson 5e713120bf HTTP Transporter fixes. 2013-07-08 21:00:14 -06:00
Ben Johnson 4ee205422c Merge branch 'master' of https://github.com/benbjohnson/go-raft into http-transporter
Conflicts:
	peer.go
	server.go
2013-07-08 20:56:15 -06:00
Ben Johnson 5aa494ddf9 Add HTTPTransporter. 2013-07-08 20:55:00 -06:00
Xiang Li 3392f8192f Remove the lock in init(). Since addPeer func() require that lock. When do log replay in the init(), there will be deadlock 2013-07-08 16:42:33 -07:00
Xiang Li b3e7f49a33 do not send commit signal if it came from old leader 2013-07-08 10:35:26 -07:00
Xiang Li 7178b21d27 create new channel before start heartbeat to avoid recv stop signal from old heartbeat func 2013-07-07 22:26:36 -07:00
Xiang Li 53d43dee4f fix election timeout problem 2013-07-07 21:31:58 -07:00
Xiang Li 46dd6bbd81 when change the state to leader, we should also update the s.leader to its own name 2013-07-07 17:01:55 -07:00
Xiang Li fa3ec69b6b fix break in select 2013-07-07 16:52:18 -07:00
Xiang Li d3787f60c1 when candidate stepdown it should break the loop; gofmt 2013-07-07 16:37:11 -07:00
Xiang Li 6c6c76bbd9 [Fix #52] Detect new leader with same term as candidate in processAppendEntriesRequest 2013-07-07 16:26:18 -07:00
Ben Johnson 00d109823e Retrieve peer index and term before verifying server state in heartbeat. 2013-07-07 16:19:03 -06:00
Ben Johnson 107888aaff Pass race detector. 2013-07-07 16:12:24 -06:00
Ben Johnson 743b684370 gofmt 2013-07-07 14:55:55 -06:00
Ben Johnson 08e2d519ae Refactor server event loop. 2013-07-07 14:21:04 -06:00
Ben Johnson ce3dbb5dfb Server clean up. 2013-07-06 13:41:42 -06:00
Ben Johnson 44f3ef6701 [Fix #47] Clean up external interface. 2013-07-05 22:49:47 -06:00
Xiang Li cbceb05801 add server state mutex to avoid state race condition 2013-07-05 10:44:03 -07:00
Xiang Li fe55d87640 server should not be blocking will holding the lock 2013-07-03 10:10:43 -07:00
Xiang Li 5c5b489331 rafactor server.go 2013-07-03 09:53:46 -07:00
Xiang Li 11de59fa06 after stepdown candidate should return from collectvote and restart election timeout 2013-07-02 20:51:19 -07:00
Xiang Li c87fa96a14 make stepdown blocking 2013-07-02 18:22:37 -07:00
Xiang Li 7a19090e5d change log ouput format to Lmicroseconds 2013-07-02 11:42:14 -07:00
Xiang Li c9ce5b4217 when promoted, election timeout should be stopped 2013-07-01 22:51:17 -07:00
Xiang Li dac781172e non-blocking sending votes 2013-07-01 08:50:31 -07:00
Xiang Li a6a3f76ea1 clean up promote 2013-07-01 08:46:53 -07:00
Xiang Li a3e02e81ae snapshot checksum in hex 2013-06-30 19:50:48 -07:00
Xiang Li a48505bd95 clean up 2013-06-30 19:20:23 -07:00
Xiang Li 3c15b12198 clean up println 2013-06-30 19:14:02 -07:00
Xiang Li 4f24fb775f check checksum before load snapshot 2013-06-30 17:55:54 -07:00
Xiang Li b0eaf972e6 we have pass the server pointer to the command, dont need to return index 2013-06-29 12:47:18 -07:00
Xiang Li 5c6766e13e return the index of the commited command to the application via do() and add Index func to get the current committed index of the server 2013-06-28 16:14:41 -07:00
Xiang Li 52f97d0c3a change init count val to 1 in func commitCenter() 2013-06-27 14:48:13 -07:00
Xiang Li 941720fe07 gofmt 2013-06-27 13:10:52 -07:00