5456 Commits

Author SHA1 Message Date
Yicheng Qin
151c18d650 *: bump to v2.1.2+git 2015-08-21 16:20:16 -07:00
Yicheng Qin
ff8d1ecb9f *: bump to v2.1.2 v2.1.2 2015-08-21 16:19:55 -07:00
Yicheng Qin
ccb67a691b pkg/netutil: stop resolving in place
It helps to copy out a and b, and not modify the original a and b.
2015-08-21 15:39:57 -07:00
Yicheng Qin
059233768e pkg/netutil: not introduce empty url when converting
It should not make slices with length and append elements at the same
time.
2015-08-21 15:39:48 -07:00
Yicheng Qin
c530acf6a4 pkg/netutil: not export resolve and urlsEqual functions
They are only used in this package, so there is no need to public them.
2015-08-21 15:39:38 -07:00
Yicheng Qin
bad1b20620 pkg/netutil: fix false negative comparison
Sort the resolved URLs before DeepEqual, so it will not compare URLs
that may be out of order due to resolution.
2015-08-21 15:39:29 -07:00
Yicheng Qin
89640cf08f etcdserver: remove TODO to delete URLStringsEqual
Discovery SRV supports to compare IP addresses with domain names,
so we need URLStringsEqual function.
2015-08-21 15:39:19 -07:00
Yicheng Qin
bbefb0ad0b Revert "Revert "Treat URLs have same IP address as same""
This reverts commit 3153e635d5799f1ff8715fd4b7c07e0283820acd.

Conflicts:
	etcdserver/config.go
2015-08-21 15:39:10 -07:00
Xiang Li
8e0706583c etcdmain: print out version information on startup
Conflicts:
	etcdmain/etcd.go
2015-08-21 15:38:34 -07:00
Yicheng Qin
cd2a2182cf etcdctl/cluster_health: set health var when checked healthy
This was a typo.
2015-08-21 15:37:26 -07:00
Xiang Li
8d410bdfcb etcdctl: use health endpoint to greatly simplify health checking 2015-08-21 15:22:19 -07:00
Xiang Li
0a2d2b8b9d etcdctl: cluster-health supports forever flag
cluster-health command supports checking the cluster health
forever.
2015-08-21 15:22:13 -07:00
Yicheng Qin
6c9e876d7a etcdctl: refactor the way to check cluster health
This method uses raft status exposed at /debug/varz to determine the
health of the cluster. It uses whether commit index increases to
determine the cluster health, and uses whether match index increases to
determine the member health.

This could fix the bug #2711 that fails to detect follower is unhealthy
because it doesn't rely on whether message in long-polling connection is sent.

This health check is stricter than the old one, and reflects the
situation that whether followers are healthy in the view of the leader. One
example is that if the follower is receiving the snapshot, it will turns
out to be unhealthy because it doesn't move forward.

`etcdctl cluster-health` will reflect the healthy view in the raft level,
while connectivity checks reflects the healthy view in transport level.
2015-08-21 15:22:05 -07:00
Xiang Li
a845f82d4f etcdctl: health use etcd/client
Conflicts:
	etcdctl/command/cluster_health.go
2015-08-21 15:21:44 -07:00
Xiang Li
c1c23626cb raft: downgrade the logging around snapshot to debugf
Snapshot related logging is spamming when leader trying to
sync a failed peer.

Conflicts:
	raft/raft.go
2015-08-21 15:11:47 -07:00
Xiang Li
ac67aa9f63 etcdhttp:write etcderror for all errors in keyhandler 2015-08-21 15:10:01 -07:00
Xiang Li
52c5203370 *: key handler should write auth error as etcd error 2015-08-21 15:09:53 -07:00
Yicheng Qin
27bfb3fcb2 etcdserver: improve error message when timeout due to leader fail 2015-08-21 15:09:46 -07:00
Yicheng Qin
084936a920 etcdserver: specify timeout caused by leader election
Before this PR, the timeout caused by leader election returns:

