Commit Graph

1813 Commits (9ab35726622c1babbe95e458f5f561b6be8a1113)

Author SHA1 Message Date
Yicheng Qin ca73f25615 etcdhttp: parseRequest -> parseKeyRequest 2014-10-21 16:10:49 -07:00
Yicheng Qin e2b6a4fc4c etcdserver: const XXXDir -> StoreXXXPrefix
and code clean
2014-10-21 16:10:49 -07:00
Yicheng Qin 2ff3cac653 etcdserver/etcdhttp: store location adjustment
Detailed adjustment:
/_etcd/machines/* -> /0/members/*
/* -> /1/*

And it keeps key path returned to user the same as before.
2014-10-21 16:10:19 -07:00
Xiang Li e69c37adf0 etcdserver: panic on clusterid mismatch 2014-10-21 15:22:16 -07:00
Xiang Li 894e678ad6 etcdserver: checking clusterID 2014-10-21 11:05:24 -07:00
Xiang Li a44849deec Merge pull request #1286 from coreos/clusterid
*: generate clusterid
2014-10-20 19:07:03 -07:00
Jonathan Boulle b3d5333cb3 *: fix various formatting issues 2014-10-20 17:55:18 -07:00
Xiang Li 0fd28169c8 etcdserver: use id,cid 2014-10-20 16:35:41 -07:00
Xiang Li dc68dc9ebd etcdserver: add a todo for clusterid generation 2014-10-20 16:26:31 -07:00
Yicheng Qin 92230cee63 Merge pull request #1333 from unihorn/172
etcdserver/raft: remove msgDenied, removedNodes, shouldStop
2014-10-20 16:04:09 -07:00
Yicheng Qin e200d2a8e2 etcdserver/raft: remove msgDenied, removedNodes, shouldStop
The future plan is to do all these in etcdserver level.
2014-10-20 15:13:18 -07:00
Xiang Li ea6bcacfe4 *: generate clusterid 2014-10-20 15:00:54 -07:00
Yicheng Qin f7a0d5387b etcdserver: stop server gracefully 2014-10-20 14:43:21 -07:00
Yicheng Qin 058537f34a main: add basic functional test 2014-10-20 14:43:21 -07:00
Yicheng Qin dcaa7f0a37 Merge pull request #1328 from unihorn/169
skip initial-cluster check when reboot
2014-10-20 13:06:24 -07:00
Yicheng Qin 17382ec905 etcdserver: skip initial-cluster check when reboot
If etcd is provided with data-dir that has data, it will not use
initial-cluster, and initial-cluster could be set to be empty.
2014-10-20 12:41:07 -07:00
Jonathan Boulle 7a4d42166b *: add license header to all source files 2014-10-17 15:41:22 -07:00
Yicheng Qin aa176610f3 main: remove duplicated self name check 2014-10-17 15:37:30 -07:00
Jonathan Boulle e0801360d3 godep: update clockwork dependency 2014-10-17 10:05:29 -07:00
Jonathan Boulle ec18e46641 etcdserver/etcdhttp: switch to using fake clock 2014-10-17 10:05:29 -07:00
Jonathan Boulle c5ba66e6aa Merge pull request #1319 from jonboulle/stats_race
etcdserver: fix data race in retrieving self stats
2014-10-17 09:04:17 -07:00
Jonathan Boulle da64e7509c etcdserver/stats: lock on leaderstats too 2014-10-17 00:11:25 -07:00
Jonathan Boulle 1fa763b47b store: remove unused function 2014-10-17 00:07:23 -07:00
Jonathan Boulle 82023c591d etcdserver/stats: log any marshaling error 2014-10-16 23:05:48 -07:00
Jonathan Boulle 233e940410 etcdserver: copy stats instead of marshaling with lock 2014-10-16 23:05:48 -07:00
Jonathan Boulle c28907ba95 etcdserver: fix race and improve stats interfaces 2014-10-16 23:05:48 -07:00
Jonathan Boulle c30b82b596 etcdserver: fix data race in retrieving self stats 2014-10-16 23:05:48 -07:00
Yicheng Qin 7ef375efbd Merge pull request #1317 from unihorn/169
etcdserver: fix data race in leaderStats.Followers
2014-10-16 16:24:26 -07:00
Yicheng Qin 782d91f2d9 etcdserver: fix data race in leaderStats.Followers 2014-10-16 16:18:53 -07:00
Yicheng Qin eb72bdc3d2 stats: fix data race when recording send result 2014-10-16 15:39:31 -07:00
Yicheng Qin 8609acf573 etcdhttp: set stats field in peer handler 2014-10-16 14:23:09 -07:00
Jonathan Boulle 9b9e72e2a3 etcdhttp: add tests for ServeStats/ServeLeader 2014-10-16 10:43:49 -07:00
Jonathan Boulle 97ae531eda etcdserver: split out storestats and serverstats 2014-10-16 10:43:49 -07:00
Jonathan Boulle fedb67a71a etcdserver: fix TODO and change to base 16 2014-10-16 10:43:49 -07:00
Jonathan Boulle 8168fed825 etcdserver: add ServerStats and LeaderStats
This adds the remaining two stats endpoints: `/v2/stats/self`, for
various statistics on the EtcdServer, and `/v2/stats/leader`, for
statistics on a leader's followers.

By and large most of the stats code is copied across from 0.4.x, updated
where necessary to integrate with the new decoupling of raft from
transport.

This does not satisfactorily resolve the question of name vs ID. In the
old world, names were unique in the cluster and transmitted over the
wire, so they could be used safely in all statistics. In the new world,
a given EtcdServer only knows its own name, and it is instead IDs that
are communicated among the cluster members. Hence in most places here we
simply substitute a string-encoded ID in place of name, and only where
possible do we retain the actual given name of the EtcdServer.
2014-10-16 10:43:44 -07:00
Jonathan Boulle 0a8721a708 etcdserver: expose store statistics 2014-10-16 10:43:23 -07:00
Yicheng Qin 8cd6030a1d etcdserver: add checking when apply conf change 2014-10-16 09:49:26 -07:00
Yicheng Qin a8a1d4fd93 Merge pull request #1299 from unihorn/162
etcdhttp: add PUT and DELETE on /v2/admin/members/
2014-10-15 10:52:11 -07:00
Xiang Li 828accf07b etcdserver: better logging 2014-10-15 13:07:34 +08:00
Yicheng Qin 6d0658c8ca etcdhttp: check error returned by ParseForm 2014-10-14 14:50:11 -07:00
Jonathan Boulle 48c195fac7 Merge pull request #1298 from jonboulle/members
etcdhttp: remove members handling for now
2014-10-14 13:57:52 -07:00
Jonathan Boulle 7656069675 etcdhttp: remove members handling for now 2014-10-14 12:07:28 -07:00
Yicheng Qin 99e35554c0 etcdhttp: add doc for member management http endpoint 2014-10-14 11:09:14 -07:00
Xiang Li f98fbbfc14 *: proto refactoring 2014-10-14 21:07:23 +08:00
Jonathan Boulle 4183b69e12 *: move from third_party to Godep 2014-10-14 00:37:52 -07:00
Yicheng Qin 31264e7eb5 etcdhttp: add PUT and DELETE on /v2/admin/members/ 2014-10-13 22:36:06 -07:00
Xiang Li fbb874172c etcdserver: fix typo 2014-10-14 11:30:49 +08:00
Xiang Li 6fc0b1977b etcdserver: Id -> ID 2014-10-14 11:30:49 +08:00
Xiang Li b53b74733a etcdserver: add s.apply 2014-10-14 11:30:49 +08:00
Xiang Li 30c7a7f2dd etcdserver: add shouldDiscover 2014-10-14 11:29:00 +08:00
Xiang Li a85ec90d68 etcdserver: clean NewServer 2014-10-14 11:29:00 +08:00
Xiang Li 57ae19b500 Merge pull request #1290 from coreos/member_endpoint
etcdserver: change machines endpoint to members
2014-10-14 11:04:08 +08:00
Xiang Li 1177b07535 etcdserver: change machines endpoint to members 2014-10-14 11:02:17 +08:00
Yicheng Qin f693c6ddf2 etcdserver: apply bootstrap conf change 2014-10-13 11:22:23 -07:00
Yicheng Qin 0319b033ea etcdserver/raft: set context for bootstrap addnode entries 2014-10-13 11:22:23 -07:00
Xiang Li 3516cc3ee5 *: change all ID to uint64 2014-10-12 08:38:48 +08:00
Yicheng Qin f16a272898 Merge pull request #1234 from unihorn/152
etcdserver: save PeerURLs and Others into two different keys
2014-10-10 12:21:32 -07:00
Yicheng Qin 447caf1afc etcdserver/wal: record info at the head of WAL file 2014-10-10 11:57:09 -07:00
Yicheng Qin 77271b0663 etcdserver: split Member into RaftAttributes and Attributes
The split helps to save them in different key paths, because they have
distinct life cycle on update.
2014-10-09 20:28:00 -07:00
Xiang Li 8bbbaa88b2 *: raft related int64 -> uint64 2014-10-09 14:29:21 +08:00
Jonathan Boulle 682008724d etcdserver: add discovery warning message 2014-10-08 16:09:12 -07:00
Yicheng Qin 8e8719f6ac etcdserver: Create, Delete -> Add, Remove 2014-10-07 16:21:58 -07:00
Yicheng Qin cdea98d434 etcdserver: skip bootstrap addNode entry
This is a hack to make etcd work normally.
2014-10-07 11:11:31 -07:00
Yicheng Qin 6a62621695 etcdserver: update panic info 2014-10-07 11:04:50 -07:00
Yicheng Qin 3859297225 etcdserver: check id match 2014-10-07 11:04:50 -07:00
Yicheng Qin d051af4d3d etcdserver: apply config change on cluster store 2014-10-07 11:04:50 -07:00
Xiang Li 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
Barak Michener 39e0a0cd0a Merge pull request #1249 from barakmich/sanity_check
Split config into a separate file and add sanity check and test
2014-10-06 20:19:23 -04:00
Barak Michener d6aea2a795 add golint on the new box and fix appropriate lint 2014-10-06 20:16:25 -04:00
Barak Michener 8a311e5b76 remove new cluster check 2014-10-06 20:07:51 -04:00
Barak Michener 1a0195e07e tableize the test 2014-10-06 20:05:53 -04:00
Yicheng Qin 3ca3c9ad4c Merge pull request #1245 from unihorn/155
main/raft: write addNode ConfChange entries in log when start raft
2014-10-06 17:00:28 -07:00
Barak Michener 120b088723 Split config into a separate file and add sanity check and test 2014-10-06 19:42:13 -04:00
Yicheng Qin 45ebfb4217 raft: refine initial entries logic in StartNode 2014-10-06 16:06:01 -07:00
Yicheng Qin c15c3eab4c etcdserver: move int64Slice into pkg/types/ 2014-10-06 15:12:02 -07:00
Brandon Philips e2d8037ded main: use initial-cluster and initial-cluster-state flags
In preperation for adding the ability to join a machine to an existing
cluster force the user to specify whether they expect this to me a new
cluster or an active one.

The error for not specifying the initial-cluster-state is:
```
etcd: initial cluster state unset and no wal found
```
2014-10-06 14:59:25 -07:00
Yicheng Qin 314d425718 main/raft: write addNode ConfChange entries in log when start raft 2014-10-06 14:33:12 -07:00
Xiang Li 9e3d045b2b *:discovery hook up 2014-10-06 10:12:42 -07:00
Jonathan Boulle d2df23183d etcdserver: restore test coverage of cluster 2014-10-03 17:06:23 -07:00
Jonathan Boulle f432b9d29b etcdhttp: remove configurable timeout
It's slightly unclear why we expose this timeout as being configurable,
and the `-timeout` flag does not exist in 0.4.x, so for now, remove the
flag until we have evidence that it is needed.
2014-10-03 13:47:34 -07:00
Jonathan Boulle 1308c3e809 etcdserver: unexport EtcdServer fields where possible 2014-10-03 13:34:56 -07:00
Jonathan Boulle e5f5fcff48 etcdserver: collapse dir configuration to DataDir 2014-10-03 13:34:49 -07:00
Jonathan Boulle af6b29f291 main: move server configuration to etcdserver package 2014-10-03 13:34:49 -07:00
Jonathan Boulle 1c11f6a144 *: expose etcd-index in watch requests
This adds a StartIndex field to the Watcher interface, which represents
the Etcd-Index at which the Watcher is created.

Also refactors the HTTP tests to use a table for most handleWatch tests
2014-10-02 18:10:11 -07:00
Yicheng Qin b64246720b etcdserver: fix test due to rebase 2014-10-01 14:57:39 -07:00
Yicheng Qin 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
Brandon Philips 83137f9eba pkg/types: introduce a URLs type
Cleanup the usage of URLs into its own type so we don't have to use a
FlagValue everywhere we have a list of URLs.
2014-10-01 14:41:01 -07:00
Yicheng Qin 073eb7677d etcdserver: move grep member logic into publish func 2014-10-01 11:50:47 -07:00
Yicheng Qin cbc84bc70e etcdserver: minimize input info 2014-10-01 11:47:17 -07:00
Yicheng Qin a40a270e19 etcdserver: publish self info when start 2014-10-01 11:47:17 -07:00
Brandon Philips 04bd48fef3 etcdserver: stop worrying about scheme
Stop worrying about the scheme. This puts a TODO on adding validation to
the schemes if TLS is specified. But we can worry about that later.
2014-09-30 17:05:20 -07:00
Brandon Philips c2f96631d3 etcdserver: stop using addScheme
This standardizes the flags to use a list of URLs everywhere. The next
step is to enforce the scheme based on TLS settings and support compat
flags.
2014-09-30 16:40:32 -07:00
Brandon Philips aa5b6cdc9e etcdserver: have newMember take an optional time field
This will be used by members joining an existing cluster or joining
using discovery.
2014-09-30 14:57:04 -07:00
Yicheng Qin 34547229a6 etcdserver: fix left Id -> ID 2014-09-29 14:14:45 -07:00
Yicheng Qin 0e8345aa73 Merge pull request #1143 from unihorn/136
*: Id -> ID for protobuf types
2014-09-29 13:58:02 -07:00
Yicheng Qin 08e5f39d8a Merge pull request #1192 from unihorn/140
etcdserver: add publish func
2014-09-29 10:20:39 -07:00
Yicheng Qin 89077167c3 etcdserver: add publish func 2014-09-29 10:13:06 -07:00
Yicheng Qin 5784693a39 etcdserver: Cluster.Endpoints() -> Cluster.PeerURLs() 2014-09-28 14:39:47 -07:00
Yicheng Qin e83f851995 etcdserver: move cluster test from etcdhttp to etcdserver 2014-09-28 14:35:48 -07:00
Yicheng Qin 15798a73d9 etcdserver: return client urls for /v2/machines 2014-09-26 16:50:15 -07:00
Yicheng Qin 1d5d2e3726 *: Id -> ID for protobuf types
We use ID instead of Id in this project based on golang conventions.
2014-09-26 11:49:30 -07:00
Brandon Philips 5e3fd6ee3f etcdserver: introduce the cluster and member
This introduces two new concepts: the cluster and the member.

Members are logical etcd instances that have a name, raft ID, and a list
of peer and client addresses.

A cluster is made up of a list of members.
2014-09-25 18:04:10 -07:00
Jonathan Boulle 9b3478218e etcdserver: add RaftIndex and RaftTerm 2014-09-25 16:46:24 -07:00
Xiang Li aab41f06d0 elog: remove elog 2014-09-25 11:33:10 -07:00
Xiang Li 45f71af33e pkg: move testutil to pkg 2014-09-25 10:40:40 -07:00
Jonathan Boulle 2da1010cf7 etcdhttp: make TTL= equivalent to unset, and TTL=0 expire 2014-09-24 17:41:44 -07:00
Jonathan Boulle fa762e6b25 etcdhttp: process dir parameter in request 2014-09-24 17:11:28 -07:00
Jonathan Boulle 98561f6b5d Merge pull request #1158 from jonboulle/1158_unset_ttl
"unsetting" a TTL fails
2014-09-24 17:01:50 -07:00
Jonathan Boulle 20ac7d6732 Merge pull request #1157 from jonboulle/1019_etcdserver
etcdserver: extend storeRecorder to test parameters
2014-09-24 16:58:57 -07:00
Jonathan Boulle 2b52384e7e etcdhttp: allow empty values for TTL parameter 2014-09-24 16:44:55 -07:00
Jonathan Boulle c2ced7dc70 etcdserver: add tests for Set and Dir=true/false 2014-09-24 15:57:06 -07:00
Jonathan Boulle ef0ba361df etcdhttp: add test for expiration time 2014-09-24 15:46:40 -07:00
Jonathan Boulle 2e2cd12407 etcdhttp: disallow empty prevValue fields 2014-09-24 15:21:18 -07:00
Jonathan Boulle c28fd92d10 etcdserver: extend storeRecorder to test parameters 2014-09-24 14:33:51 -07:00
Jonathan Boulle c8c55aa378 scripts: consolidate and standardize protobuf generation 2014-09-24 13:45:00 -07:00
Jonathan Boulle a9caa24f8a etcdhttp: add test for streaming watches 2014-09-24 11:27:36 -07:00
Jonathan Boulle ddc30c0a33 etcdserver: use Context to communicate timeout, and add tests 2014-09-24 11:27:36 -07:00
Jonathan Boulle 172a32e5e3 etcdserver: correct timeout and streaming handling
This reintroduces the 'stream' parameter to support long-lived watch
sessions. These sessions respect a server timeout (set to 5 minutes by
default).
2014-09-24 11:27:36 -07:00
Jonathan Boulle e97134e767 etcdserver: eliminate race in sync test 2014-09-23 15:49:20 -07:00
Jonathan Boulle b85ad9bbc2 Merge pull request #1082 from jonboulle/1082_x_etcd_index
X-Etcd-Index returns the node's modifiedIndex
2014-09-23 15:14:21 -07:00
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
Jonathan Boulle 20776f1947 etcdserver: use int64slice directly 2014-09-11 19:17:07 -07:00
Jonathan Boulle e18b8c12be etcdserver: switch to proper int64Slice for sorting 2014-09-11 17:28:08 -07:00
Jonathan Boulle 5f66b35852 etcdserver/etcdhttp: split out peers and add tests 2014-09-11 16:53:55 -07:00
Jonathan Boulle c03798f99b Merge pull request #1011 from jonboulle/clean_http
Validate HTTP API user input
2014-09-11 15:31:25 -07:00
Jonathan Boulle 786982d8e5 simplify 2014-09-11 15:13:56 -07:00
Jonathan Boulle 52ddd389ff etcdhttp: use Form values over query parameters 2014-09-11 15:12:31 -07:00
Jonathan Boulle 7c03704b19 etcdserver: restructure to hopefully simplify
Obviate parseBool helper, define emptyReq locally to parseRequest,
have writeEvent return an error which gets logged
2014-09-11 08:50:41 -07:00
Brian Waldon bafe960dba etcdhttp: add Peers.Endpoints 2014-09-10 18:02:02 -07:00
Brian Waldon c251304068 *: s/Id/ID/
golang convention dictates that the individual characters in an
abbreviation should all have the same case. Use ID instead of Id.

The protobuf generator still generates code that does not meet
this convention, but that's a fight for another day.
2014-09-10 16:09:08 -07:00
Jonathan Boulle e2d01eff35 etcdserver: switch to using etcd.Error 2014-09-10 15:46:13 -07:00
Jonathan Boulle 2342402434 etcdserver: address style comments 2014-09-10 14:14:14 -07:00
Jonathan Boulle bed63cddf7 etcdhttp: add tests for ParseBool/ParseUint64 helpers 2014-09-10 12:05:36 -07:00
Jonathan Boulle e736a11ac4 etcdhttp: perform validation of query parameters
Add basic input validation of all query parameters supported by
serveKeys. Also restructures etcdhttp a bit to better facilitate
testing.

Test coverage is slightly improved.
2014-09-10 12:01:58 -07:00
Yicheng Qin 51e4bbfeb0 http: check err return from http.NewRequest 2014-09-09 20:46:56 -07:00
Yicheng Qin 4e31bb308d raft: use const firstId to track ids 2014-09-09 19:07:20 -07:00
Yicheng Qin 8c58684fb7 etcdserver: fix testServer 2014-09-09 16:59:42 -07:00
Yicheng Qin 01871e7c29 http: use sort.Strings 2014-09-09 16:20:02 -07:00
Yicheng Qin d519491545 http: add TODO for peers var 2014-09-09 15:55:42 -07:00
Yicheng Qin 961a61d708 http: add allow func
For further extendability
2014-09-09 15:45:34 -07:00
Yicheng Qin 4087fa5c7a http: allow GET, HEAD for /v2/machines 2014-09-09 15:22:52 -07:00
Yicheng Qin 0c1d1b7aeb etcdhttp: add /v2/machines endpoint 2014-09-09 15:00:29 -07:00
Jonathan Boulle 44acd57ea4 etcdserver: remove superfluous context 2014-09-09 11:18:25 -07:00
Jonathan Boulle 07ce8bc4bc etcdserver: split out functional test to new package 2014-09-09 11:18:24 -07:00
Jonathan Boulle 8473f3bf52 api: address review comments 2014-09-09 11:17:53 -07:00
Jonathan Boulle c78239a629 etcdserver: add test coverage for parseRequest 2014-09-09 11:17:53 -07:00
Jonathan Boulle b33b85870d etcdserver: add waitForEvent and encodeResponse coverage 2014-09-09 11:17:53 -07:00
Jonathan Boulle f7444ff300 store: convert Watch to interface 2014-09-09 11:17:53 -07:00
Jonathan Boulle 9997c9488a *: fix a few small issues identified by go vet 2014-09-08 23:52:36 -07:00
Xiang Li 55b4267c30 Merge pull request #1001 from coreos/sender
etcdhttp: non-blocking sender
2014-09-08 23:36:10 -07:00
Xiang Li 908d326e22 etcdhttp: use peer.String() in test 2014-09-08 20:50:35 -07:00
Xiang Li 378cadf073 etcdhttp: implment Peers.String() 2014-09-08 20:45:10 -07:00
Xiang Li f4a33dd6df etcdhttp: simple test for peer set cleanup 2014-09-08 17:04:36 -07:00
Xiang Li 5c8839387d etcdhttp: set peer should clean up previous values 2014-09-08 16:38:01 -07:00
Xiang Li cbec48e8f6 etcdhttp: non-blocking sender 2014-09-05 13:54:40 -07:00
Xiang Li f1856abe60 etcdhttp: add v2prefix 2014-09-03 21:52:16 -07:00
Blake Mizerany d844377ca6 *: vendor context 2014-09-03 20:06:16 -07:00
Blake Mizerany 172c1eae5d etcdhttp: fix test build 2014-09-03 20:01:54 -07:00
Blake Mizerany 99c7371337 etcdserver: use vendored gogoproto 2014-09-03 19:47:05 -07:00
Xiang Li 3c77693881 raft: make tick send out messages. all state machine actions should be taken inside step function. 2014-09-03 10:17:09 -07:00
Xiang Li 2ba57ee75d *: remove unused pkgs 2014-09-03 09:20:20 -07:00
Xiang Li 3699f2e5f9 etcdserver: rename someMachineMessage->machineMessage 2014-09-03 09:20:11 -07:00
Xiang Li 4c116a5a01 etcd: add consistent get 2014-09-03 09:20:10 -07:00
Xiang Li f6a9599eb4 *: rename etcd to etcdserver 2014-09-03 09:20:10 -07:00