Xiang Li
6b23a8131f
*: test gofmt with -s and fix reported issues
2015-08-21 18:52:16 -07:00
Yicheng Qin
8c0610d4f5
Merge pull request #3352 from yichengq/fix-name-url
...
fix that etcd fails to start if using both IP and hostname when discovery srv
2015-08-21 12:38:38 -07:00
Yicheng Qin
72462a72fb
etcdserver: remove TODO to delete URLStringsEqual
...
Discovery SRV supports to compare IP addresses with domain names,
so we need URLStringsEqual function.
2015-08-21 09:52:17 -07:00
Yicheng Qin
8ea3d157c5
Revert "Revert "Treat URLs have same IP address as same""
...
This reverts commit 3153e635d5799f1ff8715fd4b7c07e0283820acd.
Conflicts:
etcdserver/config.go
2015-08-21 09:41:13 -07:00
Xiang Li
11a689d063
etcdserver/auth: cache auth enable result
2015-08-20 23:05:00 -07:00
Yicheng Qin
bcb4d5d53e
Merge pull request #3311 from yichengq/request-timeout
...
extend hardcoded timeout for globally-deployed etcd cluster
2015-08-17 17:00:24 -07:00
Yicheng Qin
1375ef8985
etcdserver: remove getVersion timeout
...
The request can still time out because we have set dial timeout and
read/write timeout. It increases timeout expectation from 1s to 5s,
but it makes it workable in globally-deployer cluster.
2015-08-17 16:50:40 -07:00
Xiang Li
d487cf6b63
etcdhttp:write etcderror for all errors in keyhandler
2015-08-17 15:51:29 -07:00
Yicheng Qin
c530385d6d
Merge pull request #3313 from yichengq/internal-timeout
...
etcdserver: use ReqTimeout only
2015-08-17 15:05:46 -07:00
Xiang Li
af6d1d3d95
Merge pull request #3310 from xiang90/http_err
...
*: key handler should write auth error as etcd error
2015-08-17 14:57:19 -07:00
Yicheng Qin
2d5b95c49f
etcdserver: use ReqTimeout only
...
We cannot refer RTT value from heartbeat interval, so CommitTimeout
is invalid. Remove it and use ReqTimeout instead.
2015-08-17 14:54:25 -07:00
Xiang Li
87f061bab2
*: key handler should write auth error as etcd error
2015-08-17 14:45:45 -07:00
Xiang Li
15e03d801f
etcdserver: add version enforcement when setting cluster version
2015-08-17 11:12:39 -07:00
Xiang Li
f199a484af
*: only print out major.minor version for cluster version
2015-08-15 08:30:06 -07:00
Xiang Li
bbcb38189c
Merge pull request #3302 from xiang90/v
...
etcdserver: better version detection log output
2015-08-14 16:14:55 -07:00
Xiang Li
0076ab154b
etcdserver: better version detection log output
...
Fix https://github.com/coreos/etcd/issues/3288
2015-08-14 16:08:33 -07:00
Xiang Li
dd56b7e05e
Merge pull request #3299 from xiang90/txn
...
initial support for txn
2015-08-14 16:05:16 -07:00
Xiang Li
9233fff48f
etcdserver: support txn
2015-08-14 11:45:31 -07:00
Xiang Li
46865fa5a5
etcdserverpb: update proto
2015-08-14 11:45:07 -07:00
Yicheng Qin
c229e6e655
etcdserver: improve error message when timeout due to leader fail
2015-08-13 15:46:21 -07:00
Yicheng Qin
ceb27b1c48
etcdhttp: add auth capability in 2.2
2015-08-13 14:49:10 -07:00
Yicheng Qin
0fdb77aea2
etcdserver: go back to marshal request in 2.1 way
...
It fixes the problem that 2.1 cannot roll upgrade to 2.2 smoothly
because 2.1 cannot understand the bytes marshalled at 2.2.
2015-08-13 13:41:52 -07:00
Yicheng Qin
27170e67b9
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
```
2015-08-12 16:53:18 -07:00
Yicheng Qin
c3d4d11402
etcdhttp: adjust request timeout based on config
...
It uses heartbeat interval and election timeout to estimate the
expected request timeout.
This PR helps etcd survive under high roundtrip-time environment,
e.g., globally-deployed cluster.
2015-08-12 09:22:59 -07:00
Yicheng Qin
5a91937367
etcdserver: adjust commit timeout based on config
...
It uses heartbeat interval and election timeout to estimate the
commit timeout for internal requests.
This PR helps etcd survive under high roundtrip-time environment,
e.g., globally-deployed cluster.
2015-08-11 21:09:03 -07:00
Xiang Li
a718329ad3
Merge pull request #3248 from xiang90/v3
...
initial v3 demo
2015-08-10 13:59:03 -07:00
Brandon Philips
fb1951204c
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-08 18:11:41 -07:00
Xiang Li
9ff7075ce8
etcdserver: use v3server interface
2015-08-08 10:39:04 -07:00
Xiang Li
f004b4dac7
*: etcdserver supports v3 demo
2015-08-08 05:58:29 -07:00
Xiang Li
82afadbcc6
etcdserverpb: update proto
2015-08-08 05:31:35 -07:00
Xiang Li
845c51fedd
*: fix typos vaild->valid
2015-08-07 10:57:11 -07:00
Yicheng Qin
f03f048232
Merge pull request #3184 from yichengq/fast-bootstrap
...
etcdserver: tick ElectionTicks before starting when bootstrap new cluster
2015-08-06 15:54:40 -07:00
Yicheng Qin
21f5b885f2
etcdserver: fast election timeout when bootstrap cluster
...
The behavior accelarates the happen of the first-time leader election,
so the cluster could elect its leader fast. Technically, it could
help to reduce `electionMs - heartbeatMs` wait time for the first leader election.
Main usage:
1. Quick start for the local cluster when setting a little longer
election timeout
2. Quick start for the global cluster, which sets election timeout to
its maximum 50s.
2015-08-06 15:44:26 -07:00
Yicheng Qin
a637e86372
Merge pull request #3220 from yichengq/fix-auth-check
...
etcdhttp: fix access check for multiple roles in auth
2015-08-06 15:09:04 -07:00
Xiang Li
58503817ec
etcdserver: internal request union
2015-08-05 07:47:10 -07:00
Yicheng Qin
18169e896c
etcdhttp: fix access check for multiple roles in auth
...
Check access for multiple roles should go through all roles.
2015-08-04 14:31:07 -07:00
Xiang Li
2b8abeb093
*: remove migration related stuff from 2.2
2015-08-01 19:37:20 +08:00
Barak Michener
dd1a8fe330
etcdhttp: Improve test coverage surrounding auth
2015-07-30 14:21:08 -04:00
Xiang Li
80b794dccc
Merge pull request #3185 from xiang90/add_debug_endpoint
...
etcdhttp: add config/local/debug endpoint
2015-07-30 08:46:07 +08:00
Xiang Li
4e31df2c2b
etcdhttp: add config/local/log endpoint
...
PUT on the endpoint sets the GlobalDebugLevel to json level value.
The action overwrites the origianl log level setting from
users. We need to write doc to warn this.
2015-07-30 08:35:01 +08:00
Yicheng Qin
6fc9dbfe56
Merge pull request #3114 from yichengq/clean-raft-init
...
etcdserver: clean up start and stop logic of raft
2015-07-27 14:19:25 -07:00
Yicheng Qin
7696dd3280
etcdserver: clean up start and stop logic of raft
...
kill TODO and make it more readable.
2015-07-27 13:24:26 -07:00
Xiang Li
53a77fa519
*: tnx -> txn
2015-07-24 23:21:09 +08:00
Yicheng Qin
b7892b20c1
etcdserver: rename defaultPublishRetryInterval -> defaultPublishTimeout
...
This makes code more readable and reasonable.
2015-07-23 10:09:28 -07:00
Yicheng Qin
5be545b872
Merge pull request #3077 from yichengq/fix-test-sync
...
etcdserver: init raft internal var early
2015-07-10 14:44:52 -07:00
Xiang Li
2fb8347d36
etcdserver: add rpc proto
2015-06-29 20:00:09 -07:00
Xiang Li
581ef05bab
*: resolve proto warnings
2015-06-29 18:39:46 -07:00
Xiang Li
13f44e4b79
*: update generated proto code
2015-06-29 16:45:25 -07:00
Yicheng Qin
7f95780bfb
etcdserver: init raft internal var early
...
Its `stopped`/`done` should be created always before being used
in defer in server loop.
It fixes the race detected when running TestSyncTrigger.
2015-06-29 15:34:15 -07:00
Yicheng Qin
2e41b4f9e1
etcdserver/auth: fix return value when creating root user
...
Before:
```
$ curl http://127.0.0.1:4001/v2/auth/users/root -XPUT -d '{"user": "root",
"password": "root"}'
{"user":"root","roles":null}
```
After:
```
{"user":"root","roles":["root"]}
```
2015-06-27 23:16:54 -07:00