```
14:45:37 etcd2 | 2015-08-12 14:45:37.786349 E | etcdhttp: got unexpected
response error (etcdserver: request timed out)
```

After this PR:

```
15:52:54 etcd1 | 2015-08-12 15:52:54.389523 E | etcdhttp: etcdserver:
request timed out, possibly due to leader down
```

Conflicts:
	etcdserver/raft.go
2015-08-21 15:09:32 -07:00
Brandon Philips
d2ecd9cecf test: race detector doesn't work on armv7l
Test fails without this fix on armv7l:

    go test: -race is only supported on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64
2015-08-21 14:59:07 -07:00
Brandon Philips
07b82832f0 etcdserver: move atomics to make etcd work on arm64
Follow the simple rule in the atomic package:

"On both ARM and x86-32, it is the caller's responsibility to arrange
for 64-bit alignment of 64-bit words accessed atomically. The first word
in a global variable or in an allocated struct or slice can be relied
upon to be 64-bit aligned."

Tested on a system with /proc/cpuinfo reporting:

processor       : 0
model name      : ARMv7 Processor rev 1 (v7l)
Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3
tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc0d
CPU revision    : 1
2015-08-21 14:58:59 -07:00
Yicheng Qin
61f4e74652 etcdmain: reject unreasonably high values of -election-timeout
This helps users to detect setting problem early.
2015-08-21 14:58:49 -07:00
Yicheng Qin
331ecdf8c8 client: return correct error for 50x response
etcd always returns 500/503 response when it may have no leader.
So we should log the other 50x response in a normal way.

This helps to log correctly when discovery meets 504 error. Before this
PR, it logs like this:

```
18:31:58 etcd2 | 2015/08/4 18:31:58 discovery: error #0: client: etcd
member https://discovery.etcd.io has no leader
18:31:58 etcd2 | 2015/08/4 18:31:58 discovery: waiting for other nodes:
error connecting to https://discovery.etcd.io, retrying in 4s
```

After this PR:

```
22:20:25 etcd2 | 2015/08/4 22:20:25 discovery: error #0: client: etcd
member https://discovery.etcd.io returns server error [Gateway Timeout]
22:20:25 etcd2 | 2015/08/4 22:20:25 discovery: waiting for other nodes:
error connecting to https://discovery.etcd.io, retrying in 4s
```

Conflicts:
	client/client.go
2015-08-21 14:55:35 -07:00
Xiang Li
3a346eac25 discovery: print out detailed cluster error
Conflicts:
	discovery/discovery.go
2015-08-21 14:54:36 -07:00
Xiang Li
97605046c1 client: return cluster error if the etcd cluster is not avaliable
Add a new ClusterError type. It contians all encountered errors and
return ClusterNotAvailable as the error string.

Conflicts:
	client/client.go
	discovery/discovery.go
2015-08-21 14:51:41 -07:00
Guohua Ouyang
41ecf7f722 etcdmain: Don't print flags when flag parse error
At present it prints the whole usage and flags, which cause the exact
error message is hidden two screens above.

Fixes #3141

Signed-off-by: Guohua Ouyang <gouyang@redhat.com>
2015-08-21 14:32:49 -07:00
Xiang Li
fcd564efb8 etcdmian: fix initialization confilct
Fix #3142

