Commit Graph

256 Commits (0461b3fa51ebcd3f72ef54296638ac2f19ea9071)

Author SHA1 Message Date
Brian Waldon 7bd4d05a38 refactor(peer-server): move listener init out of peer_server.go 2014-01-22 11:17:41 -08:00
Brian Waldon d0c4916fe9 refactor(server): move listener init out of server.go 2014-01-22 11:17:26 -08:00
Brian Waldon a93d60be90 refactor(cors): Break apart CORS data and middleware 2014-01-22 11:17:26 -08:00
Brian Waldon c47760382e refactor(Server): Use a config struct in Server 2014-01-22 11:17:25 -08:00
Brian Waldon 9c8a23c333 refactor(PeerServer): Use a config struct in PeerServer 2014-01-22 11:17:03 -08:00
Brian Waldon 7eaad5c8e0 feat(metrics): enable some metrics; push to graphite
* -trace flag controls whether or not to enable metrics-gathering
  and the /debug/* HTTP endpoints
* -graphite-host flag controls where metrics should be sent
* timer.ae.handle metric tracks execution time of AppendEntriesRequest
2014-01-20 15:39:36 -08:00
Brian Waldon 32df6f92fc fix(peer): Pass peer server timeouts through factory
The peer's heartbeat and election timeouts are needed to build
the transporter in the factory method.
2014-01-14 09:18:03 -08:00
Xiang Li 715b4d7bfc Merge pull request #408 from xiangli-cmu/compareAndDelete
Compare and delete
2013-12-25 13:16:27 -08:00
Chris Shoemaker d89fa131ab feat(v2/errors): Use more appropriate HTTP status codes for error cases.
This commits adds test coverage for all the error and non-error cases
described below, but only the behavior of the 403, 404 and 412 cases
are changing in this commit.

When setting a key results in a new resource, we asset an HTTP status
code of 201 (aka "Created").

When attempting to get a resource that doesn't exist, we assert an
HTTP status code of 404 (aka "Not Found").

When attempting to delete a directory without dir=true, or a non-empty
directory without recursive=true, but the request is otherwise valid,
we assert an HTTP status code of 403 (aka "Forbidden").

When a precondition (e.g. specified by prevIndex, or prevValue) is not
met, but the request is otherwise syntactically valid, we assert an
HTTP status code of 412 (aka "Precondition Failed").  However,
prevExist is handled slightly differently.  If prevExist=false fails,
then this is treated like a failed precondition, so it should use
PreconditionFailed.  But, if prevExist=true fails, then this is
treated like other requests that require the existence of the
resource, and uses NotFound if the resource doesn't exist.

We continue to assert an HTTP status code of 400 when the request is
syntactically invalid (e.g. when prevIndex=bad_index).
2013-12-21 21:39:19 -05:00
Xiang Li c4179829d6 tests(get_handler) loosen the time assumption for the un 2013-12-20 08:23:50 +08:00
Cong Ding 468bfedf34 gofmt 2013-12-12 14:53:22 -08:00
Xiang Li dd354c9e22 Merge pull request #376 from xiangli-cmu/dir_flag
feat add dir_flag
2013-12-09 08:34:57 -08:00
Ben Johnson 8442e7a0dc Timeout refactor. 2013-12-07 14:35:31 -07:00
Ben Johnson aabd0faebe Merge branch 'feature-parametric-timeout' of https://github.com/neildunbar/etcd into neildunbar-feature-parametric-timeout 2013-12-07 14:07:53 -07:00
Brian Waldon 0fb8fc0b8d fix(v2): Drop prevValue from exported fields 2013-12-06 11:46:23 -08:00
Neil Dunbar a06f5e74af Merge remote-tracking branch 'upstream/master' into feature-parametric-timeout
Conflicts:
	Dockerfile
	server/usage.go
	tests/server_utils.go
2013-12-06 10:13:33 +00:00
Xiang Li e00296960c test fix tests 2013-12-05 18:16:01 -05:00
Neil Dunbar 0867b33de5 fix(Dockerfile): reverted unneeded changes
fix(server/config.go): ensured params are changeable from config file and env
fix(server/server.go): removed unnecessary debug line
fix(server/timeout.go): removed a commented block
style(server/transporter.go): put explicit vars to replace timeout expressions
style(tests/server_utils.go): ran gofmt to clean up indenting
2013-12-05 09:23:23 +00:00
Ben Johnson 5d865e321c Merge branch 'master' of https://github.com/coreos/etcd into mod-lock
Conflicts:
	server/v2/tests/delete_handler_test.go
	server/v2/tests/get_handler_test.go
	server/v2/tests/post_handler_test.go
	server/v2/tests/put_handler_test.go
	third_party/github.com/coreos/go-etcd/etcd/requests.go
2013-12-04 22:36:53 -07:00
Neil Dunbar faab194247 Fixed test case 2013-12-04 17:39:03 +00:00
Xiang Li c6e1af8321 merge master 2013-12-02 22:36:38 -05:00
Brandon Philips 72bf216cb4 fix(server/v2): redirect to ClientURL not PeerURL
If consistent is set you must redirect the client to the leader's
ClientURL not the PeerURL.
2013-12-02 18:20:11 -08:00
Xiang Li fc562bd625 fix tests bump deps 2013-12-01 17:24:30 -05:00
Ben Johnson 22c2935ddb Initial mod_lock acquire. 2013-11-27 16:59:05 -07:00
Xiang Li a607c9eace fix dep issue 2013-11-22 13:27:04 -08:00
Xiang Li 40a574a8ca wip commit 2013-11-22 11:32:24 -08:00
Ben Johnson 15eee885d7 Merge branch 'master' of https://github.com/coreos/etcd into clean-up-config 2013-11-19 10:13:39 -07:00
Ben Johnson 8952c1bd42 Merge branch 'master' of https://github.com/coreos/etcd into clean-up-config
Conflicts:
	etcd.go
2013-11-19 08:28:46 -07:00
Ben Johnson cba2611c68 Renamed configuration parameters. 2013-11-15 00:13:32 -05:00
Xiang Li 4f45de6953 test fix wrong assumption should be previous index + 501 + 6 2013-11-14 20:22:25 -08:00
Xiang Li e90937a2b4 tests loosen the ttl checking 2013-11-14 20:09:12 -08:00
Ben Johnson 954217fb73 Fix v1 cluster migration test. 2013-11-12 19:27:29 -05:00
Ben Johnson ccc27a61f5 Merge branch '0.2' of https://github.com/coreos/etcd into migration-test 2013-11-12 17:29:58 -05:00
Xiang Li 5abbaf59e3 Merge pull request #292 from xiangli-cmu/fix-ttl
WIP: fix ttl
2013-11-11 21:30:32 -08:00
Ben Johnson d8157472fe Merge branch '0.2' of https://github.com/coreos/etcd into migration-test 2013-11-11 18:12:24 -05:00
Xiang Li e427c85f03 refactor add debug info to remove_node test 2013-11-09 21:31:17 -08:00
Xiang Li 27157e5e78 fix tests 2013-11-09 21:17:32 -08:00
Brandon Philips 6a074d4f6f chore(*.go): add copyright notice 2013-11-08 14:04:15 -08:00
Ben Johnson 8c6606ed12 Fix TTL migration issue. 2013-11-05 15:57:53 -07:00
Ben Johnson d3bfc49b7c Remove leading slash from handlers. 2013-11-04 14:36:20 -07:00
Ben Johnson 35d9719707 Add v1.solo migration fixture. 2013-11-04 13:56:02 -07:00
Ben Johnson 6b5d6ecd8b Cluster migration test. 2013-11-04 13:46:43 -07:00
Ben Johnson bf76af8fd1 Update migration. 2013-11-04 13:16:45 -07:00
Xiang Li 235ffc234d refactor change cmd argument snapCount to snapshotCount 2013-11-03 21:06:51 -08:00
Xiang Li 52d5e05201 refactor use defer 2013-11-03 20:59:08 -08:00
Ben Johnson 44356dc654 Update migration script. 2013-11-03 16:02:59 -07:00
Ben Johnson 3a29ce4d17 Update migration. 2013-11-03 15:58:16 -07:00
Ben Johnson 02abbb6a6c Migration test. 2013-11-03 15:49:00 -07:00
Xiang Li c88a556917 test add snapshot tests 2013-10-30 19:41:21 -07:00
Xiang Li 9d0de611a7 feat add snapCount parameter 2013-10-30 17:36:15 -07:00
Xiang Li 0e15962cef Merge pull request #276 from xiangli-cmu/feat-kvpair-ttl
feat kvpair include ttl
2013-10-30 15:56:28 -07:00
Xiang Li 0cd78e210a tests more delay for passing tests on travis 2013-10-30 15:51:46 -07:00
Ben Johnson ddf527e092 Add version upgrade endpoint. 2013-10-29 15:49:10 -06:00
Ben Johnson aa9ae32998 Internal versioning. 2013-10-27 14:09:40 -06:00
Ben Johnson dcef04b796 Add v2 unit tests. 2013-10-17 21:52:15 -06:00
Ben Johnson b4d311d6a1 Reintegrate functional tests into etcd. 2013-10-16 13:58:03 -06:00