217 Commits

Author SHA1 Message Date
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
Brian Waldon
5c3a3db2d8 refactor(server): treat Server as an http.Handler 2014-01-22 11:17:57 -08:00
Brian Waldon
074099a1b2 refactor(cors): Simplify corsInfo struct 2014-01-22 11:17:57 -08:00
Brian Waldon
a2ee620394 refactor(raft): init raft transporter & server in main 2014-01-22 11:17:56 -08:00
Brian Waldon
ffa2b07dc4 refactor(transporter): Pass in everything the transporter needs 2014-01-22 11:17:43 -08:00
Brian Waldon
60bbc57aeb refactor(transporter): pass in timeouts 2014-01-22 11:17:43 -08:00
Brian Waldon
86718167e8 refactor(peer_server): move stats construction to factories 2014-01-22 11:17:42 -08:00
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
91fc6aabd2 chore(gofmt): Run gofmt 2014-01-22 11:17:26 -08:00
Brian Waldon
c0ff8f6026 chore(imports): Shift around some imports 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
91f768f9ae refactor(cors): Rename cors_handler.go to cors.go 2014-01-22 10:59:12 -08:00
Brian Waldon
97bc5b260d feat(metrics): Publish peer heartbeat events as metrics 2014-01-21 11:44:22 -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
Brandon Philips
7a7f6aea00 Merge pull request #479 from philips/add-debug-endpoint
add-debug-endpoint
2014-01-16 11:28:52 -08:00
Brandon Philips
c2077ed0b6 feat(server): add net/http/pprof endpoints
Add some basic profiling endpoints over http to start digging into
memory and request latencies.
2014-01-15 15:03:29 -08:00
Xiang Li
d9088a5f18 Merge pull request #473 from bcwaldon/fix-peer-timeouts
Use election and heartbeat timeouts when building peer transporter
2014-01-15 02:11:40 -08:00