89 Commits

Author SHA1 Message Date
Brandon Philips
1cffdb3a48 Merge pull request #866 from coreos/qread
feat(get): get from quorum
2014-07-08 18:30:18 -07:00
Christoffer Vikström
2338481bb1 server: Flush headers when using wait=true and stream=true
Many http clients will missbehave unless they get an initial http-
response, even when long-polling. It also saves the user/client from
having to handle headers on the first action of the watch, but rather
handle the response immediately.
2014-07-03 18:04:36 +02:00
Xiang Li
973bde9a07 feat(get): get from quorum 2014-06-22 21:33:38 -07:00
Yicheng Qin
db4c5e0eaa fix(server/v2): set correct content-type for etcdError response
"net/http".Error reset the content type, so we get rid of it and
write our own one.
2014-05-29 14:18:50 -07:00
Yicheng Qin
baadf63912 feat: implement standby mode
Change log:
1. PeerServer
- estimate initial mode from its log through removedInLog variable
- refactor FindCluster to return the estimation
- refactor Start to call FindCluster explicitly
- move raftServer start and cluster init from FindCluster to Start
- remove stopNotify from PeerServer because it is not used anymore
2. Etcd
- refactor Run logic to fit the specification
3. ClusterConfig
- rename promoteDelay to removeDelay for better naming
- add SyncClusterInterval field to ClusterConfig
- commit command to set default cluster config when cluster is created
- store cluster config info into key space for consistency
- reload cluster config when reboot
4. add StandbyServer
5. Error
- remove unused EcodePromoteError
2014-05-09 01:56:55 -07:00
Yicheng Qin
b3e66ee980 fix(TestV2Watch): ensure server has started 2014-05-08 12:18:08 -07:00
Yicheng Qin
17e299995c refactor(peer_server): remove standby mode in peer server 2014-05-07 09:10:09 -07:00
Yicheng Qin
fa54866e99 Revert "Merge pull request #631 from metaflow/fix-delete-key-as-directory"
This reverts commit b87972713e17fb815bfe42f25a63f94f232007e2, reversing
changes made to bd8d45ce28d6f9ddb9c5164f58aca8f9a6359f7b.
2014-04-21 17:55:44 -07:00
Mikhail Goncharov
7cebc3999a api(delete) now you get an error trying to delete files a directory (http.StatusForbidden) 2014-04-21 19:50:57 +07:00
Yicheng Qin
c8de5eee85 fix(server/key): unable to update unexpired ttl 2014-04-14 11:03:46 -07:00
Yicheng Qin
89d3df242c chore(server): handle HEAD for key space efficiently
Implement HEAD in server/v1 and server/v2 functions to avoid
time wasting on JSON marhsal.
2014-04-07 18:55:07 -07:00
Yicheng Qin
28f19dec60 feat(server): make header-only requests work 2014-04-07 13:51:33 -07:00
Tomás Senart
b6053d6a86 Making code formatting consistent.
$ gofmt -s -w  && goimports -w
2014-03-27 14:19:08 +01:00
Ben Johnson
62b89a128a Merge branch 'master' of https://github.com/coreos/etcd into proxy
Conflicts:
	config/config.go
	server/peer_server.go
	server/transporter.go
	tests/server_utils.go
