5072 Commits

Author SHA1 Message Date
Yicheng Qin
2e43ac8463 rafthttp: add test for streamReader.updateMsgAppTerm 2015-05-15 11:21:54 -07:00
Yicheng Qin
8637a4bf69 rafthttp: only close streamMsgApp when updating term
In all stream types, streamMsgApp needs to be closed when
updating term because its stream connection can only be used under
a certain term. But there is no need to close other streams, which
may waste time and reduce performance.
2015-05-15 11:21:54 -07:00
Yicheng Qin
9699a501f3 Merge pull request #2833 from yichengq/rename-closer
rafthttp: resetCloser -> close
2015-05-15 11:18:58 -07:00
Yicheng Qin
8e0992a28b rafthttp: resetCloser -> close
name 'close' is shorter and more straightforward.
2015-05-14 22:24:05 -07:00
Yicheng Qin
fc4543a3fd Merge pull request #2628 from yichengq/improve-msgappv2
rafthttp: reduce allocs in msgappv2
2015-05-14 21:18:16 -07:00
Yicheng Qin
d611904a41 Merge pull request #2828 from yichengq/cluster-health-log
etcdctl/cluster_health: improve output if failed to get leader stats
2015-05-14 19:01:48 -07:00
Yicheng Qin
3d8fe3b3ca etcdctl/cluster_health: improve output if failed to get leader stats
When failing to get leader stats, it said 'cluster is unhealthy' before.
This is confusing when it cannot get stats because advertised client urls
are set wrong and the cluster is healthy.
2015-05-14 18:52:10 -07:00
Xiang Li
556713739c Merge pull request #2823 from alexwlchan/master
docs: small fixes to spelling and similar
2015-05-14 15:41:14 -07:00
Xiang Li
1a9dcd2f72 Merge pull request #2826 from yichengq/fix-wait-test
pkg/wait: fix TestWaitTestStress
2015-05-13 15:56:26 -07:00
Xiang Li
132b12f8db Merge pull request #2827 from xiang90/cluster_v
etcdhttp: version endpoint also returns cluster version.
2015-05-13 15:54:54 -07:00
Xiang Li
6296054ff6 etcdhttp: version endpoint also returns cluster version. 2015-05-13 15:48:10 -07:00
Yicheng Qin
256a7cfe8c pkg/wait: fix TestWaitTestStress
The test may fail if two consequent time.Now() returns the same value.
Sleep 1ns to avoid this situation.
2015-05-13 13:41:34 -07:00
Yicheng Qin
75ee7f4aa1 Merge pull request #2821 from yichengq/private-cluster
etcdserver: stop exposing Cluster struct
2015-05-13 10:26:48 -07:00
Xiang Li
2690535f8a Merge pull request #2820 from xiang90/cap
version capability checking
2015-05-13 10:16:49 -07:00
Xiang Li
d3b1d5c008 etcdhttp: support capability checking
etcdhttp will check the cluster version and update its
capability version periodically.

Any new handler's after 2.0 needs to wrap by capability handler
to ensure it is not accessable until rolling upgrade finished.
2015-05-13 10:11:35 -07:00
Yicheng Qin
a6a649f1c3 etcdserver: stop exposing Cluster struct
After this PR, only cluster's interface Cluster is exposed, which makes
code much cleaner. And it avoids external packages to rely on cluster
struct in the future.
2015-05-13 10:01:25 -07:00
Xiang Li
19ab1cb2a9 Merge pull request #2822 from xiang90/rm_log
etcdserver: remove unnecessary around detect datadir
2015-05-13 09:27:21 -07:00
Alex Chan
0c63e16ae0 docs: small fixes to spelling and similar
This commit is a collection of fixes to spelling, capitalisation
and spacing. No substantial changes.
2015-05-13 11:45:00 +01:00
Xiang Li
f2905f2828 etcdserver: remove unnecessary around detect datadir
The log is super unhelpful. When I have a 2.1.0 etcd, it prints out
`2.0.1 vaild dir`. I have no idea why the data dir of a 2.1.0 etcd is
2.0.1.
2015-05-12 22:06:42 -07:00
Yicheng Qin
f4c51cb5a1 Merge pull request #2766 from yichengq/345
*: extract types.Cluster from etcdserver.Cluster
2015-05-12 15:52:24 -07:00
Yicheng Qin
032db5e396 *: extract types.Cluster from etcdserver.Cluster
The PR extracts types.Cluster from etcdserver.Cluster. types.Cluster
is used for flag parsing and etcdserver config.

There is no need to expose etcdserver.Cluster public, which contains
lots of etcdserver internal details and methods. This is the first step
for it.
2015-05-12 14:53:11 -07:00
Xiang Li
197437316f Merge pull request #2804 from xiang90/vv
etcdserver: support update cluster version through raft
2015-05-12 14:31:27 -07:00
Xiang Li
e866314b94 etcdserver: support update cluster version through raft
1. Persist the cluster version change through raft. When the member is restarted, it can recover
the previous known decided cluster version.

