55 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Brian Waldon
2fe22f1890 refactor(servers): emit http.Handlers from *Server 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
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
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
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
9c8a23c333 refactor(PeerServer): Use a config struct in PeerServer 2014-01-22 11:17:03 -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
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
f250649a5e fix(snapshot) count num of log entries rather than etcd transcations 2014-01-09 21:28:09 +08:00
Ben Johnson
53477af1eb Merge branch 'master' of https://github.com/coreos/etcd into logging 2014-01-08 16:50:51 -07:00
Ben Johnson
b47042634a Add ThresholdMonitorTimeout. 2014-01-08 15:51:13 -07:00
Ben Johnson
88e0263d08 Add heartbeat and timeout threshold loggers. 2014-01-07 16:17:48 -07:00
Xiang Li
60c2680bfd fix(peer_server.go) init name field and update leader field 2014-01-07 12:30:20 +08:00
Ben Johnson
a9e20aecc6 Raft fixes, integrate logging. 2013-12-29 10:40:10 -07:00
Ben Johnson
4acfc26c5e Add event-based debugging output. 2013-12-23 16:01:05 -07:00
Cong Ding
468bfedf34 gofmt 2013-12-12 14:53:22 -08:00
Ben Johnson
8442e7a0dc Timeout refactor. 2013-12-07 14:35:31 -07:00
Neil Dunbar
46f8a354d1 Added the ability to specify heartbeat and election timeouts as
config parameters.
2013-12-04 16:58:44 +00:00
Xiang Li
8a0496cfae bump deps 2013-11-22 08:59:24 -08:00
Ben Johnson
cba2611c68 Renamed configuration parameters. 2013-11-15 00:13:32 -05:00
Xiang Li
0372cdea23 refactor move sync command into etcd 2013-11-08 16:00:58 -08:00
Xiang Li
9d0de611a7 feat add snapCount parameter 2013-10-30 17:36:15 -07:00
Xiang Li
107762e82a fix snapshot 2013-10-30 15:14:34 -07:00
Xiang Li
b852a746ce refactor move http status logic to server.go 2013-10-20 10:21:54 -07:00
Xiang Li
acbc0c8846 refactor return http status 201 Created when creating a new node 2013-10-19 19:57:36 -07:00
Ben Johnson
dcef04b796 Add v2 unit tests. 2013-10-17 21:52:15 -06:00
Ben Johnson
e7598075ac Use raft.Server interface. 2013-10-14 13:51:20 -06:00
Ben Johnson
1321c63f3b Extract Store into an interface. 2013-10-14 11:12:30 -06:00
Xiang Li
ef74464aea refactor remove extra function 2013-10-13 23:09:52 -07:00
Xiang Li
090d049b81 refactor move raft http handlers to peer_server_handlers.go 2013-10-13 22:50:51 -07:00
Xiang Li
7565313290 refactor add wrapper function 2013-10-13 22:20:23 -07:00
Xiang Li
a635f6b17c refactor remove the extra function 2013-10-13 22:13:20 -07:00
Ben Johnson
013d07bc2a Fix server dispatch redirection. 2013-10-13 16:58:36 -06:00