Commit Graph

128 Commits

Author SHA1 Message Date
3ad0df3722 Raft: fix problems reported by golint. 2014-10-07 18:44:06 -04:00
45e4a8643a raft: add tests for raft.compact 2014-10-07 16:03:11 +08:00
7fe4385ef9 raft: add comment for Compact interface of Node 2014-10-07 16:03:11 +08:00
5587e0d73f raft: compact takes index and nodes parameters
Before this commit, compact always compact log at current appliedindex of raft.
This prevents us from doing non-blocking snapshot since we have to make snapshot
and compact atomically. To prepare for non-blocking snapshot, this commit make
compact supports index and nodes parameters. After completing snapshot, the applier
should call compact with the snapshot index and the nodes at snapshot index to do
a compaction at snapsohot index.
2014-10-07 16:03:11 +08:00
45ebfb4217 raft: refine initial entries logic in StartNode 2014-10-06 16:06:01 -07:00
314d425718 main/raft: write addNode ConfChange entries in log when start raft 2014-10-06 14:33:12 -07:00
e4a6c9651a raft: add removed
The usage of removed:
1. tell removed node about its removal explicitly using msgDenied
2. prevent removed node disrupt cluster progress by launching leader election

It is set when apply node removal, or receive msgDenied.
2014-10-01 14:57:38 -07:00
03152004d7 Merge pull request #1145 from coreos/fix_panic
raft: node ignores unexpected local messages receiving from network
2014-09-23 14:11:56 -07:00
25c2768b8f raft: node ignores unexpected local messages receiving from network 2014-09-23 13:50:43 -07:00
bc7b0108dc raft: ConfigChange -> ConfChange 2014-09-23 12:02:44 -07:00
d92931853e raft: Config -> ConfigChange
Configure -> ProposeConfigChange
AddNode, RemoveNode -> ApplyConfigChange
2014-09-22 23:39:53 -07:00
ec8f493fde raft: refine comments for Configure 2014-09-22 15:44:47 -07:00
dc36ae7058 raft: use pb.Config instead of []byte for Configure 2014-09-22 15:44:47 -07:00
b82d70871f raft: use EntryType in protobuf 2014-09-22 15:44:46 -07:00
ff6705b94b raft: add Configure, AddNode, RemoveNode
Configure is used to propose config change. AddNode and RemoveNode is
used to apply cluster change to raft state machine. They are the
basics for dynamic configuration.
2014-09-22 15:43:13 -07:00
b66a40495d raft: introduce Node interface 2014-09-17 14:18:56 -07:00
ab61a8aa9a *: init for on disk snap support 2014-09-17 13:56:12 -07:00
de21c39ca5 raft: isStateEqual -> isHardStateEqual, IsEmptyState -> IsEmptyHardState 2014-09-16 13:55:00 -07:00
023dc7cba2 etcdserver: add SYNC request 2014-09-16 13:42:03 -07:00
cc8d8f2102 raft: remove unused raftpb.LastIndex 2014-09-15 14:34:23 -07:00
9607665323 raft: remove unused return 2014-09-15 13:22:21 -07:00
9bf2c2ed9d Merge pull request #1052 from unihorn/121
server: add unit tests
2014-09-15 13:20:50 -07:00
6cd4434ff3 server: add unit tests
Make test coverage >= 90%
2014-09-15 13:16:48 -07:00
ff7f340bba Merge pull request #1063 from coreos/node_run_test
raft: test node block proposal
2014-09-14 22:46:50 -07:00
e085cc4e06 Merge pull request #1042 from unihorn/118
raft: set none to be 0
2014-09-14 22:32:37 -07:00
34db45a948 raft: set propc, readyc to be nil before run loop 2014-09-12 12:57:50 -07:00
0c09862494 raft: add isStateEqual test 2014-09-12 11:59:32 -07:00
98f9ee3613 raft: add useful comments
These comments were things I learned about the units, use case or
meaning of various fields and functions in the raft package.
2014-09-12 09:58:04 -07:00
676b5be972 raft: use IsEmptyState 2014-09-09 11:58:15 -07:00
ac0443bc89 raft: remove extra code 2014-09-09 10:16:39 -07:00
df259e5878 raft: add a newReady helper function 2014-09-09 10:16:39 -07:00
90c0db3d42 wal: do not save empty state 2014-09-09 10:15:29 -07:00
c28fef5fc4 raft: set ready.st to empty state, if current state is equal to previous state 2014-09-09 10:15:29 -07:00
b0d865e845 raft: record previous state is enough 2014-09-09 10:15:29 -07:00
0060c0749a raft: prev should be set only when we sucessfully send out rd to the channel 2014-09-09 10:15:29 -07:00
946e35c958 raft: remove unused alwaysreadyc 2014-09-08 22:21:03 -07:00
9215ebb6aa Merge pull request #992 from coreos/wal
wal
2014-09-08 16:24:28 -07:00
145882244f raft: add doc for the Ready struct 2014-09-08 15:59:15 -07:00
1a6e908971 *: add wal 2014-09-05 09:52:40 -07:00
d7a289ee41 raft: init prev: vote for none 2014-09-04 11:09:55 -07:00
d844377ca6 *: vendor context 2014-09-03 20:06:16 -07:00
f2d200a826 raft: log only new/no leader 2014-09-03 09:20:20 -07:00
db8e4a2fc0 raft: remove debug logging 2014-09-03 09:20:20 -07:00
d218034630 boom 2014-09-03 09:20:20 -07:00
b796d227f1 add some logging 2014-09-03 09:20:19 -07:00
6d720fb33f raft: replace Context with Stop 2014-09-03 09:20:18 -07:00
f8be54b416 ...deadlocked... 2014-09-03 09:20:17 -07:00
7469871d20 raft: remove proposal id / add test 2014-09-03 09:20:17 -07:00
e8e588c67b raft: move protobufs into raftpb 2014-09-03 09:20:17 -07:00
1eb2512961 raft: only allow one message to Step 2014-09-03 09:20:16 -07:00