570 Commits

Author SHA1 Message Date
Yicheng Qin
5ed5d44652 etcdserver: print out initial cluster members
It is moved from etcdmain pkg because the line should only be printed out
when etcd bootstraps at the first time.
2014-11-03 19:34:24 -08:00
Yicheng Qin
5da481213e Merge pull request #1478 from unihorn/190
etcdserver: panic on storage error
2014-11-03 11:07:55 -08:00
Yicheng Qin
433b4138c5 etcdserver: panic on storage error
It is a critical error to etcd, and etcd is not able to recover it now.
2014-11-03 10:46:04 -08:00
Brian Waldon
6e038e02a6 etcdserver: fix logging of IDs 2014-10-31 12:26:53 -07:00
Yicheng Qin
e02ef6b141 Merge pull request #1546 from unihorn/198
etcdserver: better logging for assign ids from upstream
2014-10-31 11:13:43 -07:00
Yicheng Qin
2c5f062b7f etcdserver: better logging for assign ids from upstream 2014-10-31 11:06:31 -07:00
Jonathan Boulle
55c92ad456 *: create ID type
This creates a simple ID type (wrapped around uint64) to provide for
standard serialization/deserialization to a string (i.e. base 16
encoded). This replaces strutil so now that package is removed.
2014-10-31 10:34:07 -07:00
Yicheng Qin
aa50af1c69 *: clean log.Print
1. only log things by default that the operator of etcd may need to react to
2. put package name at the head of log lines
2014-10-30 18:15:53 -07:00
Xiang Li
3dfb6723b2 *: rename initial-cluster-name to initial-cluster-token 2014-10-30 13:43:38 -07:00
Brian Waldon
480e92d340 strutil: move IDAsHex/IDFromHex to new pkg 2014-10-27 18:39:09 -07:00
Brian Waldon
2472953939 etcdhttp: hex-encode member ID 2014-10-27 17:25:22 -07:00
Brian Waldon
80172c3d4a etcdserver: s/parseMemberID/mustParseMemberIDFromKey/ 2014-10-27 17:25:00 -07:00
Yicheng Qin
ee27846d5b Merge pull request #1422 from unihorn/187
etcdserver: parse context error for better message
2014-10-27 11:00:01 -07:00
Yicheng Qin
e77f8e311c etcdserver: parse context error for better message 2014-10-27 10:59:15 -07:00
Xiang Li
009b737cef *: better logging 2014-10-26 08:13:03 -07:00
Jonathan Boulle
719c57a29d proxy: retrieve ClientURLs from cluster
This is a simple solution to having the proxy keep up to date with the
state of the cluster. Basically, it uses the cluster configuration
provided at start up (i.e. with `-initial-cluster-state`) to determine
where to reach peer(s) in the cluster, and then it will periodically hit
the `/members` endpoint of those peer(s) (using the same mechanism that
`-cluster-state=existing` does to initialise) to update the set of valid
client URLs to proxy to.

