593 Commits

Author SHA1 Message Date
Yicheng Qin
dcdc7913c0 Merge pull request #1100 from unihorn/129
raft: add Configure
2014-09-23 13:50:10 -07:00
Yicheng Qin
c6cb635e01 etcdserver: refine comments of config change tests 2014-09-23 13:03:30 -07:00
Yicheng Qin
bc7b0108dc raft: ConfigChange -> ConfChange 2014-09-23 12:02:44 -07:00
Brian Waldon
99e9f561ee etcdserver: add Peers.Addrs 2014-09-23 10:56:41 -07:00
Brian Waldon
10220335f7 etcdserver: determine scheme based on TLSClientConfig 2014-09-23 10:14:12 -07:00
Brian Waldon
e19b0442f8 etcdserver: pass scheme into send 2014-09-23 10:14:11 -07:00
Brian Waldon
fb7968d704 etcdserver: Peers.Pick returns just an addr 2014-09-23 10:09:34 -07:00
Brian Waldon
5470a6d3d6 etcdserver: pass http client into Sender 2014-09-23 10:02:23 -07:00
Yicheng Qin
d92931853e raft: Config -> ConfigChange
Configure -> ProposeConfigChange
AddNode, RemoveNode -> ApplyConfigChange
2014-09-22 23:39:53 -07:00
Jonathan Boulle
5441c6aa54 etcdserver: correct X-Etcd-Index header
This adds an EtcdIndex field to store.Event and uses that as the header
instead of the node's modifiedIndex. To facilitate this in a non-racy
way, we set the EtcdIndex while holding the lock.
2014-09-22 18:56:12 -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
4203569da2 etcdserver: use ConfigType in protobuf 2014-09-22 15:44:46 -07:00
Yicheng Qin
b82d70871f raft: use EntryType in protobuf 2014-09-22 15:44:46 -07:00
Yicheng Qin
abdb2cad15 etcdserver: Config.Id -> Config.ID 2014-09-22 15:44:46 -07:00
Yicheng Qin
aaffb9eb78 etcdserver: add AddNode, RemoveNode
AddNode and RemoveNode is used to propose config change to the cluster.
If succeeds, it will add/remove node from the cluster.
2014-09-22 15:44:46 -07:00
Brian Waldon
7d1126fb35 etcdserver: init time.Time only if Expiration > 0
golang's concept of "zero" time does not align with the zero value of
a unix timestamp. Initializing time.Time with a unix timestamp of 0
makes time.Time.IsZero fail. Solve this by initializing time.Time only
if we care about the time.
2014-09-22 15:31:31 -07:00
Jonathan Boulle
e08df4c8d2 store: fix recursive/dir arguments 2014-09-22 14:44:01 -07:00
Yicheng Qin
8ba801ec06 etcdserver: fix sync tests
This is to fix possible testing failures caused by sync tests.

Changes:
1. Get rid of time sleep operations, which introduces uncertainty.
2. Use fake Store.
2014-09-20 17:41:30 -07:00
Yicheng Qin
ddfcb67ce3 Merge pull request #1118 from unihorn/133
etcdserver: add TestRecvSnapshot
2014-09-20 17:10:01 -07:00
Yicheng Qin
fac38aad33 etcdserver: add TestRecvSlowSnapshot 2014-09-19 15:09:04 -07:00
Yicheng Qin
b8e59a3c6a etcdserver: not push ready to readyNode automatically 2014-09-19 14:40:11 -07:00
Yicheng Qin
f2ebd64a1b *: add testutil pkg 2014-09-19 14:32:38 -07:00
Yicheng Qin
4eb156a324 Merge pull request #1104 from unihorn/132
etcdserver: add TestDoBadLocalAction
2014-09-19 09:30:34 -07:00
Yicheng Qin
d5988c3ec2 etcdserver: add TestDoBadLocalAction 2014-09-19 09:22:26 -07:00
Yicheng Qin
44ab66d858 etcdserver: add TestRecvSnapshot 2014-09-18 23:19:00 -07:00
Brian Waldon
91003cb994 *: s/prevExists/prevExist/ 2014-09-18 21:25:08 -07:00
Jonathan Boulle
a42d52482c etcdserver: use simple PRNG for GenID 2014-09-17 15:29:14 -07:00
Xiang Li
f2e92d9140 Merge pull request #1097 from unihorn/130
etcdserver: use Action to fix possible data race
2014-09-17 14:28:37 -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
0ad0e24a86 etcdserver: use Action to fix possible data race 2014-09-17 13:48:03 -07:00
Yicheng Qin
f786de13d0 Merge pull request #1081 from unihorn/125
make TTL work
2014-09-16 15:14:44 -07:00
Yicheng Qin
a91d745c46 etcdserver: refine printout 2014-09-16 14:54:22 -07:00
Yicheng Qin
023dc7cba2 etcdserver: add SYNC request 2014-09-16 13:42:03 -07:00
Jonathan Boulle
67e57ffca4 etcdserver: split out client and server listeners 2014-09-16 11:36:37 -07:00
Jonathan Boulle
30b70e18c5 etcdserver/etcdhttp: add simple test for peers send 2014-09-15 21:10:00 -07:00
Jonathan Boulle
a7ec09c877 etcdserver/etcdhttp: use empty node for test 2014-09-15 20:34:14 -07:00
Jonathan Boulle
f846c5286a etcdserver/etcdhttp: fix comment, simplify resServer 2014-09-15 19:01:40 -07:00
Jonathan Boulle
27cf7747ea etcdserver/etcdhttp: add tests for serveKeys 2014-09-15 18:33:10 -07:00
Jonathan Boulle
7ac3b32de6 etcdserver: change raft endpoint to send StatusNoContent 2014-09-15 16:10:31 -07:00
Jonathan Boulle
3e2c160eed etcdserver/etcdhttp: add test coverage for serveRaft 2014-09-15 16:07:06 -07:00
Jonathan Boulle
e04c028d64 etcdserver/etcdhttp: switch to using http.ServeMux 2014-09-15 16:05:20 -07:00
Jonathan Boulle
8a5ab2ec06 etcdserver: introduce Server interface
This changes etcdserver.Server to an interface, with the former Server
(now "EtcdServer") becoming the canonical/production implementation.
This will facilitate better testing of the http server et al with mock
implementations of the interface.
It also more clearly defines the boundary for users of the Server.
2014-09-15 15:11:01 -07:00
Jonathan Boulle
d9cfc35bed etcdhttp: check method for every endpoint, add tests 2014-09-15 14:56:43 -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
e085cc4e06 Merge pull request #1042 from unihorn/118
raft: set none to be 0
2014-09-14 22:32:37 -07:00
Yicheng Qin
54b9c55af3 etcdserver: remove useless sleep
etcdserver.Do will block until there exists leader
2014-09-12 13:01:33 -07:00
Yicheng Qin
0e0fc2bd24 raft: use [1,n] as address list for raft state machines 2014-09-11 19:23:05 -07:00