Ignore flags if etcd is already initialized.
2015-08-21 14:32:41 -07:00
Yicheng Qin
0876c5e1ef etcdmain: warn when listening on HTTP if TLS is set
If the user sets TLS info, this implies that he wants to listen on TLS.
If etcd finds that urls to listen is still HTTP schema, it prints out
warning to notify user about possible wrong setting.
2015-08-21 14:32:31 -07:00
Yicheng Qin
ef80bb5cbf pkg/transport: fix HTTPS downgrade bug for keepalive listener
If TLS config is empty, etcd downgrades keepalive listener from HTTPS to
HTTP without warning. This results in HTTPS downgrade bug for client urls.
The commit returns error if it cannot listen on TLS.
2015-08-21 14:32:18 -07:00
Yicheng Qin
147b14cfc0 *: bump to v2.1.1+git 2015-07-21 10:43:49 -07:00
Yicheng Qin
6335fdc595 *: bump to v2.1.1 v2.1.1 2015-07-21 10:41:26 -07:00
Yicheng Qin
ca540b23dc Merge pull request #3158 from yichengq/exp-auth
docs: add experimental notice on auth doc
v2.1.0
2015-07-21 10:24:11 -07:00
Yicheng Qin
097ec0f25b docs: add experimental notice on auth doc
Reasons for the notice:
1. No users have reported about their feedback about auth feature so
far.
2. We haven't used it internally.
3. This is the first release that includes auth feature, so it is good
to be more cautious.
2015-07-21 10:23:23 -07:00
Xiang Li
ed444419c0 Merge pull request #3160 from ryandoyle/docs-nss-etcd
docs: glibc NSS module for resolving names in etcd
2015-07-21 08:53:08 +08:00
Ryan Doyle
d373645b8c docs: glibc NSS module for resolving names in etcd 2015-07-21 10:33:23 +10:00
Yicheng Qin
d86e94b824 Merge pull request #3128 from yichengq/doc-watch-api
docs: update watch API doc for clarity
2015-07-20 14:54:26 -07:00
Yicheng Qin
d52cb2e5d9 docs: add watch command and correct the example 2015-07-20 14:49:01 -07:00
Xiang Li
40681bdf03 Merge pull request #3146 from a-robinson/snap
snap: Record the snapshot save duration on success rather than only on error
2015-07-17 06:03:33 +08:00
Yicheng Qin
7d38115cb2 Merge pull request #3148 from yichengq/update-contact
Update contact section in README.md
2015-07-16 15:01:54 -07:00
Barak Michener
f8baa4ebe0 Merge pull request #3138 from barakmich/auth_doc
documentation: Add authentication walkthrough with etcdctl. Fixes #2949
2015-07-16 16:41:15 -04:00
Yicheng Qin
9b962c8350 README: let roadmap point to ROADMAP.md 2015-07-16 12:58:13 -07:00
Yicheng Qin
c1aed32920 README: update irc channel to #etcd 2015-07-16 12:52:26 -07:00
Alex Robinson
57a5520157 snap: Record the snapshot save duration on success rather than only on error.
It makes more sense to record the latency of successes (or all attempts)
than of only a particular failure case.
2015-07-16 10:46:47 -07:00
Barak Michener
452a327334 documentation: Add authentication walkthrough with etcdctl. Fixes #2949 2015-07-15 15:54:26 -04:00
Yicheng Qin
ebbb0caff0 Merge pull request #3136 from yichengq/fix-proxy-doc
docs: fix wrong proxy command
2015-07-15 11:30:07 -07:00
Yicheng Qin
d0e976ad4b docs: fix wrong proxy command 2015-07-15 08:37:10 -07:00
Xiang Li
d0e3e2c992 Merge pull request #3131 from yichengq/remove-header-timeout
discovery: remove ResponseHeaderTimeout when discovery
2015-07-15 07:50:36 +08:00
Yicheng Qin
1db176151b discovery: remove ResponseHeaderTimeout when discovery
The discovery service doesn't return HTTP header early when watch
starts. This may trigger ResponseHeaderTimeout and cause the watch
request failed.

The fix on discovery service may take some time. Remove the
ResponseHeaderTimeout first so it behaves as before.
2015-07-14 16:33:28 -07:00
Michael Schurter
f52db1c08e docs: add back original example w/index=prevIndex 2015-07-13 23:04:39 -07:00
Michael Schurter
b94f6595e6 docs: rewrite existing docs instead of adding a new section
@xiang90 pointed out my earlier commit duplicated a lot of things that
were mentioned earlier in the doc.

This time around I tried just making some gotchas more explicit in the
existing docs instead of just tacking new stuff onto the end.
2015-07-13 23:03:59 -07:00