This does not address discovery (#1376), and it would probably be better
to update the set of proxyURLs dynamically whenever we fetch the new
state of the cluster; but it needs a bit more thinking to have this done
in a clean way with the proxy interface.

Example in Procfile works again.
2014-10-24 15:54:12 -07:00
Yicheng Qin
49a68adcf1 Merge pull request #1386 from unihorn/184
etcdserver: update member attribute when apply request
2014-10-24 12:46:11 -07:00
Yicheng Qin
ea0bff80c0 etcdserver: update member attribute when apply request 2014-10-24 12:43:53 -07:00
Yicheng Qin
08593bcdf6 etcdserver: support newly-join member bootstrap 2014-10-24 12:38:44 -07:00
Yicheng Qin
4d80f01201 etcdserver: Cluster.IsIDremoved -> Cluster.IsIDRemoved 2014-10-23 14:29:58 -07:00
Yicheng Qin
8eee8c260e etcdserver: rebase on master and code clean 2014-10-23 13:58:55 -07:00
Yicheng Qin
f8b8bdeb17 etcdserver: use path.Join for member key in cluster 2014-10-23 13:27:54 -07:00
Yicheng Qin
3d243baacd etcdserver: generate id when new cluster 2014-10-23 13:27:54 -07:00
Yicheng Qin
67412e07f8 etcdserver: MemberFromName -> MemberByName 2014-10-23 13:27:54 -07:00
Yicheng Qin
89572b5fd7 etcdserver: refactor cluster and clusterStore
Integrate clusterStore into cluster, and let cluster become the source of
cluster info.
2014-10-23 13:27:54 -07:00
Brandon Philips
ab90369f9e etcdserver: use hex for cluster and machine id
Continue using hex everywhere. Including here.

TODO: cleanup the printing of the structs which currently have decimal
to/from:

`{Type:MsgAppResp To:9973738105406047488 From:17050684879817348455 T...`
2014-10-22 16:24:50 -07:00
Barak Michener
e42d65da12 etcdserver: Check the initial cluster settings after checking if the WAL exists 2014-10-22 18:16:43 -04:00
Barak Michener
13656eb4e7 Merge pull request #1340 from barakmich/better_ids2
etcdserver: Calculate IDs based on PeerURLs and --initial-cluster-name
2014-10-22 14:49:49 -04:00
Yicheng Qin
89b032cd69 etcdserver: Member.storeKey -> memberStoreKey 2014-10-22 11:09:36 -07:00
Yicheng Qin
7498234e40 etcdserver: record removed member to check incoming message 2014-10-22 11:09:35 -07:00
Barak Michener
502a3c2460 Refactor Cluster to hold and add members. 2014-10-22 13:52:42 -04:00
Barak Michener
1ca7c031ff first round of comments
Conflicts:
	etcdserver/config.go
	etcdserver/config_test.go
	etcdserver/server.go
	main.go
2014-10-22 13:49:54 -04:00
Barak Michener
456d1ebcae etcdserver: Calculate IDs for nodes solely on PeerURLs
Removes the notion of name being anything more than advisory or
command-line grouping, and adds checks for bootstrapping the command
line. IDs are consistent if the URLs are consistent.
2014-10-22 13:49:54 -04:00
Yicheng Qin
e2b6a4fc4c etcdserver: const XXXDir -> StoreXXXPrefix
and code clean
2014-10-21 16:10:49 -07:00
Yicheng Qin
2ff3cac653 etcdserver/etcdhttp: store location adjustment
Detailed adjustment:
/_etcd/machines/* -> /0/members/*
/* -> /1/*

And it keeps key path returned to user the same as before.
2014-10-21 16:10:19 -07:00
Xiang Li
894e678ad6 etcdserver: checking clusterID 2014-10-21 11:05:24 -07:00
Xiang Li
a44849deec Merge pull request #1286 from coreos/clusterid
*: generate clusterid
2014-10-20 19:07:03 -07:00
Xiang Li
0fd28169c8 etcdserver: use id,cid 2014-10-20 16:35:41 -07:00
Xiang Li
dc68dc9ebd etcdserver: add a todo for clusterid generation 2014-10-20 16:26:31 -07:00
Yicheng Qin
92230cee63 Merge pull request #1333 from unihorn/172
etcdserver/raft: remove msgDenied, removedNodes, shouldStop
2014-10-20 16:04:09 -07:00
Yicheng Qin
e200d2a8e2 etcdserver/raft: remove msgDenied, removedNodes, shouldStop
The future plan is to do all these in etcdserver level.
2014-10-20 15:13:18 -07:00
Xiang Li
ea6bcacfe4 *: generate clusterid 2014-10-20 15:00:54 -07:00
Yicheng Qin
f7a0d5387b etcdserver: stop server gracefully 2014-10-20 14:43:21 -07:00
Yicheng Qin
058537f34a main: add basic functional test 2014-10-20 14:43:21 -07:00
Yicheng Qin
dcaa7f0a37 Merge pull request #1328 from unihorn/169
skip initial-cluster check when reboot
2014-10-20 13:06:24 -07:00
Yicheng Qin
17382ec905 etcdserver: skip initial-cluster check when reboot
If etcd is provided with data-dir that has data, it will not use
initial-cluster, and initial-cluster could be set to be empty.
2014-10-20 12:41:07 -07:00
Jonathan Boulle
7a4d42166b *: add license header to all source files 2014-10-17 15:41:22 -07:00
Jonathan Boulle
c28907ba95 etcdserver: fix race and improve stats interfaces 2014-10-16 23:05:48 -07:00
Jonathan Boulle
c30b82b596 etcdserver: fix data race in retrieving self stats 2014-10-16 23:05:48 -07:00
Jonathan Boulle
97ae531eda etcdserver: split out storestats and serverstats 2014-10-16 10:43:49 -07:00