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
Barak Michener
acca9cc3a9
Merge pull request #3047 from barakmich/auth_cov
...
auth: improve test coverage
2015-06-25 14:47:22 -04:00
Barak Michener
39c10d1fe4
auth: improve test coverage
2015-06-25 14:25:08 -04:00
Yicheng Qin
5d131acfba
etcdserver: fix TestTriggerSnap
...
Before checking, it needs to wait for snapshot goroutine to finish its
work.
2015-06-25 09:58:36 -07:00
Xiang Li
52c2a5731f
etcdserver: fix typo in metrics.go
2015-06-24 12:42:40 -07:00
Xiang Li
030d1bbf2d
auth: do not allow update root role
2015-06-23 20:15:08 -07:00
Xiang Li
e291dfd748
etcdhttp: improve user endpoint validation
...
Giving both roles and grant/revoke is not allowed.
Creating an existing user is not allowed.
Updating a non-existing user is not allowed.
2015-06-23 14:38:44 -07:00
Xiang Li
c8628c8fe5
auth: separate the role create and update path
...
Giving both permission and grant/revoke is not allowed.
Creating an existing role is not allowed.
Updating a non-existing is not allowed.
2015-06-23 13:15:32 -07:00
Xiang Li
bc61056912
etcdhttp: use correct http status const when writing http error
2015-06-23 12:40:30 -07:00
Xiang Li
4f47a6ebfb
Merge pull request #3032 from xiang90/refactor_update_role
...
auth: refactor updateRole
2015-06-23 11:17:45 -07:00
Barak Michener
d5a0e3ac6a
etcdhttp: Always strip password hash when returning users
2015-06-22 18:39:16 -04:00
Xiang Li
979f531261
auth: refactor updateRole
...
We will return error if revoke or grant fails to update the role.
No need to check if revoke or grant is nil or not.
2015-06-22 15:16:10 -07:00
Xiang Li
3f82e7b116
auth: do not allow to grant duplicate role or revoke ungranted role to a user
2015-06-22 15:11:09 -07:00