495 Commits

Author SHA1 Message Date
Jonathan Boulle
a45d490598 Merge pull request #1146 from jonboulle/1146_protobuf
script protobuf generation
2014-09-24 14:34:49 -07:00
Jonathan Boulle
c8c55aa378 scripts: consolidate and standardize protobuf generation 2014-09-24 13:45:00 -07:00
Yicheng Qin
1ca03d8e9d raft: move logic to separate func 2014-09-24 10:23:44 -07:00
Yicheng Qin
b07be74a82 raft: stop tickElection when the node is not in peer list
This prevents the bug like this:
1. a node sends join to a cluster and succeeds
2. it starts with empty peers and waits for sync, but it have not
received anything
3. election timeout passes, and it promotes itself to leader
4. it commits some log entry
5. its log conflicts with the cluster's
2014-09-23 23:15:02 -07:00
Xiang Li
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
Xiang Li
25c2768b8f raft: node ignores unexpected local messages receiving from network 2014-09-23 13:50:43 -07:00
Yicheng Qin
bc7b0108dc raft: ConfigChange -> ConfChange 2014-09-23 12:02:44 -07:00
Yicheng Qin
d92931853e raft: Config -> ConfigChange
Configure -> ProposeConfigChange
AddNode, RemoveNode -> ApplyConfigChange
2014-09-22 23:39:53 -07:00
Yicheng Qin
ec8f493fde raft: refine comments for Configure 2014-09-22 15:44:47 -07:00
Yicheng Qin
dc36ae7058 raft: use pb.Config instead of []byte for Configure 2014-09-22 15:44:47 -07:00
Yicheng Qin
b82d70871f raft: use EntryType in protobuf 2014-09-22 15:44:46 -07:00
Yicheng Qin
b801f1affe raft: refine comment for raft.pendingConf 2014-09-22 15:44:46 -07:00
Yicheng Qin
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
Yicheng Qin
f2ebd64a1b *: add testutil pkg 2014-09-19 14:32:38 -07:00
Jonathan Boulle
b66a40495d raft: introduce Node interface 2014-09-17 14:18:56 -07:00
Xiang Li
ab61a8aa9a *: init for on disk snap support 2014-09-17 13:56:12 -07:00
Yicheng Qin
de21c39ca5 raft: isStateEqual -> isHardStateEqual, IsEmptyState -> IsEmptyHardState 2014-09-16 13:55:00 -07:00
Yicheng Qin
023dc7cba2 etcdserver: add SYNC request 2014-09-16 13:42:03 -07:00
Yicheng Qin
cc8d8f2102 raft: remove unused raftpb.LastIndex 2014-09-15 14:34:23 -07:00
Yicheng Qin
9607665323 raft: remove unused return 2014-09-15 13:22:21 -07:00
Yicheng Qin
9bf2c2ed9d Merge pull request #1052 from unihorn/121
server: add unit tests
2014-09-15 13:20:50 -07:00
Yicheng Qin
6cd4434ff3 server: add unit tests
Make test coverage >= 90%
2014-09-15 13:16:48 -07:00
Xiang Li
f9c12e2053 Merge pull request #1075 from coreos/fix_heartbeat
raft: fix heartbeat
2014-09-15 10:04:12 -07:00
Yicheng Qin
38c074cb05 Merge pull request #1067 from unihorn/122
raft: write entry 0 into log
2014-09-15 10:00:49 -07:00
Xiang Li
21d116d3e1 raft: fix heartbeat 2014-09-15 09:58:22 -07:00
Yicheng Qin
140fd6d6c4 raft: restart using last written entry also 2014-09-15 09:56:33 -07:00
Yicheng Qin
a9af70c52b raft: write entry 0 into log 2014-09-15 09:55:52 -07:00
Xiang Li
29f9372370 Merge pull request #1080 from coreos/check_id
main: check node id is not noneid
2014-09-14 23:28:39 -07:00
Xiang Li
e7ea6a374a main: check node id is not noneid 2014-09-14 23:28:11 -07:00
Xiang Li
ff7f340bba Merge pull request #1063 from coreos/node_run_test
raft: test node block proposal
2014-09-14 22:46:50 -07:00
Xiang Li
e085cc4e06 Merge pull request #1042 from unihorn/118
raft: set none to be 0
2014-09-14 22:32:37 -07:00
Yicheng Qin
2927cc6e3b raft: refine plus assignment 2014-09-14 22:07:32 -07:00
Yicheng Qin
da575c46fa raft: remove unused field 2014-09-14 13:08:35 -07:00
Yicheng Qin
34db45a948 raft: set propc, readyc to be nil before run loop 2014-09-12 12:57:50 -07:00
Xiang Li
ccee264b7d raft: move defer after run 2014-09-12 12:28:15 -07:00
Xiang Li
45f56a5377 raft: forceGoSched -> forceGosched 2014-09-12 12:27:18 -07:00
Brandon Philips
df253a2b14 Merge pull request #1066 from philips/add-raft-doc
add-raft-doc
2014-09-12 12:21:53 -07:00
Xiang Li
5c884c7797 raft: better comment and naming 2014-09-12 12:18:30 -07:00
Xiang Li
0c09862494 raft: add isStateEqual test 2014-09-12 11:59:32 -07:00
Xiang Li
f9ef453894 raft: test contain updates 2014-09-12 11:51:25 -07:00
Xiang Li
b261a5edc1 raft: test node block proposal 2014-09-12 11:51:25 -07:00
Yicheng Qin
30289dad5c raft: more descriptive panic info 2014-09-12 11:39:53 -07:00
Yicheng Qin
072a21782e Merge pull request #1049 from unihorn/120
raftLog: enhance check in compact
2014-09-12 11:35:41 -07:00
Yicheng Qin
d31443f5a3 raftLog: compact applied entries only
compact MUST happen on entries that have been applied, or
1. it may screw up the log by setting wrong commitIndex
2. discard unapplied entries
2014-09-12 11:34:08 -07:00
Brandon Philips
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
Brandon Philips
58b8610024 raft: add a doc.go file
Explain the package from a high level.
2014-09-12 09:57:48 -07:00
Yicheng Qin
073411f23f raft: remove vote with default value 2014-09-11 23:17:13 -07:00
Yicheng Qin
dc1357afa9 raft: use raft helper function in testing 2014-09-11 19:26:29 -07:00
Yicheng Qin
0e0fc2bd24 raft: use [1,n] as address list for raft state machines 2014-09-11 19:23:05 -07:00
Yicheng Qin
84c2bd0b7d raft: set From of local message to be local id 2014-09-11 19:18:47 -07:00