286 Commits

Author SHA1 Message Date
Ben Johnson
063f3b574c Check for peer before demotion. 2014-03-04 08:53:13 -07:00
Ben Johnson
c8d6b26dfd Add auto-demotion after peer inactivity. 2014-03-03 11:15:05 -07:00
Yicheng Qin
349a802a82 chore(server): remove useless CancelWhenTimeout
Setting request timeout is covered by go-httpclient now.
2014-02-28 21:52:56 -08:00
Yicheng Qin
69adb78433 fix(transporter): CancelRequest doesn't work on HTTPS connections blocked
Currently this is a workaround. And it should be fixed in Go1.3.
2014-02-27 14:31:46 -08:00
Yicheng Qin
df49265674 fix(discovery): remove its own address from peer list to join 2014-02-27 14:31:28 -08:00
Ben Johnson
fddbf35df2 Add automatic node promotion / demotion. 2014-02-25 10:02:01 -07:00
Ben Johnson
f5698d3566 Proxy promotion. 2014-02-24 17:01:04 -07:00
Ben Johnson
1d961b8e56 Add proxy mode. 2014-02-22 15:02:20 -07:00
Yicheng Qin
46d817f91b Merge pull request #577 from unihorn/6
chore: rename 'heartbeat timeout' to 'heartbeat interval'
2014-02-18 17:11:31 -08:00
Yicheng Qin
f434177a9a chore: rename 'heartbeat timeout' to 'heartbeat interval'
Heartbeat timeout means the period length that indicates heartbeat is
out of service, which is different from heartbeat interval.

So we should use '-peer-heartbeat-interval' instead of
'-peer-heartbeat-timeout' in etcd.

'-peer-heartbeat-timeout' is deprecated but still could be used.
2014-02-18 16:37:20 -08:00
Brandon Philips
8485987b74 Merge pull request #524 from yifan-gu/remove_omitempty_on_value
remove omitempty on value
2014-02-18 07:08:00 -08: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
Yicheng Qin
04f21b5976 Merge pull request #569 from unihorn/5
Ordering and functionality of `-discovery` `-peers` and data dir to find peers
2014-02-17 14:34:53 -08:00
Yicheng Qin
3a4df1612c feat(discovery): adjust boot order to find peers
The boot order for peers is -discovery, -peers, log data, forming
new cluster itself.

Special rules:
1. If discovery succeeds, it would find peers specified by discover URL
only.
2. Etcd would fail when meeting bad -discovery, no -peers and log data.

Add TestDiscoveryDownNoBackupPeersWithDataDir as the test.
2014-02-17 12:53:39 -08:00
Yicheng Qin
bd56b15b6e fix(tests/discovery): use host as -peers parameter instead of url
Or it cannot test the functionality correctly.
Moreover, add TestDiscoveryNoWithBackupPeers as the test for it.
2014-02-14 18:23:41 -08:00
Brandon Philips
fccecd4a05 fix(etcd): get consistent with etcdctl on printing versions
Lets get a bit more consistent in printing the versions:

```
$ ./bin/etcd -version
etcd version 0.3.0+git
$ ./bin/etcdctl -v
etcdctl version 0.3.0+git
```
2014-02-13 07:54:44 -08:00
Brandon Philips
db1b53fde7 chore(server): add +git to the version
we need to automate this but make sure versions built from git have
+git after the version number.
2014-02-12 22:02:00 -08:00
Brandon Philips
7015214fbb Merge pull request #554 from mfischer-zd/tls_fixes
fix(server/tls_info): use all certificates in CA file
2014-02-11 10:17:33 -08:00
Michael S. Fischer
e1af3dbde6 fix(server/tls_info): use all certificates in CA file
fixes coreos/etcd#553
2014-02-10 22:31:22 -08:00
Michael Marineau
f206db2cee add(server/v1/tests): Port many of the v2 HTTP handler tests to v1
This should cover most aspects of the v1 API but being new to the etcd
code base I cannot promise that or that the tests are even correct.
They do pass though :)
2014-02-10 22:18:06 -08:00
Brandon Philips
68383b1293 fix(server/v1): don't fail put on new v1 key
We weren't checking for PrevNode being nil in the v1 code path. Do this
and add a test.

Fixes #557
2014-02-10 18:59:56 -08:00
Brandon Philips
ddc40e5b45 doc(CHANGELOG): document v0.3.0 2014-02-07 15:54:45 -08:00
Brian Waldon
42363001b4 fix(v2): Use case-insensitive check on bool query params
Fix issue #261
2014-02-07 14:29:08 -08:00
Brandon Philips
76da437f29 bump(github.com/coreos/raft): ef3280ce54f60fff98a72012f547ed2b3415841f 2014-02-07 11:19:23 -08:00
Brandon Philips
1b3481fe25 fix(server/peer_server): stop the raftServer in Stop()
Stop() the raftServer if we stop the peerServer so that tests that start
and stop PeerServers exit cleanly.
2014-02-06 22:10:10 -08:00
Brandon Philips
468a68c96c feat(server): make the RetryInterval of PeerServer tunable
For tests and other environments it would be nice to be able to tune how
long to sleep between retries.
2014-02-06 22:10:09 -08:00
Brian Waldon
63fa35c99f refactor(tls): clarify & simplify tls configuration 2014-02-06 21:15:38 -08:00
Brandon Philips
1c91c167fc feat(config): remove the info file
The info file was meant to help the user from accidently making a
mistake but often times it just confuses people:

https://github.com/coreos/etcd/issues/356
https://github.com/coreos/etcd/issues/531
https://github.com/coreos/etcd/issues/318

Lets remove the info file for this next release.
2014-02-05 16:20:50 -08:00
Brandon Philips
8687dd3802 feat(discovery): fully working discovery now 2014-02-05 09:27:39 -08:00
Brandon Philips
72514f8ab2 feat(bootstrap): initial working code
This is an initial version of the bootstrap code that seems to work
under the normal circumstances. I need to mock out a server that will
test out all of the error cases now.
2014-02-05 09:27:39 -08:00
Brandon Philips
f56965b1c0 refactor(config): make config its own package
Refactor config into its own package. Trying to tease the config from
the server so that all of the control surfaces are exposed in the Server
for easier testing.
2014-02-05 09:27:39 -08:00
Brandon Philips
69922340f6 refactor(server): move utilities into pkg
like camlistore lets move these utilities into a `pkg` prefix.
2014-02-05 09:27:39 -08:00
Brandon Philips
0e50d9787a feat(*): bootstrap initial commit
Setup the flags, and checkin the docs. Lets do this!
2014-02-05 09:27:39 -08:00
Brandon Philips
9e43e726a9 Merge pull request #507 from philips/turn-snapshots-on-by-default
feat(*): enable snapshots by default
2014-02-05 09:08:43 -08:00
Brandon Philips
72b393ca53 Merge pull request #519 from philips/fixup-server-tls-client-config
fix(server): fix client certificate verification
2014-02-03 17:33:45 -08: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
Brandon Philips
0566bf2d5d Revert "Fix compile bug in peer_server_handlers.go "
This reverts commit e1ed380f043b063ee36edb92ffe21d49819168e0.
2014-02-01 20:09:53 -08:00
Brandon Philips
58e1f12240 doc(server): some basic docs on the tls_config object
This should be refactored but something to remember while refactoring.
2014-01-31 17:08:37 -08:00
Brandon Philips
0fa6d38574 fix(server): fix client certificate verification
In d0c4916fe9b2afaa273a2a7bc9782321a866ab9f the TLS CA Certificate
verification broke.

This was bisected using the following basic test:

```
./bin/etcd -f -name machine0 -data-dir machine0 -ca-file=/tmp/ca/ca.crt -cert-file=/tmp/ca/server.crt -key-file=/tmp/ca/server.key.insecure
```

And in another window doing

```
curl --key /tmp/ca/server2.key.insecure  --cert /tmp/ca/server2.crt -k -L https://127.0.0.1:4001/v2/keys/foo -XPUT -d value=bar -v
```

Before merging this PR there are a few things that need to be fixed up:

1) Tests for client certs both positive and negative
2) Refactor (or at least documentation of) the TLSConfig types
2014-01-31 16:56:15 -08:00
augustoroman
e1ed380f04 Fix compile bug in peer_server_handlers.go
resp.Success is a func() bool, not a bool.  Call it.
2014-01-30 15:31:36 -08:00
Brandon Philips
9a0ddb3760 feat(server): log on snapshot success or failure
lila.local: snapshot of 12 events completed at index 479
lila.local: snapshot of 12 events at index 491 attempted and failed: handling snapshot
2014-01-24 07:13:01 -08:00
Brandon Philips
7ee7e910eb feat(*): enable snapshots by default
Ben recently added test coverage for snapshots so we should enable it in
etcd. Lets do this.

1d66f6a111
2014-01-23 20:53:22 -08:00
Brian Waldon
2fe22f1890 refactor(servers): emit http.Handlers from *Server 2014-01-22 11:17:58 -08:00
Brian Waldon
089021ca6d refacotor(transporter): make TLS config explicit 2014-01-22 11:17:58 -08:00
Brian Waldon
f158dfcd77 refactor(peerserver): Remove PeerServerConfig.Path 2014-01-22 11:17:58 -08:00
Brian Waldon
19980a7033 refactor(peerserver): remove timeouts from PeerServerConfig 2014-01-22 11:17:58 -08:00
Brian Waldon
a7d9efa900 refactor(server): Remove ServerConfig struct 2014-01-22 11:17:58 -08:00
Brian Waldon
0abd860f7e refactor(server): drop Serve code; rename cors object
* server/cors.go renamed to http/cors.go
* all CORS code removed from Server and PeerServer
* Server and PeerServer fulfill http.Handler, now passed to http.Serve
* non-HTTP code in PeerServer.Serve moved to PeerServer.Start
2014-01-22 11:17:57 -08:00