Commit Graph

70 Commits (1ff290c4a6f5fc03cbe5d596ef37dc1589cf4de9)

Author SHA1 Message Date
Xiang Li e4f2c13906 change join command to interface, so application can overwrite it 2013-07-26 12:13:52 -07:00
Xiang Li a7e01bb47a improve init process 2013-07-25 15:40:20 -07:00
Xiang Li 057351ea5c with assertion problem at server.go L567 2013-07-25 14:26:27 -07:00
Xiang Li 2a55836dbe Merge branch 'addSyncAttr' 2013-07-24 17:15:20 -07:00
Xiang Li d286dfdc6c write log entry to file on disk when appendEntry and truncate log file on disk when truncate log entries 2013-07-20 19:07:16 -07:00
Xiang Li 41209beb5a change binary encoding to protobuf 2013-07-18 09:26: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 5482d260ce follower will not promote until get synced 2013-07-11 18:03:24 -07:00
Xiang Li b9e1da8ac2 let knowen peer to rejoin to the cluster 2013-07-10 20:02:24 -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 5e713120bf HTTP Transporter fixes. 2013-07-08 21:00:14 -06: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
Ben Johnson 107888aaff Pass race detector. 2013-07-07 16:12:24 -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 5f64d15776 change > to >=. > will cause panic when resp.CommitIndex equals prevLogIndex 2013-07-05 16:45:55 -07: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 c87fa96a14 make stepdown blocking 2013-07-02 18:22:37 -07:00
Xiang Li 24fe106efe clean up server_test.go 2013-07-01 09:14:21 -07:00
Xiang Li a6a3f76ea1 clean up promote 2013-07-01 08:46:53 -07:00
Xiang Li 4c13a40fe3 return command index in do(); add checking in peer.go; gofmt 2013-06-28 16:58:31 -07:00
Xiang Li aa76606fa8 fix three promote test 2013-06-27 14:46:11 -07:00
Ben Johnson 938b649b08 Minor Timer refactor. 2013-06-26 20:35:32 -06:00
Xiang Li e1fd7e46dd close debug and clean println 2013-06-26 17:21:00 -07:00
Xiang Li 0fab22808e clean up timer and change heartbeat and election to the new timer 2013-06-26 16:48:47 -07:00
Ben Johnson b80b7c5a62 Add debug mode. 2013-06-25 14:11:48 -06:00
Xiang Li 00fb080e7c add comments and gofmt 2013-06-24 09:52:51 -07:00
Xiang Li d8884cbbea change the do struct and add commit center 2013-06-23 11:42:31 -07:00
Xiang Li 3b73c41286 election new leader and rejoin works 2013-06-11 15:30:13 -07:00
Xiang Li 531e12146a add timer.fire function, which can fire at the timer channel 2013-06-09 21:47:59 -07:00
Xiang Li 094e77f624 use heartbeat to flush the new command in do() function and keep the response result in the log entry 2013-06-08 22:39:50 -07:00
Ben Johnson 769a5ed6a1 go fmt 2013-06-07 22:19:18 -04:00
Xiang Li f15cadeffd add snapshot unit test 2013-06-05 20:25:17 -07:00
Xiang Li 32729ef871 solve conflicts 2013-06-04 17:22:09 -07:00
Xiang Li 3a6fc7bee4 add log-compaction 2013-06-04 17:02:45 -07:00
Ben Johnson 8efbb1535e Fix peer timer race condition. 2013-06-04 09:35:43 -04:00
Ben Johnson c544519c7c Fix timer race condition. 2013-06-03 19:16:50 -04:00
Ben Johnson 147d3c5dd8 Switch to use Transporter interface. 2013-05-28 15:57:38 -04:00
Ben Johnson 9e8834448a Remove join command. Fix race condition. 2013-05-28 14:46:27 -04:00
Ben Johnson 97fbdde521 Interface clean up. 2013-05-26 20:17:20 -06:00
Ben Johnson 345a74b63d Deny command execution for non-leaders. 2013-05-26 20:04:41 -06:00
Ben Johnson 7503eee58b Fix timer cleanup. 2013-05-26 18:02:31 -06:00
Ben Johnson f5761513bc Add log entry marshaling. 2013-05-09 21:50:57 -06:00
Ben Johnson 7521258d0c Fixed minor bugs. 2013-05-07 21:56:32 -06:00
Ben Johnson f3441b8bfb Add multi-node failure with re-election test. 2013-05-05 15:41:55 -06:00
Ben Johnson d00057d4cb Refactor timer. 2013-05-05 14:01:06 -06:00
Ben Johnson 776a2ccff9 Fix race conditions. 2013-05-05 13:48:15 -06:00