2014-03-24 15:30:14 -07:00
Ben Johnson
174b9ff343 bump(github.com/goraft/raft): 6bf34b9
Move from coreos/raft to goraft/raft and update to latest.
2014-03-24 15:09:47 -07:00
Yicheng Qin
df2b565397 fix(test/server): avoid watch test timeout by moving json decode
These tests were timing out because the combination of the GET and JSON
decode was taking longer than the timeout. Pull the JSON decode out of
the go routine that is being timed.
2014-03-18 08:49:14 -07:00
Mikhail Goncharov
074c78d725 fix(store): corrected CAS and CAD fail cause in response
specifically when both prevIndex and prevValue are provided
2014-03-08 14:50:34 +07:00
Ben Johnson
1d961b8e56 Add proxy mode. 2014-02-22 15:02:20 -07:00
evan-gu
9cfd8c5f0b fix(store): make NodeExtern.Value a *string
Before this change if the value of a Node was "" it would get dropped from the json
encoding and the Node.Value field would be missing. Fix this problem by making
NodeExtern.Value a *string so that an empty string will be encoded but a nil value
will drop the field.
2014-02-18 00:50:44 -05:00
Brandon Philips
d7d20d1c3d bump(github.com/stretchr/testify): 9cc77fa25329013ce07362c7742952ff887361f2 2014-02-02 16:57:36 -08:00
Brandon Philips
13b6c1e684 chore(*): make everything use goven
for i in github.com/BurntSushi/toml github.com/coreos/go-etcd/etcd github.com/coreos/go-log/log github.com/gorilla/context github.com/rcrowley/go-metrics bitbucket.org/kardianos/osext github.com/coreos/go-systemd/journal github.com/coreos/raft code.google.com/p/goprotobuf/proto ; do goven  -copy -rewrite $i; done
2014-02-01 23:44:18 -08:00
Brandon Philips
ea8a353545 chore(*): gofmt everything 2014-02-01 23:44:10 -08:00
Cenk Alti
5b924dfd4e feat(stream watchers) disable double chunking 2014-01-10 15:09:35 +02:00
Cenk Alti
c247d807af feat(stream watchers) end streaming if too many notifications 2014-01-09 14:15:36 +02:00
Xiang Li
22a25a18b3 feat(stream watchers) add stream watcher support 2014-01-09 15:28:33 +08:00
Xiang Li
2bfb8f5e4f Merge pull request #418 from xiangli-cmu/cancel_watcher
cancel watcher
2014-01-08 21:34:32 -08:00
Xiang Li
fa3b4a7941 refactor(watcher) change newWatcher to Watch 2014-01-09 13:29:04 +08:00
Xiang Li
f46fdbf078 feat(node_extern.go) add prevNode field 2014-01-01 19:50:07 +08:00
Xiang Li
5e499456f0 init cancel watcher 2013-12-26 22:06:15 +08:00
Xiang Li
715b4d7bfc Merge pull request #408 from xiangli-cmu/compareAndDelete
Compare and delete
2013-12-25 13:16:27 -08:00
Xiang Li
c36f306a1d test(delete_handler_test.go) fix inconsistent between test case and comments 2013-12-25 19:05:40 +08:00
Xiang Li
ef988020b7 fix(event_history) fix a bug in event queue 2013-12-22 15:42:10 -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
Chris Shoemaker
3f85829e87 fix(v2/tests): make comments and tests agree about what's being tested
In cases where the comments were incorrect, this changes them to agree
with the tests.  In cases where the comments were correct, this extends
the tests to cover the behavior described in the comment.
2013-12-21 21:39:19 -05:00
Chris Shoemaker
3cde996d21 refactor(v2/tests): don't repeat construction of full test URL 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
Xiang Li
9cf1fcc987 refactor(compareAndDelete) 2013-12-20 05:10:22 +08:00
Xiang Li
e2fa89d554 merge compareAndDelete 2013-12-19 22:19:49 +08:00
Xiang Li
3e4f8a382e fix TestV2WatchKeyInDir test 2013-12-11 10:19:16 -08:00
Brandon Philips
74bd0d95b8 fix(server): try and add a expire dir test
This doesn't actually work yet.
2013-12-10 16:32:37 -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
Brian Waldon
0fb8fc0b8d fix(v2): Drop prevValue from exported fields 2013-12-06 11:46:23 -08:00
Xiang Li
5edaee79e6 Merge pull request #363 from xiangli-cmu/fix_consistent_redirection
fix redirect url should include rawquery
2013-12-05 20:33:56 -08:00
Xiang Li
d646d7c16a tests add tests for dir flag 2013-12-05 20:46:52 -05:00
Xiang Li
e00296960c test fix tests 2013-12-05 18:16:01 -05:00
Xiang Li
b556252358 tests fix all tests 2013-12-05 17:48:32 -05:00
Xiang Li
40d297be66 feat add dir_flag 2013-12-05 17:10:37 -05: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
Xiang Li
ded3cc24c0 fix redirect url should include rawquery 2013-12-02 22:53:36 -05:00
Xiang Li
c6e1af8321 merge master 2013-12-02 22:36:38 -05:00