2. When there is a new leader, it is forced to do a version checking immediately. This helps to
update the first cluster version fast.
2015-05-12 11:44:34 -07:00
Yicheng Qin
f1502e970a Merge pull request #2813 from sckott/r-library
Documentation: add the R client etseed to libraries-and-tools.md
2015-05-12 10:43:59 -07:00
Xiang Li
93b610ac8d Merge pull request #2809 from xiang90/fix_discovery_err
discovery: do not return raw error from etcd store
2015-05-12 09:59:56 -07:00
Nick Owens
b764f07e34 Merge pull request #2811 from mischief/plan9-lock
pkg/fileutil: add plan9 lockfile support
2015-05-11 17:42:40 -07:00
Xiang Li
91cbf47a2a etcdmain: better error msg when detected duplicate id in discovery 2015-05-11 17:34:44 -07:00
Scott Chamberlain
5203de5566 Documentation: add the R client etseed to libraries-and-tools.md
etseed is an R client for etcd.
2015-05-11 15:43:31 -07:00
mischief
2e8c932ab0 pkg/fileutil: add plan9 lockfile support 2015-05-11 13:24:01 -07:00
Xiang Li
e9931fb8b1 discovery: do not return error from etcd
We used to return `key not found` directly to the
user due to a bug. We fixed the bug and added a test
case in this commit.
2015-05-11 10:49:57 -07:00
Yicheng Qin
3d242695b3 Merge pull request #2775 from yichengq/proxy-doc
docs: proxy needs accessible advertise client urls
2015-05-10 10:18:40 -07:00
Xiang Li
42783c1faa Merge pull request #2805 from MSamman/more_version_info
version: added more version information
2015-05-08 20:28:10 -07:00
Mohammad Samman
3914defd8a version: added more version information
added more version information output to aid debugging
print etcd Version, Git SHA, Go runtime version, OS
and architecture

Fixes #2560
2015-05-09 03:21:10 +00:00
Yicheng Qin
1abf2636b5 docs: proxy needs accessible advertise client urls
Users cannot use proxy if -advertise-client-urls is set correctly.
Especially mention this in the doc to help them bypass the wrong
settings.
2015-05-07 22:53:42 -07:00
Xiang Li
b24dd8e4e6 Merge pull request #2792 from ecnahc515/client_create_dir
client: Support creating directory through KeysAPI
2015-05-07 11:13:49 -07:00
Chance Zibolski
48e144ae2e client: Support creating directory through KeysAPI
Creating a directory is done using the Set() method and a SetOptions
struct with it's Dir field set to true.
2015-05-07 10:47:18 -07:00
Brian Waldon
eb930c3298 Merge pull request #2787 from bcwaldon/ttldur
client: add Node.TTLDuration()
2015-05-05 15:21:44 -07:00
Brian Waldon
ee9e336fd4 client: add Node.TTLDuration() 2015-05-05 15:03:24 -07:00
Barak Michener
d101568ac9 Merge pull request #2788 from barakmich/roadmap
*: Initial roadmap
2015-05-05 16:43:06 -04:00
Barak Michener
d4bd57229d *: Initial roadmap 2015-05-05 16:05:35 -04:00
Yicheng Qin
0b082b7bd4 Merge pull request #2771 from sorah/close-ongoing-conn
Fix connection leak when client disconnected
2015-04-29 20:46:13 -07:00
Shota Fukumori (sora_h)
a68efe7d1e proxy: Fix connection leak when client disconnect
established connections were leaked when client disconnected before
proxyreq completes. This happens all time for wait=true requests.
2015-04-30 11:41:42 +09:00
Yicheng Qin
0a6f481ca5 Merge pull request #2773 from yichengq/add-flag-help
tools/functional-testing: add help message for flags
2015-04-29 14:18:32 -07:00
Yicheng Qin
e71d43b58e tools/functional-testing: add help message for flags
Help users to understand what these flags are for.
2015-04-29 13:59:55 -07:00
Xiang Li
0fbf90b1e0 Merge pull request #2774 from xiang90/cluster
etcdserver: rename StoreAdminPrefix to StoreClusterPrefix
2015-04-29 12:20:04 -07:00
Xiang Li
94ffd72c7e etcdserver: rename StoreAdminPrefix to StoreClusterPrefix
We store cluster related key in StoreAdminPrefix for some
historical reason. The previous API is called admin. But now,
the admin name is gone and `cluster` is a more clear and correct
name.
2015-04-29 12:05:51 -07:00
Xiang Li
a4e35f4650 Merge pull request #2718 from xiang90/version
support cluster-wide version sync
2015-04-29 11:45:21 -07:00
Xiang Li
6699107f61 *: add cluster version and cluster version detection.
Cluster version is the min major.minor of all members in
the etcd cluster. Cluster version is set to the min version
that a etcd member is compatible with when first bootstrapp.

During a rolling upgrades, the cluster version will be updated
automatically.

For example:

```
Cluster [a:1, b:1 ,c:1] -> clusterVersion 1

update a -> 2, b -> 2

after a detection

Cluster [a:2, b:2 ,c:1] -> clusterVersion 1, since c is still 1

update c -> 2

after a detection

Cluster [a:2, b:2 ,c:2] -> clusterVersion 2
```

The API/raft component can utilize clusterVersion to determine if
it can accept a client request or a raft RPC.

We choose polling rather than pushing since we want to use the same
logic for cluster version detection and (TODO) cluster version checking.

Before a member actually joins a etcd cluster, it should check the version
of the cluster. Push does not work since the other members cannot push
version info to it before it actually joins. Moreover, we do not want our
raft RPC system (which is doing the heartbeat pushing) to coordinate cluster version.
2015-04-29 11:31:59 -07:00
Yicheng Qin
33febb979c Merge pull request #2761 from yichengq/344
etcdmain: advertise-client-urls must be set if listen-client-urls is set
2015-04-29 10:27:10 -07:00
Yicheng Qin
3f90394fbb etcdmain: advertise-client-urls must be set if listen-client-urls is set
Before this PR, people can set listen-client-urls without setting
advertise-client-urls, and leaves advertise-client-urls as default
localhost value. The client libraries which sync the cluster info
fetch wrong advertise-client-urls and cannot connect to the cluster.
This PR avoids this case and provides better UX.

On the other hand, this change is safe because people always want to set
advertise-client-urls if listen-client-urls is set. The default localhost
advertise url cannot be accessed from the outside, and should always be
set except that etcd is bootstrapped with no flag.
2015-04-29 09:52:15 -07:00