Compare commits

...

6122 Commits

Author SHA1 Message Date
ac1c7eba21 version: bump up to 3.1.1 2017-02-16 13:53:25 -08:00
9cc6d4852a travis: update for Go 1.7.5 tests 2017-02-16 13:53:05 -08:00
ff7fa9843d clientv3: fix lease keepalive duration 2017-02-16 13:52:27 -08:00
f66138d403 clientv3: fix lease keepalive duration 2017-02-16 12:41:09 -08:00
8c87916f68 auth: add 'setupAuthStore' to tests 2017-02-14 14:39:51 -08:00
9e81b002c4 auth: correct initialization in NewAuthStore()
Because of my own silly mistake, current NewAuthStore() doesn't
initialize authStore in a correct manner. For example, after recovery
from snapshot, it cannot revive the flag of enabled/disabled. This
commit fixes the problem.

Fix https://github.com/coreos/etcd/issues/7165
2017-02-14 13:49:19 -08:00
4962c5cff7 auth: add a test case for recoverying from snapshot
Conflicts:
	auth/store_test.go
2017-02-14 13:48:17 -08:00
e5bf25a3b6 e2e: add cases for defrag and snapshot with authentication 2017-02-14 13:43:11 -08:00
98c60e8faa auth, etcdserver: let maintenance services require root role
This commit lets maintenance services require root privilege. It also
moves AuthInfoFromCtx() from etcdserver to auth pkg for cleaning purpose.
2017-02-14 13:42:31 -08:00
3ac3fa6f3d travis: disable email notifications
Was spamming security@coreos.com
2017-02-14 12:55:02 -08:00
eaa8b9e155 clientv3: test closing client cancels blocking dials 2017-02-14 11:31:51 -08:00
ea2aae464d clientv3: use DialContext
Fixes #7216
2017-02-14 11:31:43 -08:00
776739ebc2 roadmap: update roadmap 2017-01-20 14:21:08 -08:00
a7a8a47ba0 README: remove ACI, update Go version 2017-01-20 14:21:00 -08:00
379f7ae10e op-guide: change grpc-proxy from 'pre' to alpha' 2017-01-20 13:25:21 -08:00
ead2d95914 version: bump to v3.1.0+git 2017-01-20 13:25:04 -08:00
8ba2897a21 version: bump to v3.1.0 2017-01-20 12:42:12 -08:00
bc31e27cb9 documentation: update build documentation 2017-01-20 11:20:54 -08:00
fce20a0b0b test: passed the test script arguments as the test function parameters 2017-01-20 11:15:01 -08:00
f10363fecd etcdctlv3: snapshot restore works with lease key 2017-01-20 10:06:49 -08:00
a7ec6c88fd pkg/flags: fixed prefix checking of the env variables 2017-01-20 09:57:00 -08:00
62c591d223 integration: test STM apply on concurrent deletion 2017-01-20 09:56:42 -08:00
5676226867 clientv3/concurrency: fix rev comparison on concurrent key deletion 2017-01-20 09:56:36 -08:00
898b9e608f Documentation: fix typo s/endpoint-health/endpoint health/ 2017-01-19 20:48:01 -08:00
b84be6b11b NEWS: fix date for v3.1 release 2017-01-19 17:56:35 -08:00
7a12d65528 Documentation: update experimental_apis for v3.1 release 2017-01-19 12:43:32 -08:00
53ac04b118 vendor: update 'golang.org/x/net' 2017-01-18 13:11:48 -08:00
fbcd5375b3 glide: update 'golang.org/x/net' 2017-01-18 13:11:13 -08:00
c2e8d06eec grpcproxy, etcdmain, integration: add close channel to kv proxy
ccache launches goroutines that need to be explicitly stopped.

Fixes #7158
2017-01-18 13:11:03 -08:00
6c8f1986c8 etcdserver: use ReqTimeout for linearized read
Fixes #7136
2017-01-17 17:31:31 -08:00
be9ae300c6 pkg/report: add nil checking for getTimeSeries 2017-01-17 13:23:57 -08:00
9ba3632614 Documentation: document upgrading to v3.1 2017-01-17 13:23:19 -08:00
c2d8b5a9e8 ctlv3: print cluster info after adding new member 2017-01-17 10:23:02 -08:00
0c88795a19 Merge pull request #7151 from gyuho/travis
travis: use Go 1.7.4, drop old env var
2017-01-13 12:55:32 -08:00
21e3418553 travis: use Go 1.7.4, drop old env var
We don't use Go 1.5.x anymore
2017-01-13 11:34:05 -08:00
bb797c1ee9 Merge pull request #7147 from gyuho/pkg/report
pkg/report: add 'Stats' to expose report raw data
2017-01-13 11:17:57 -08:00
304606ab0b Merge pull request #7139 from heyitsanthony/proxy-rlock
grpcproxy/cache: acquire read lock on Get instead of write lock
2017-01-13 11:15:13 -08:00
74bad576ed pkg/report: add 'Stats' to expose report raw data 2017-01-13 10:26:00 -08:00
7dfe503f1c Merge pull request #7148 from heyitsanthony/fix-lease-overlap
clientv3: don't reset stream on keepaliveonce or revoke failure
2017-01-13 10:05:02 -08:00
af51f87ad2 vendor: remove groupcache, add ccache 2017-01-13 10:02:04 -08:00
9fa6c95054 grpcproxy: use ccache for key cache
groupcache needs a write lock and has no way to expire keys; ccache can
do this, though.

Also removes the key count metric, since there's no way to efficiently
calculate it using ccache.
2017-01-13 10:00:57 -08:00
5e3b20e70c clientv3: don't reset stream on keepaliveonce or revoke failure
Would cause the keepalive loop to cancel out.

Fixes #7082
2017-01-13 09:05:23 -08:00
c89eae790d Merge pull request #7110 from mitake/reauth
etcdserver, clientv3: handle a case of expired auth token
2017-01-13 11:57:25 +09:00
432bda4dec Merge pull request #7146 from fanminshi/clientv3_balancer_uses_one_connection
clientv3: fix balancer test logic
2017-01-12 13:51:03 -08:00
6d443ba3f9 clienv3: fix balancer test logic 2017-01-12 13:07:44 -08:00
6ce03389c8 Merge pull request #7138 from gyuho/NEWS
NEWS: add v3.1.0, v3.0.16 + minor fixes
2017-01-12 11:33:13 -08:00
34136a69c8 Merge pull request #7145 from heyitsanthony/warn-ca-ignore
transport: warn on user-provided CA
2017-01-12 11:14:28 -08:00
c23d666328 NEWS: add v3.1.0, v3.0.16 + minor fixes 2017-01-12 11:07:27 -08:00
da8fd18d8e transport: warn on user-provided CA
ServerName is ignored for a user-provided CA for backwards compatibility. This
breaks PKI, so warn it is deprecated.
2017-01-12 09:10:05 -08:00
824277cb3a Merge pull request #7119 from sinsharat/add_load_test_tool
tools: Add etcd 3.0 load test tool refernece
2017-01-11 22:17:57 -08:00
c512839382 tools: Add etcd 3.0 load test tool refernece 2017-01-12 11:35:32 +05:30
d431b64d97 etcdserver, clientv3: handle a case of expired auth token
This commit adds a mechanism of handling a case of expired auth token
to clientv3. If a server returns an error code
grpc.codes.Unauthenticated, newRetryWrapper() tries to get a new token
and use it as an option of PerRPCCredential.

Fixes https://github.com/coreos/etcd/issues/7012
2017-01-12 11:49:02 +09:00
0df543dbb3 Merge pull request #7141 from heyitsanthony/rate-limit-range
benchmark: option to rate limit range benchmark
2017-01-11 15:44:33 -08:00
6e730af65a benchmark: option to rate limit range benchmark 2017-01-11 14:36:46 -08:00
43dd751c47 Merge pull request #7137 from heyitsanthony/display-docs
documentation: display docs.md in github browser
2017-01-11 11:29:29 -08:00
6f801d2ae8 documentation: display docs.md in github browser 2017-01-11 10:37:42 -08:00
925d1d74ce Merge pull request #7133 from gyuho/bench
pkg/report: support 99.9-percentile, change column name
2017-01-10 18:25:03 -08:00
e44d3abc77 pkg/report: support 99.9-percentile, change column name 2017-01-10 18:22:47 -08:00
88bdd8a5d9 Merge pull request #7120 from sttts/sttts-update-ugorji-2
Update ugorji/go with embedded interface support
2017-01-10 13:11:56 -08:00
f0fa5ec507 Merge pull request #7128 from heyitsanthony/etcdctl-make-rootrole
etcdctl: create root role on auth enable if it does not yet exist
2017-01-10 12:22:02 -08:00
b32a8010a7 Merge pull request #7121 from hhkbp2/add-test-case
raft: add RawNode test case for #6866
2017-01-09 23:37:23 -08:00
522232212d Merge pull request #7127 from heyitsanthony/fix-auth-spin
auth: reject empty user name when checking op permissions
2017-01-09 19:11:18 -08:00
16135165c2 raft: add RawNode test case for #6866 2017-01-10 10:55:57 +08:00
d20f23c795 etcdctl: create root role on auth enable if it does not yet exist
Kind of tedious to add the root role when enabling auth; can just add
it automatically.
2017-01-09 16:18:13 -08:00
c39a59c0be auth: reject empty user name when checking op permissions
Passing AuthInfo{} to permission checking was causing an infinite loop
because it would always return an old revision error.

Fixes #7124
2017-01-09 15:53:36 -08:00
5278ea5ed0 integration: add grpc auth testing 2017-01-09 15:53:36 -08:00
8adfc06084 Merge pull request #7118 from hhkbp2/fix-test-case
raft: fix test cases for #7042
2017-01-09 10:34:46 -08:00
4a245a632a vendor: update ugorji/go 2017-01-09 12:13:50 +01:00
7bb768ba34 raft: fix test case for #7042 2017-01-09 16:52:02 +08:00
f99c76cb47 Merge pull request #7113 from heyitsanthony/testutil-bufsize
testutil: increase size of buffer for stack dump
2017-01-06 18:16:42 -08:00
6ab8dcb679 testutil: increase size of buffer for stack dump
Too many goroutines to fit all stack traces in 8kb.
2017-01-06 17:14:42 -08:00
bc2d47118d Merge pull request #7016 from fanminshi/faq_add_meaning_of_etcd
why: add origin of the term etcd
2017-01-06 16:13:34 -06:00
953b0c6ba2 why: add origin of the term etcd
explain the meaning behind the term etcd.
2017-01-06 16:12:20 -06:00
628e83ecc7 Merge pull request #7106 from gyuho/go1.8
integration: use only digits in unix ports
2017-01-06 13:04:35 -08:00
998f8bf291 Merge pull request #7112 from heyitsanthony/expect-debug
expect: EXPECT_DEBUG environment variable
2017-01-06 11:52:26 -08:00
af5b8190d2 Merge pull request #7111 from heyitsanthony/e2e-ctl-trace
e2e: dump stacks on ctlTest timeout
2017-01-06 11:28:56 -08:00
cf382dbe60 expect: EXPECT_DEBUG environment variable
Dump process output to stdout when EXPECT_DEBUG != "".
2017-01-06 11:09:06 -08:00
acfa601075 e2e: dump stack on ctlTest timeout
Figure out which process is blocking for Elect/Lock test timeouts.
2017-01-06 02:03:55 -08:00
6825ffe1a4 integration: use only digits in unix ports
Fix https://github.com/coreos/etcd/issues/6959.
2017-01-05 12:34:54 -08:00
a42b399f4e Merge pull request #7094 from heyitsanthony/fix-duplicate-grant
auth: use quorum get for GetUser/GetRole for mutable operations
2017-01-05 11:28:33 -08:00
5feb4e1027 Merge pull request #7103 from heyitsanthony/proxy-watch-close
grpcproxy: tear down watch when client context is done
2017-01-04 19:04:08 -08:00
fd72ecfe92 Merge pull request #7087 from sinsharat/make_etcd-runner_command_compliant
etcd-runner: make command compliant
2017-01-04 16:33:19 -08:00
e179225f28 grpcproxy: tear down watch when client context is done
If client closes but all watch streams are not canceled, the outstanding
watch will wait until it is canceled, causing watch server to potentially
wait forever to close.

Fixes #7102
2017-01-04 16:23:27 -08:00
154f268031 Merge pull request #7001 from heyitsanthony/etcdctl-doc
etcdctl: tighten up output, reorganize README.md
2017-01-04 13:44:49 -08:00
10d3b81c39 Merge pull request #7093 from gyuho/member
etcdserver: expose ErrMemberNotEnoughStarted
2017-01-04 12:09:29 -08:00
f9f691ef1f auth: use quorum get for GetUser/GetRole for mutable operations
GetUser would not propagate to the minority node, causing TestCtlV2GetRoleUser to
run CreateUser instead of UpdateUser. Instead, use quorum get to fetch the
current state of auth.

Fixes #7069
2017-01-04 11:55:07 -08:00
729dcd51ce Merge pull request #7090 from vimalk78/fix-comactor-resume-leadr-change#7040
etcdserver: resume compactor only if leader
2017-01-04 10:47:44 -08:00
559a82f66e Merge pull request #7097 from heyitsanthony/benchmark-verbose
benchmark: enable grpc error logging on stderr
2017-01-04 10:32:07 -08:00
40ae83beab Merge pull request #7099 from overvenus/patch-1
docs: fix recovery example in recovery.md
2017-01-04 10:16:48 -08:00
37501e2a5d Merge pull request #7092 from xiang90/fix_raft
raft: use status to test node stop
2017-01-04 09:13:11 -08:00
7aeddf6cd7 docs: fix recovery example in recovery.md 2017-01-04 19:41:15 +08:00
d0f301adb7 etcd-runner:add flags in watcher for hardcoded values 2017-01-04 15:17:53 +05:30
b8444d4d35 benchmark: enable grpc error logging on stderr
Lets you see connection errors (e.g., if tls is misconfigured)
2017-01-04 00:26:43 -08:00
5fac6b8d15 etcdserver: resume compactor only if leader 2017-01-04 05:01:14 +05:30
2b5f9e1c6b etcdserver: expose ErrNotEnoughStartedMembers
Fix https://github.com/coreos/etcd/issues/7072.
2017-01-03 15:23:06 -08:00
fc8cd44c72 raft: use status to test node stop
n.Tick() is async. It can be racy when running with n.Stop().

n.Status() is sync and  has a feedback mechnism internally. So there wont be
any race between n.Status() and n.Stop() call.
2017-01-03 15:18:48 -08:00
61064a7be3 Merge pull request #7085 from gyuho/raft-example-snapshot
raftexample: load snapshot when opening WAL
2017-01-03 10:34:13 -08:00
5cb6dd268b etcd-runner: make command compliant 2017-01-03 14:43:58 +05:30
0af1679b61 raftexample: load snapshot when opening WAL
Fix https://github.com/coreos/etcd/issues/7056.
Previously we don't load snapshot when replaying WAL.
2016-12-30 17:28:57 -08:00
24601ca24b Merge pull request #7084 from heyitsanthony/watch-proxy-leak
integration: wait for watch proxy to finish on client close
2016-12-30 12:51:31 -08:00
75441390b6 integration: defer clus.Terminate in watch tests
Common pattern was defer cancel(), but clus.Terminate() at the end of
the test. This appears to lead to a deadlock that is only released
once the context times out, causing inflated test times.
2016-12-30 12:34:04 -08:00
9b5eb1ae5a grpcproxy, etcdmain, integration: return done channel with WatchServer
Makes it possible to synchronously close the watch server.

Fixes #7078
2016-12-30 12:09:48 -08:00
29e14dde0c Merge pull request #7081 from gyuho/timeout-rafthttp
rafthttp: bump up timeout in pipeline test
2016-12-30 10:14:12 -08:00
cbb6ede69d Merge pull request #7067 from fanminshi/rework_coverage_unit_integration
coverage: rework coverage for unit and integration tests
2016-12-30 10:13:07 -08:00
d25f9feb19 rafthttp: bump up timeout in pipeline test
Fix https://github.com/coreos/etcd/issues/6283.

The timeout is too short. It could take more than 10ms
to send when the buffer gets full after 'pipelineBufSize' of
requests.
2016-12-30 09:46:16 -08:00
74e7614759 testutil: whitelist thread created by go cover 2016-12-29 17:19:27 -08:00
d9a3472894 coverage: rework code coverage for unit and integration tests 2016-12-29 17:19:03 -08:00
0dce29ae57 Merge pull request #7077 from fanminshi/consistent_naming
etcdserver: consistent naming in raftReadyHandler
2016-12-29 14:37:46 -08:00
8242049a33 Merge pull request #7076 from fanminshi/fix_e2e_test
e2e: unset ETCDCTL_API env var before running e2e tests
2016-12-29 14:37:25 -08:00
734dd75565 Merge pull request #7075 from gyuho/version-pull
e2e: poll '/version' in release upgrade tests
2016-12-29 11:29:45 -08:00
2a1bae0c2a etcdserver: consistent naming in raftReadyHandler 2016-12-29 11:27:16 -08:00
b741452d03 e2e: unset ETCDCTL_API env var before running u2e tests
existing ETCDCTL_API env var causes e2e to fail some of its tests.  ETCDCTL_API should not be set before e2e tests start.
the tests themselves should set ETCDCTL_API properly.
2016-12-29 11:21:15 -08:00
4e1010c1b9 e2e: poll '/version' in release upgrade tests
Fix https://github.com/coreos/etcd/issues/7065.
2016-12-29 10:52:40 -08:00
67c75606db Merge pull request #7070 from heyitsanthony/fix-lease-race
lease: use atomics for accessing lease expiry
2016-12-28 16:30:08 -08:00
b5cde6b321 lease: use atomics for accessing lease expiry
Demote was racing on expiry when LeaseTimeToLive called Remaining. Replace
with intrinsics since the ordering isn't important, but torn writes are
bad.
2016-12-28 15:44:14 -08:00
1643ed5667 Merge pull request #7071 from heyitsanthony/bump-integration-timeout
test: bump grpcproxy pass timeout to 15m
2016-12-28 15:41:00 -08:00
f876ccb055 test: bump grpcproxy pass timeout to 15m
integration tests have a 15m timeout elsewhere. The lease stress tests
seem to have pushed the running time over 10m on proxy CI, causing
failures from timeout.
2016-12-28 14:56:57 -08:00
12d930b40f Merge pull request #7068 from heyitsanthony/fix-v2-health
v2http: submit QGET in health endpoint if no progress
2016-12-28 14:30:31 -08:00
3519a9784e Merge pull request #7039 from mitake/benchmark-dialtimeout
benchmark: a new option for configuring dial timeout
2016-12-28 13:12:11 -08:00
9690220cd1 Merge pull request #7064 from heyitsanthony/fix-health-perms
etcdctl: treat permission denied as healthy endpoint
2016-12-28 13:04:55 -08:00
e2463569e7 v2http: submit QGET in health endpoint if no progress
Removing the periodic SYNC calls broke the health endpoint since the
raft index stops updating. Instead, don't bother monitoring the
raft index; issue a QGET directly to get a consensus response.

Fixes #6985
2016-12-28 12:20:56 -08:00
46062efa78 e2e: test cluster-health 2016-12-28 12:20:55 -08:00
e63059ec31 Merge pull request #7030 from crandles/grpc-histograms
etcdmain: add '--metrics' option
2016-12-28 12:03:53 -08:00
36b2d3f5eb etcdmain: add --metrics flag for exposing histogram metrics
this adds a new flag, --metrics, that can be used to enable extensive (histogram) metrics.

Fixes #7024
2016-12-28 13:04:52 -05:00
00e00f16bb ctlv3: consider permission denied error to be healthy for endpoints
Relaxes the permission expectations for endpoint health by noting:
* permission denial on linearized reads is always through consensus
* endpoint health means consensus with the cluster through the endpoint

So, there's no need to require permission on a health check key in order
to know whether the endpoint is healthy.

Fixes #7057
2016-12-28 09:13:27 -08:00
b940e0d514 Merge pull request #7042 from petermattis/pmattis/resume-after-heartbeat-resp
raft: resume paused followers on receipt of MsgHeartbeatResp
2016-12-27 21:15:53 -08:00
a662ddefbb benchmark: a new option for configuring dial timeout
Current benchmark doesn't have an option for configuring dial timeout
of gRPC. This commit adds --dial-timeout for the purpose. It is useful
for stopping long sticking benchmarks.
2016-12-28 14:07:43 +09:00
407afc69ed e2e: check etcdctl endpoint health is healthy if denied permission to key 2016-12-27 14:49:52 -08:00
c00084812c Merge pull request #7054 from gyuho/err
etcd-tester: remove unused err var from maxRev
2016-12-27 12:36:48 -08:00
db8b15bf8f etcd-tester: remove unused err var from maxRev 2016-12-27 12:16:43 -08:00
89b18ff1af Merge pull request #7015 from fanminshi/fix_lease_expired_too_soon
lease: force leader to apply its pending committed index for lease op…
2016-12-27 11:26:15 -08:00
2faf72f47c etcdserver: rework update committed index logic 2016-12-27 10:11:40 -08:00
17873f7be8 Merge pull request #7008 from heyitsanthony/fix-dns
retry on resolution failure for advertised peer DNS check
2016-12-27 10:03:01 -08:00
d9b9821551 Merge pull request #7060 from hhkbp2/fix-pre-vote-tests
raft: fix pre-vote tests
2016-12-26 17:42:36 -08:00
920b155f17 raft: fix pre-vote tests 2016-12-26 14:31:59 +08:00
7b7feb46fc leasehttp: buffer error channel to prevent goroutine leak 2016-12-22 14:25:01 -08:00
fef4a79528 lease: force leader to apply its pending committed index for lease operations
suppose a lease granting request from a follower goes through and followed by a lease look up or renewal, the leader might not apply the lease grant request locally. So the leader might not find the lease from the lease look up or renewal request which will result lease not found error. To fix this issue, we force the leader to apply its pending commited index before looking up lease.

FIX #6978
2016-12-22 14:24:38 -08:00
1a8e3cad9a Merge pull request #7053 from gyuho/typo
etcd-tester: fix typo, add endpoint in logs
2016-12-22 13:12:38 -08:00
591bb5e7f6 etcd-tester: fix typo, add endpoint in logs 2016-12-22 12:51:27 -08:00
acbf0fa452 Merge pull request #7041 from m1093782566/raft-safe
raft: make memory storage set method thread safe
2016-12-20 09:14:27 -08:00
e625400f1d raft: resume paused followers on receipt of MsgHeartbeatResp
Previously, paused followers were resumed upon sending a MsgHearbeat.

Fixes #7037
2016-12-20 08:22:09 -05:00
8151d4d0bc raft: make memory storage set method thread safe 2016-12-20 18:48:52 +08:00
d62ce55584 Merge pull request #7027 from gyuho/default-host
embed: only override default advertised client URL if the client listen URL is 0.0.0.0
2016-12-16 18:53:11 -08:00
e58287f026 embed: only override default advertised client URL if the client listen URL is 0.0.0.0 2016-12-16 18:31:04 -08:00
af3451be26 Merge pull request #7018 from gyuho/why
Documentation: add 'why.md'
2016-12-16 15:54:49 -08:00
bef87cc953 Documentation: add 'why.md' 2016-12-16 15:54:03 -08:00
f95f7a3027 Merge pull request #7028 from gyuho/faq
Documentation: add FAQs on membership operation
2016-12-16 15:37:21 -08:00
2f0e82a31e Documentation: add FAQs on membership operation
Copy Anthony's answer from:
https://github.com/coreos/etcd/issues/6103
https://github.com/coreos/etcd/issues/6114
2016-12-16 15:13:40 -08:00
780d2f2a59 etcdctl: tighten up output, reorganize README.md
Documentation was far too repetitive, making it a chore to read and
make changes. All commands are now organized by functionality and all
repetitive bits about return values and output are in a generalized
subsections.

etcdctl's output handling was missing a lot of commands. Similarly,
in many cases an output format could be given but fail to report
an error as expected.
2016-12-16 13:54:20 -08:00
531c3061c1 Merge pull request #7023 from heyitsanthony/lease-freeze
clientv3: fix lease "freezing" on unhealthy cluster
2016-12-16 11:38:22 -08:00
a375e91c66 clientv3: don't reset keepalive stream on grant failure
Was triggering cancelation errors on outstanding KeepAlives if Grant
had to retry.
2016-12-16 10:36:51 -08:00
46bd842db9 clientv3/integration: test lease grant/keepalive with/without failures 2016-12-16 10:36:51 -08:00
87b1d9571f v3api, rpctypes: add ErrTimeoutDueToConnectionLost
Lack of GRPC code was causing this to look like a halting error to the client.
2016-12-16 10:25:35 -08:00
d9e928de7a Merge pull request #7020 from heyitsanthony/etcdctl-migrate-warn
etcdctl: warn when backend takes too long to open on migrate
2016-12-16 09:51:34 -08:00
109577351b Merge pull request #7022 from hongchaodeng/master
docs: explicitly set ETCDCTL_API=3 in recovery.md
2016-12-15 20:39:19 -08:00
fa733e1e9c docs: explicitly set ETCDCTL_API=3 in recovery.md 2016-12-15 20:10:30 -08:00
e71ff361a4 etcdctl: warn when backend takes too long to open on migrate 2016-12-15 18:57:57 -08:00
52e3dc5eb9 Documentation: minor fix nodes -> node 2016-12-15 21:27:52 -05:00
93e303ec71 Merge pull request #7017 from gyuho/faq
dev-guide: add limit.md
2016-12-15 15:45:23 -08:00
a1e572b460 dev-guide: add limit.md 2016-12-15 15:44:21 -08:00
5aeee917a7 Merge pull request #7006 from heyitsanthony/clusterid-split
Documentation: FAQ entry for cluster ID mismatches
2016-12-15 12:43:17 -08:00
14c851c863 Documentation: FAQ entry for cluster ID mismatches 2016-12-15 11:27:24 -08:00
86a43849fb Merge pull request #7010 from dennwc/keepalive-exit-err
clientv3: ensure KeepAlive channel is closed or error is returned
2016-12-15 08:06:36 -08:00
35fd5dc9fc Merge pull request #6903 from mitake/auth-member
protect membership change RPCs with auth
2016-12-15 08:04:31 -08:00
b126e31132 clientv3: better error message for keep alive loop halt 2016-12-15 16:06:27 +02:00
d46b753186 e2e: test cases of protecting membership change with auth 2016-12-15 22:54:20 +09:00
86d7390804 auth, etcdserver: protect membership change operations with auth
This commit protects membership change operations with auth. Only
users that have root role can issue the operations.

Implements https://github.com/coreos/etcd/issues/6899
2016-12-15 22:54:20 +09:00
5183ce0118 clientv3: add test for keep alive loop exit case 2016-12-15 03:02:44 +02:00
e0bcd4d516 clientv3: return error from KeepAlive if corresponding loop exits
after recvKeepAliveLoop exits client might call KeepAlive adding request channel that will not be closed
this fix makes sure that recvKeepAliveLoop is running before adding request to lessor's list and returns error otherwise

Fixes #6922
2016-12-15 03:02:35 +02:00
d8513adf1d Merge pull request #7007 from heyitsanthony/lease-close
clientv3: close Lease on client Close
2016-12-14 16:06:32 -08:00
26a3e9a740 membership: retry for 30s on advertise url check 2016-12-14 15:56:22 -08:00
29c30b2387 etcdserver: retry for 30s on advertise url check 2016-12-14 15:56:22 -08:00
13b05aeff8 netutil: ctx-ize URLStringsEqual
Handles the case where the DNS entry will only be set up after etcd
starts.
2016-12-14 15:46:30 -08:00
246fb29d8a clientv3: close Lease on client Close
Fixes #6987
2016-12-14 12:11:17 -08:00
a9f72ee0d4 Merge pull request #7005 from heyitsanthony/fix-pprof
embed: deep copy user handlers
2016-12-14 12:05:37 -08:00
8f88632218 Merge pull request #6965 from gyuho/faq
Documentation: add more FAQs (follower, leader, sys-require)
2016-12-14 11:51:34 -08:00
626df4d77c Documentation: add more FAQs (follower, leader, sys-require) 2016-12-14 11:36:07 -08:00
cc931a2319 embed: deep copy user handlers
Shallow copy of user handlers leads to a nil map assignment when
enabling pprof. Since the map is being modified, it should probably
be deep copied into the server context, which fixes the crash.
2016-12-14 10:17:32 -08:00
4ca78aa89f Merge pull request #7004 from fbarbeira/patch-3
op-guide/clustering: fix typo
2016-12-14 09:52:37 -08:00
972ef3c92e op-guide/clustering: fix typo 2016-12-14 18:51:30 +01:00
1e60f88786 Merge pull request #6999 from leonliao/patch-1
Documentation: use port 2379 in local cluster guide
2016-12-14 09:29:20 -08:00
cb9277f339 Documentation: use port 2379 in local cluster guide
The port in endpoints should be 2379, instead of 12379.
2016-12-14 15:09:21 +08:00
cdde0368ad Merge pull request #6997 from gyuho/range
auth: improve 'removeSubsetRangePerms' to O(n)
2016-12-13 16:14:37 -08:00
a53175949e auth: improve 'removeSubsetRangePerms' to O(n) 2016-12-13 15:43:23 -08:00
454f1da2f2 Merge pull request #6996 from xiang90/hardware
doc: add hardware section
2016-12-13 12:53:52 -08:00
e3d8ef4cea doc: add hardware section 2016-12-13 12:42:47 -08:00
1a8e78cd55 Merge pull request #6994 from gyuho/etcd-tester-fix-leak
etcd-tester: cancel lease stream; fix OOM panic
2016-12-13 10:44:54 -08:00
301abddc72 etcd-tester: cancel lease stream; fix OOM panic
It was never closing lease keep-alive streams, leaking memory.
Fix OOM panics in etcd-tester (after 1K rounds).
2016-12-13 09:56:30 -08:00
cc37beff35 Merge pull request #6995 from gyuho/etcd-tester-pprof
etcd-tester: add 'enable-pprof' option
2016-12-13 08:02:47 -08:00
4e831810c9 Merge pull request #6993 from cloudaice/build-bug
build: remove dir use -r flag
2016-12-13 07:57:31 -08:00
7d16e7d27e etcd-tester: add 'enable-pprof' option 2016-12-13 05:03:27 -08:00
b294ab13a4 build: remove dir use -r flag 2016-12-13 16:08:50 +08:00
797d826117 Merge pull request #6979 from heyitsanthony/fields-fmt
etcdctl: "fields" output formats
2016-12-12 15:17:12 -08:00
5f3140987e etcdctl: "fields" output formats
Writes out fields from responses in the format "FieldName" : FieldValue. If
FieldValue is a string, it is formatted with %q.
2016-12-12 13:21:20 -08:00
be740dc436 Merge pull request #6975 from gyuho/gopath
*: fix 'gosimple', 'gounused' checks
2016-12-12 11:53:45 -08:00
5b7582365e Merge pull request #6990 from xiang90/faq_m
doc: add faq about missing heartbeat
2016-12-12 11:38:10 -08:00
468187de31 doc: add faq about missing heartbeat 2016-12-12 11:31:17 -08:00
7e74b3f846 grpcproxy: remove unused field 'wbs *watchBroadcasts' 2016-12-12 10:07:14 -08:00
eb8646a381 v3rpc: remove unused 'splitMethodName' function 2016-12-12 10:07:14 -08:00
3512f114e4 e2e: remove unused 'ctlV3GetFailPerm' 2016-12-12 10:07:14 -08:00
b8e09bf849 tools: simplify boolean comparison, remove unused 2016-12-12 10:07:14 -08:00
0c5d1d5641 raft: simplify boolean comparison, remove unused 2016-12-12 10:07:14 -08:00
f3cb93015c integration: simplify boolean comparison in resp.Created 2016-12-12 10:07:14 -08:00
55307d48ac auth: fix gosimple errors 2016-12-12 10:07:14 -08:00
6ec4b9c26a test: exclude '_home' for gosimple, unused 2016-12-12 10:07:14 -08:00
0a15c1b9c6 Merge pull request #6988 from xiang90/faq_m
doc: add faq about apply warning logging
2016-12-12 10:06:32 -08:00
6969369a32 doc: add faq about apply warning logging 2016-12-12 09:58:42 -08:00
20dca1eb80 Merge pull request #6977 from heyitsanthony/move-prof
etcdserver, embed, v2http: move pprof setup to embed
2016-12-09 13:30:19 -08:00
cf60588b27 Merge pull request #6974 from heyitsanthony/interacting-fixup
Documentation: update get examples to be clearer about ranges
2016-12-09 13:08:40 -08:00
2c06def8ca etcdserver, embed, v2http: move pprof setup to embed
Seems like a better place for prof setup since it's not specific to v2.
2016-12-09 12:37:35 -08:00
cb75c40a8b Merge pull request #6973 from sinsharat/make_contributing_url_based
github: make contribution link non-relative
2016-12-09 12:28:07 -08:00
46e63cc14a Merge pull request #6972 from heyitsanthony/bug-report-link
github: make bug reporting link non-relative
2016-12-09 11:15:29 -08:00
d2a6bbd9c6 Documentation: update get examples to be clearer about ranges
Fixes #6966
2016-12-09 10:54:38 -08:00
01c8b25284 github: make contribution link non-relative 2016-12-10 00:03:47 +05:30
f8b480cd6f github: make bug reporting link non-relative
Works when accessed through code browser, blank if accessed via issues/
2016-12-09 10:18:38 -08:00
1e92b7929c Merge pull request #6967 from heyitsanthony/glide-versions
vendor: use version tags if possible
2016-12-08 16:09:41 -08:00
de58a9c733 scripts: use glide update if repo exists in glide.lock 2016-12-08 14:26:29 -08:00
f095334788 vendor: use versions when possible in glide.yaml
Now using tags instead of SHAs
2016-12-08 14:26:08 -08:00
367f513674 Merge pull request #6961 from heyitsanthony/roadmap
ROADMAP: update for 3.2
2016-12-08 13:30:31 -08:00
b713113094 Merge pull request #6962 from gyuho/mispell
grpcproxy: fix minor typo
2016-12-07 18:55:09 -08:00
fcbfff6a00 Merge pull request #6958 from xiang90/reduce_sync
etcdserver: only send v2 sync if ttl keys exist
2016-12-07 18:38:02 -08:00
a98de7efa7 grpcproxy: fix minor typo 2016-12-07 17:08:46 -08:00
69cc9fdd17 Merge pull request #6956 from gyuho/faq
Documentation: add more FAQ questions
2016-12-07 16:25:47 -08:00
7c0ae91d78 Documentation: add more FAQ questions 2016-12-07 16:25:04 -08:00
09252c4e07 ROADMAP: update for 3.2 2016-12-07 16:12:59 -08:00
2f96a68a20 etcdserver: do not send v2 sync if ttl keys do not exist 2016-12-07 14:48:15 -08:00
da3b71b531 Merge pull request #6929 from heyitsanthony/ctx-lease-renew
etcdserver: use context for Renew
2016-12-07 00:05:14 -08:00
96626d0a23 Merge pull request #6957 from coreos/philips-patch-1
Documentation: add blox and chain as users
2016-12-06 20:23:27 -08:00
1bee237acf Documentation: add blox and chain as users 2016-12-06 20:20:40 -08:00
c4e5081562 Merge pull request #6943 from m1093782566/fix-store-test-comments
store: fix store_test.go comments
2016-12-06 16:54:36 -08:00
529806dba1 Merge pull request #6935 from bdarnell/election-test
raft: Fix election "logs converge" test
2016-12-06 16:45:39 -08:00
be1f36d97c v3rpc, etcdserver, leasehttp: ctxize Renew with request timeout
Would retry a few times before returning a not primary error that
the client should never see. Instead, use proper timeouts and
then return a request timeout error on failure.

Fixes #6922
2016-12-06 14:09:57 -08:00
f6042890b7 integration: use RequireLeader for TestV3LeaseFailover
Giving Renew() the default request timeout causes TestV3LeaseFailover
to miss its timing constraints. Since it only needs to wait until the
leader recognizes the leader is lost, use RequireLeader to cancel the
keepalive stream before the request times out.
2016-12-06 14:09:57 -08:00
fdd89df1eb clientv3/integration: test lease keepalive works following quorum loss 2016-12-06 14:09:57 -08:00
cfd10b4bbf Merge pull request #6949 from xiang90/faq
doc: initial faq
2016-12-06 10:08:09 -08:00
58150937c0 doc: initial faq 2016-12-06 08:48:57 -08:00
1b0ffdaff0 Merge pull request #6945 from sttts/sttts-update-ugorji
Update ugorji
2016-12-06 08:05:13 -08:00
9c364efef6 client: update generated ugorji codec 2016-12-06 07:53:47 +01:00
b21731c022 vendor: update ugorji/go 2016-12-06 07:53:47 +01:00
9603d5e31f store: fix store_test.go comments 2016-12-06 09:31:59 +08:00
994e0d2182 Merge pull request #6950 from gyuho/fix-readstatec-deadlock
etcdserver: time out when readStateC is blocking
2016-12-05 16:37:47 -08:00
cbee2b74a3 Merge pull request #6948 from heyitsanthony/fix-metric-deadlock
grpcproxy: fix deadlock in watchbroadcast
2016-12-05 16:17:26 -08:00
3fd1d951f8 etcdserver: time out when readStateC is blocking
Otherwise, it will block forever when the server is overloaded.

Fix https://github.com/coreos/etcd/issues/6891.
2016-12-05 15:34:46 -08:00
91ff6f30b5 grpcproxy: fix deadlock in watchbroadcast
Calling empty() in watchbroadcast methods was trying to
lock the rwmutex when it was already held.

Fixes #6937
2016-12-05 15:06:44 -08:00
2509e7ad2c Merge pull request #6947 from heyitsanthony/grpc-stat-race
grpcproxy: lock store when getting size
2016-12-05 14:30:00 -08:00
8fefd1f471 Merge pull request #6942 from eiipii/eiipiiVersion2ScalaClient
eiipii/etcdhttpclient library added to documentation on external clients
2016-12-05 14:12:47 -08:00
f62ed3d642 Documentation: link added to libraries-and-tools.md with a new v2 Scala
Client
2016-12-05 22:55:17 +01:00
b9b14b15d6 Merge pull request #6946 from heyitsanthony/fix-e2e-getrole
etcdctl: remove GetUser check before mutable commands
2016-12-05 13:34:52 -08:00
62398954e4 grpcproxy: lock store when getting size
Fixes data race in proxy integration tests.
2016-12-05 13:29:57 -08:00
5559a026d7 etcdctl: remove GetUser check before mutable commands
etcdctl was checking if the user exists before applying mutable calls;
if etcdctl contacts a minority member, the member may not know the user
exists on the cluster yet, causing command failure when it should succeed.

If the user does not exist, it will be picked up once the command goes
through raft.

Fixes #6932
2016-12-05 12:12:06 -08:00
2b6ad93036 Merge pull request #6936 from xiang90/put_rate
banchmark: add rate limit
2016-12-05 12:01:15 -08:00
e62e9ce193 benchmark: add rate limit 2016-12-05 09:54:30 -08:00
40f0193c4c Merge pull request #6938 from bdarnell/ispaused
raft: Export Progress.IsPaused
2016-12-03 21:51:09 -08:00
f60a5d6025 raft: Export Progress.IsPaused
CockroachDB would like to use this method for monitoring.
2016-12-04 13:14:08 +08:00
340ba8353c raft: Fix election "logs converge" test
The "logs converge" case in TestLeaderElectionPreVote was incorrectly
passing because some nodes were not actually using the preVoteConfig.
This test case was more complex than its siblings and it was not
verifying what it wanted to verify, so pull it out into a separate test
where everything can be tested more explicitly.

Fixes #6895
2016-12-03 17:29:15 +08:00
d844440ffb Merge pull request #6930 from xiang90/grpc_metrics
grpcproxy: add cache related metrics
2016-12-02 18:30:49 -08:00
0cb680800e grpcproxy: add cache related metrics 2016-12-02 15:29:42 -08:00
1f954dc9f4 Merge pull request #6926 from xiang90/metrics
grpcproxy: add richer metrics for watch
2016-12-02 14:13:43 -08:00
a686c994cd grpcproxy: add richer metrics for watch 2016-12-02 11:13:30 -08:00
f61b4ae5ad Merge pull request #6921 from heyitsanthony/fix-watch-prevkv-test-leak
integration: cancel Watch when TestV3WatchWithPrevKV exits
2016-12-01 15:25:00 -08:00
76bb33781f integration: cancel Watch when TestV3WatchWithPrevKV exits
Missing ctx cancel was causing goroutine leaks for the proxy tests.
2016-12-01 15:08:18 -08:00
9647012cb1 Merge pull request #6920 from endocode/dongsu/sdnotify-go-systemd
vendor: bump go-systemd to v14 to avoid build error
2016-12-01 10:39:40 -08:00
b9e9c9483b Merge pull request #6885 from fanminshi/refractor_lease_checker
etcd-tester: refactor lease checker
2016-12-01 10:11:15 -08:00
5e351956b9 vendor: bump go-systemd to v14 to avoid build error
Bump go-systemd to v14 (48702e0d, 2016-11-14).
Also adjust caller of daemon.SdNotify() to avoid build error, which can
be seen especially when running "go get github.com/coreos/etcd".
2016-12-01 13:26:46 +01:00
5d60482357 Merge pull request #6911 from m1093782566/fix-get-sorted
store: check sorted order in TestStoreGetSorted
2016-11-30 19:49:55 -08:00
4e52b80590 Merge pull request #6916 from heyitsanthony/fix-coalesce-bcast-race
grpcproxy: fix race between coalesce and bcast on nextrev
2016-11-30 19:49:10 -08:00
5f2b5e8b9d store: check sorted order in TestStoreGetSorted 2016-12-01 10:36:23 +08:00
394ab43587 etcd-tester: refactor lease checker
Move few checking logic from lease stresser to lease checker and change connection logic for lease stresser and checker
2016-11-30 17:29:58 -08:00
60908c64a6 grpcproxy: fix race between coalesce and bcast on nextrev
coalesce was locking the target coalesce broadcast object but not the source
broadcast object resulting in a data race on the source's nextrev.
2016-11-30 16:50:29 -08:00
98cd3fddc9 Merge pull request #6907 from heyitsanthony/fix-quota-proxy-failfast
integration: use Range to wait for reboot in quota tests
2016-11-30 16:49:54 -08:00
f1e0525c81 integration: use Range to wait for reboot in quota tests
Proxy client layer ignores call options so Put is always FailFast;
this can lead to connection errors when trying to issue the Put
following restarting the client's target server.
2016-11-30 13:56:30 -08:00
7079bf9a75 Merge pull request #6574 from vimalk78/auth-simpletoken-not-removed#6554
auth/simple_token.go : token not removed when etcdctl session closes …
2016-11-30 11:33:23 -08:00
8eec86f7fb Merge pull request #6888 from fanminshi/use_monotonic_time_for_lease
Use monotonic time in lease
2016-11-29 13:39:01 -08:00
e7f4010cca lease: Use monotonic time in lease
lease uses monotimer to calculate its expiration. In this way, changing system time won't affect in lease expiration.

FIX #6700
2016-11-29 12:31:00 -08:00
cac30beed5 Merge pull request #6906 from heyitsanthony/fix-watchclose-race
grpcproxy: fix race between watch ranges delete() and broadcasts empty()
2016-11-28 16:26:03 -08:00
d680b8b5fb grpcproxy: fix race between watch ranges delete() and broadcasts empty()
Checking empty() wasn't grabbing the broadcasts lock so the race detector
flags it as a data race with coalesce(). Instead, just return the number
of remaining watches following delete() and get rid of empty().
2016-11-28 15:53:41 -08:00
a076510cc1 Merge pull request #6905 from heyitsanthony/client-readme
client: update README about health monitoring
2016-11-28 13:10:57 -08:00
8aa03a5959 Merge pull request #6884 from gyuho/tls
etcdmain: handle TLS in grpc-proxy listener
2016-11-28 12:28:56 -08:00
ad16b63cce client: update README about health monitoring 2016-11-28 12:28:33 -08:00
dfe853ebff auth: add a timeout mechanism to simple token 2016-11-28 17:21:13 +05:30
c31b1ab8d1 Merge pull request #6896 from gyuho/endpoints
clientv3: return copy of endpoints, not pointer
2016-11-23 11:51:48 -08:00
a08103c088 clientv3: return copy of endpoints, not pointer
Fix https://github.com/coreos/etcd/issues/6892.
2016-11-23 11:33:54 -08:00
aea9c6668f Merge pull request #6890 from gyuho/doc
Documentation/op-guide: add notes about 'datasource' in Prometheus
2016-11-22 10:43:30 -08:00
ede51b10f8 op-guide: add notes about Prometheus data source in Grafana 2016-11-22 10:34:41 -08:00
ec5f9bce63 Merge pull request #6886 from fanminshi/fix_dial_grpc
functional-tester: add withBlock() to grpc dial
2016-11-21 11:33:31 -08:00
f7c721b746 Merge pull request #6867 from fanminshi/fix_checking_timeout
etcd-tester: limit max retry backoff delay
2016-11-21 11:20:32 -08:00
2ccba33dd1 functional-tester: add withBlock() to grpc dial
grpc dail withTimeout() only works if withBlock() option is present.
2016-11-21 11:15:12 -08:00
2ac1c4c9ed etcd-tester:limit max retry backoff delay
grpc uses expoential retry if a connection is lost. grpc will sleep base on exponential delay.
if delay is too large, it slows down tester.
2016-11-21 10:58:55 -08:00
ff96769b55 etcdmain: handle TLS in grpc-proxy listener 2016-11-21 10:39:34 -08:00
0326d6fdd3 Merge pull request #6877 from coreos/fix_test
etcd-tester: do not resolve localhost
2016-11-21 09:52:31 -08:00
69470b5e5f Merge pull request #6878 from absolute8511/fix-raftexample-test
raftexample: confState should be saved after apply
2016-11-21 09:51:10 -08:00
d7c98a4695 Merge pull request #6879 from xiang90/raft_test
raft: fix TestNodeProposeAddDuplicateNode
2016-11-20 22:19:44 -08:00
f2eb8560ed raft: fix TestNodeProposeAddDuplicateNode
Only send signal after applying conf change.
Or deadlock might happen if raft node receives
ready without conf change when the test server
is slow.
2016-11-20 21:59:31 -08:00
859142033f Merge pull request #6866 from absolute8511/master
raft: add node should reset the pendingConf state
2016-11-20 21:34:37 -08:00
e6d1ebcc1d raft: use the channel instead of sleep to make test case reliable 2016-11-21 13:30:15 +08:00
bc6f5ad53e raft: fix test case for data race 2016-11-21 10:30:36 +08:00
62bd5477b9 raft: fix test case, should wait config propose applied 2016-11-21 10:10:34 +08:00
16e3ab0f11 raft: test case to check the duplicate add node propose 2016-11-20 16:58:11 +08:00
e8d06d8e4d raftexample: confState should be saved after apply 2016-11-20 16:51:33 +08:00
b1178469be etcd-tester: do not resolve localhost 2016-11-19 18:38:26 -08:00
7e7c7e157e Merge pull request #6873 from heyitsanthony/proxy-v3-watch-canceled-sync
grpcproxy: fix deadlock on watch broadcasts stop
2016-11-18 22:34:35 -08:00
bb4884e957 Merge pull request #6861 from gyuho/grpc-proxy-metrics
etcdmain: add '/metrics' HTTP/1 path to grpc-proxy
2016-11-18 20:03:52 -08:00
a39509ee5b etcdmain: add '/metrics' HTTP/1 path to grpc-proxy 2016-11-18 19:40:06 -08:00
7618fdd1d6 grpcproxy: fix deadlock on watch broadcasts stop
Holding the WatchBroadcasts lock and waiting on donec was
causing a deadlock with the coalesce loop. Was causing
TestV3WatchSyncCancel to hang.
2016-11-18 16:55:26 -08:00
2acf0806fb Merge pull request #6869 from sinsharat/mvcc_remove_unused_restore_method
mvcc: remove unused restore method
2016-11-18 15:52:45 -08:00
c1581732fd Merge pull request #6872 from heyitsanthony/srv-alert
discovery: warn on scheme mismatch
2016-11-18 13:41:34 -08:00
428cb21a3f Merge pull request #6864 from heyitsanthony/watch-doc
Documentation: add grpc gateway watch example
2016-11-18 13:30:16 -08:00
74ae67b835 discovery: warn on scheme mismatch 2016-11-18 13:12:14 -08:00
b7cc698444 version: bump up v3.1.0-rc.1+git 2016-11-18 11:41:29 -08:00
ccf154e706 Documentation: add grpc gateway watch example
Shows how to use watch via grpc gateway.
2016-11-18 11:37:35 -08:00
6d9168a2ec integration: don't expect recv to stop on CloseSend in waitResponse 2016-11-18 11:37:35 -08:00
3d5ba43211 version: bump up v3.1.0-rc.1 2016-11-18 11:16:01 -08:00
7da3019f42 Merge pull request #6862 from gyuho/network-interface
pkg/netutil: get default interface for tc commands
2016-11-18 10:11:59 -08:00
43078d3ced mvcc: remove unused restore method 2016-11-18 23:04:39 +05:30
097cdbd0e4 pkg/netutil: get default interface for tc commands
Fix https://github.com/coreos/etcd/issues/6841.
2016-11-17 22:49:17 -08:00
68b04b7067 Merge pull request #6846 from sinsharat/mvcc_store_restore_timeout_fix
mvcc: store.restore taking too long triggering snapshot cycle fix
2016-11-17 22:06:43 -08:00
456569f45d e2e: add test for v3 watch over grpc gateway 2016-11-17 15:49:58 -08:00
9a20743190 v3rpc: don't close watcher if client closes send
grpc-gateway will CloseSend but still want to receive updates.
2016-11-17 15:33:37 -08:00
4401d88546 raft: add node should reset the pendingConf state
After add node conf proposed twice with the same node id, the pending state is not reset because
the addNode returned without setting the pending state at the second
time and the pending state will always be true unless other conf changed. During this we
can not add any new node because the propose will be ignored since the
pending state is true.
2016-11-17 15:50:13 +08:00
aa2b5aec1b mvcc : Added benchmark for store.resotre 2016-11-17 04:01:15 +05:30
f014cca644 mvcc: TestStoreRestore fix 2016-11-16 16:58:42 +05:30
95fb41a923 mvcc: store.restore taking too long triggering snapshot cycle fix 2016-11-16 16:31:20 +05:30
377f19b003 Merge pull request #6857 from LK4D4/non_block_status
raft: return empty status if node is stopped
2016-11-15 16:44:50 -08:00
7afc490c95 raft: return empty status if node is stopped
If the node is stopped, then Status can hang forever because there is no
event loop to answer. So, just return empty status to avoid deadlocks.

Fix #6855

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-11-15 15:45:23 -08:00
e55b8485dd Merge pull request #6856 from heyitsanthony/proxy-lease-fix
grpcproxy: copy range request before storing in cache
2016-11-15 15:43:00 -08:00
1358a9d460 grpcproxy: copy range request before storing in cache
Reused Range requests would have Serialized overwritten with 'true'.

Was failing on TestV3LeaseSwitch.
2016-11-15 14:35:00 -08:00
7c8f13aed7 Merge pull request #6852 from heyitsanthony/fix-proxy-dbarrier
grpcproxy: watch next revision should be start revision when not 0
2016-11-15 09:21:18 -08:00
98a7c642d4 grpcproxy: watch next revision should be start revision when not 0
The create header revision is the current etcd revision. For watches with
rev=0, the next revision is hdr.rev+1. For watches with rev=n, the next
revision should be n.

Fixes TestDoubleBarrier timeouts.
2016-11-14 16:46:02 -08:00
677606da7d Merge pull request #6851 from gyuho/metrics
v3rpc: replace grpc metrics w/ go-grpc-prometheus
2016-11-14 16:09:17 -08:00
7cac755df2 op-guide: update gRPC requests metrics 2016-11-14 15:20:16 -08:00
5e810e30cc v3rpc: replace grpc metrics w/ go-grpc-prometheus
And disable histogram
2016-11-14 15:20:09 -08:00
d073512def Merge pull request #6849 from heyitsanthony/proxy-fix-watch-create
grpcproxy: don't send extra watch create events
2016-11-14 12:13:40 -08:00
90ea3fbadc grpcproxy: do not resend create event after leader loss
Only set CreateNotify if no watch responses have been received.
2016-11-14 10:43:06 -08:00
e40da39143 grpcproxy: only coalesce watchers that have received create response
Current watchers may have nextrev=0; check response count instead.
2016-11-14 09:19:02 -08:00
a2e86c1371 Merge pull request #6842 from heyitsanthony/watch-prevkv
grpcproxy: support prevKV watcher
2016-11-11 16:32:51 -08:00
45bba11f12 Merge pull request #6844 from gyuho/grafana
op-guide: add screenshot to sample Grafana dashboard
2016-11-11 16:30:02 -08:00
625366875d op-guide: add screenshot to sample Grafana dashboard 2016-11-11 16:21:15 -08:00
70fd684843 Merge pull request #6843 from gyuho/docs
Documentation/op-guide: add 'monitoring' guide
2016-11-11 16:08:32 -08:00
6d83590434 Documentation/op-guide: add 'monitoring' guide 2016-11-11 15:22:07 -08:00
6604306398 grpcproxy: support prevKV watcher
Makes all server watchers PrevKV, discards if client watcher is not PrevKV.
2016-11-11 14:22:06 -08:00
3c97e7a475 Merge pull request #6800 from sinsharat/add_benchmark_watch_latency
benchmark: added watch-latency
2016-11-11 12:41:26 -08:00
e5b6324771 benchmark: added watch-latency 2016-11-12 01:08:35 +05:30
b4726a9501 Merge pull request #6822 from heyitsanthony/watch-bcast
grpcproxy: rework watcher organization
2016-11-11 10:50:27 -08:00
5af4de0930 Merge pull request #6840 from gyuho/vendor
*: clean up vendor
2016-11-11 10:15:18 -08:00
395cf7de51 grpcproxy: reject invalid watch ranges 2016-11-11 10:14:35 -08:00
ec459c2185 grpcproxy: rework watcher organization
The single watcher / group watcher distinction limited and
complicated watcher coalescing more than necessary. Reworked:

Each server watcher is represented by a WatchBroadcast, each
client "Watcher" attaches to some WatchBroadcast. WatchBroadcasts
hold all WatchBroadcast instances for a range. WatchRanges holds
all WatchBroadcasts for the proxy.

WatchProxyStreams represent a grpc watch stream between the proxy and
a client. When a client requests a new watcher through its grpc stream,
the ProxyStream will allocate a Watcher and WatchRanges assigns it to
some WatchBroadcast based on its range.

Coalescing is done by WatchBroadcasts when it receives an update
notification from a WatchBroadcast.

Supports leader failure detection so watches on a bad member
can migrate to other members. Coincidentally, Fixes #6303.
2016-11-11 10:14:35 -08:00
4d5a12a248 Merge pull request #6839 from xiang90/ctl_v
etcdctl: etcdctl v3 should print out its API version
2016-11-11 10:00:14 -08:00
4b417da1be Merge pull request #6837 from purpleidea/feat/consturls
embed: Make immutable defaults constant
2016-11-11 09:53:55 -08:00
38ce362629 vendor: clean up, remove unnecessary deps 2016-11-11 09:51:07 -08:00
1f7e88d851 glide: rerun updatedep.sh to clean up 2016-11-11 09:50:46 -08:00
1ef243e436 etcdctl: etcdctl v3 should print out its API version 2016-11-11 09:33:20 -08:00
745cd730a7 embed: Make immutable defaults constant
This changes the two immutable defaults into constants which allows
packages embedding etcd to import them as const! If they are variables,
then you'll fail with "const initializer foo is not a constant".
2016-11-11 07:34:45 -05:00
952eb4fade Merge pull request #6833 from gyuho/news
NEWS: update with v3.0.15
2016-11-10 13:34:16 -08:00
7c0035637d NEWS: update with v3.0.15 2016-11-10 13:29:07 -08:00
ef024049df Merge pull request #6832 from gyuho/vendor
*: update all grpc-related dependencies
2016-11-10 13:28:07 -08:00
b8b72f80f9 *: revendor, update proto files 2016-11-10 12:02:00 -08:00
baa4e4ee56 scripts/genproto: update gogo/protobuf, grpc-gateway 2016-11-10 12:02:00 -08:00
8631f47568 glide: update all grpc-related dependencies 2016-11-10 12:01:45 -08:00
0a8e28524b Merge pull request #6779 from xiang90/watch_clean
etcd-runner: clean up watcher runner
2016-11-10 09:59:08 -08:00
0b78ef8de1 Merge pull request #6831 from xiang90/grpc_proxy_doc
doc: add gRPC proxy start doc
2016-11-10 09:34:38 -08:00
b16c93a885 doc: add gRPC proxy start doc 2016-11-10 09:20:13 -08:00
523a859ad9 etcd-runner: clean up watcher runner 2016-11-10 08:56:19 -08:00
1a25b2ff3e Merge pull request #6781 from gyuho/vendor
scripts/updatedep: work around 'testify/assert', remove 'etcd-top'
2016-11-09 16:17:27 -08:00
55d25f6f4d tools: remove 'etcd-top'
Travis CI breaks because of cgo dependencies on 'etcd-top'.
This can leave outside of project.
2016-11-09 15:59:47 -08:00
5b8300f08b store: type-assert int64 for assert tests 2016-11-09 15:59:47 -08:00
859ac6dfd8 vendor: rerun 'updatedep.sh' script, clean up 2016-11-09 15:59:47 -08:00
0f68810505 glide: remove legacy packages from godep
And remove all legacy packages in glide.yaml on sub-dependency.
They were added when we migrated from godep. glide will handle
it automatically with glide.lock file.
2016-11-09 15:59:47 -08:00
4cf5b76d18 scripts/updatedep: work around 'testify/assert'
'glide vc --no-tests' flag removes 'testify/assert' deps
in v2 client. Until we deprecate v2 tests, just copy the
necessary files as workaround.

And remove '--skip-tests' flags in case we add dependencies
in test files.
2016-11-09 15:59:34 -08:00
ab6b175a2a Merge pull request #6828 from fanminshi/add_not_equal_to_compare
etcdserver, clientv3: add "!=" to txn
2016-11-09 15:27:08 -08:00
c2fd42b556 etcdserver, clientv3: add "!=" to txn
adding != to compare is a requested functionality from a etcd user

FIX #6719
2016-11-09 14:28:36 -08:00
4a1e89150b Merge pull request #6827 from heyitsanthony/proxy-txn-invalidate
grpcproxy: update cache based on txn response
2016-11-09 13:16:48 -08:00
3ed63af51a Merge pull request #6826 from feisan/dev-kvkv
clientv3/naming: support OpOption when adding an endpoint
2016-11-09 13:03:56 -08:00
a4dcceb8aa grpcproxy: update cache based on txn response
Fixes more hangs in TestSTMConflict.
2016-11-09 12:11:38 -08:00
c20d31adc5 clientv3/naming: support OpOption when adding an endpoint
if we want to add an endpoint with lease, we need this option.
for example:

    resp, err := cli.Grant(context.TODO(), 5)
    if err != nil {
        log.Fatal(err)
    }

    err = r.Update(context.TODO(), serviceName, naming.Update{Op:naming.Add, Addr: exposedAddr}, clientv3.WithLease(resp.ID))
    if err != nil {
        log.Fatalf(err)
    }
2016-11-09 15:30:17 -04:00
9c7a0a68e5 Merge pull request #6825 from gyuho/new
etcdserver: increase maxGapBetweenApplyAndCommitIndex
2016-11-09 10:32:51 -08:00
c817df1d32 etcdserver: increase maxGapBetweenApplyAndCommitIndex
This exists to prevent sending too many requests that
would lead into applier falling behind Raft accepting-proposal.

Based on recent benchmarks, etcd was able to process high workloads
(2 million writes with 1K concurrent clients).

The limit 1000 is too conservative to test those high workloads.
2016-11-09 09:44:11 -08:00
dbb692e50f Merge pull request #6820 from gyuho/watcher
mvcc: return -1 for wrong watcher range key >= end
2016-11-08 17:36:19 -08:00
0f5d9f00ad Merge pull request #6808 from fanminshi/functional-tester-compaction-deadline-fix
etcd-tester: increase compaction timeout limit
2016-11-08 17:18:40 -08:00
9dd75a946f clientv3, ctlv3: document range end requirement 2016-11-08 17:02:32 -08:00
396a71ee9e integration: test wrong watcher range 2016-11-08 17:02:32 -08:00
425acb28c4 mvcc: return -1 for wrong watcher range key >= end
Fix https://github.com/coreos/etcd/issues/6819.
2016-11-08 17:02:28 -08:00
107d7b663c etcd-tester: changed compaction timeout calculation
functional tester sometime experiences timeout during compaction phase. I changed the timeout calculation base on number of entries created and deleted.

FIX #6805
2016-11-08 17:00:04 -08:00
a93d8dfe62 Merge pull request #6821 from gyuho/manual
*: fix minor typos, styles
2016-11-08 15:39:26 -08:00
510676fea9 Merge pull request #6816 from heyitsanthony/fix-disconn-cancel
clientv3: let watchers cancel when reconnecting
2016-11-08 13:27:50 -08:00
2955d58776 clientv3/integration: fix minor typos, consistent formatting 2016-11-08 12:37:33 -08:00
754daf918b clustering.md: update minor grammar 2016-11-08 12:34:43 -08:00
1a969ffc52 Merge pull request #6812 from feisan/dev-kvkv
Documentation: fixed  typo
2016-11-08 12:33:06 -08:00
1aeeb38459 clientv3: let watchers cancel when reconnecting 2016-11-08 12:02:17 -08:00
7b5e5eadb1 integration: test canceling a watcher on disconnected stream 2016-11-08 12:02:17 -08:00
b2f8d8c397 Merge pull request #6817 from heyitsanthony/build-tag-etcdtop
etcd-top: make build require -tags pcap
2016-11-08 08:12:22 -08:00
57fb2a2b35 vendor: unvendor gopcap so travis CI works 2016-11-07 16:17:52 -08:00
2af31f99c3 etcd-top: make build require -tags pcap
Fixes travis.
2016-11-07 15:54:40 -08:00
97ac128fef Documentation: fixed typo 2016-11-07 19:14:34 -04:00
c9cc1efb67 Merge pull request #6815 from bdarnell/transfer-non-member
raft: Check promotable() in MsgTimeoutNow handling
2016-11-07 10:33:57 -08:00
2f34547d39 raft: Check promotable() in MsgTimeoutNow handling
If MsgTimeoutNow arrived after a node was removed, the node could start
and win an election, then panic in becomeLeader (see
cockroachdb/cockroach#8535)
2016-11-07 20:02:21 +08:00
ecd4803ccc Merge pull request #6809 from hongchaodeng/doc
readme: add 'run etcd on k8s' section
2016-11-04 22:59:42 -07:00
011c452b65 readme: add 'run etcd on k8s' section 2016-11-04 20:28:14 -07:00
352d4fa3fa Merge pull request #6804 from heyitsanthony/stm-conflict
grpcproxy: invalidate comparison keys after txn
2016-11-04 17:04:16 -07:00
476ff67047 Merge pull request #6807 from xiang90/fix_raft_test
rafttest: make raft test reliable
2016-11-04 16:31:32 -07:00
e5987dea37 rafttest: make raft test reliable 2016-11-04 15:55:17 -07:00
91360e1495 Merge pull request #6806 from gyuho/metrics
v3rpc: add 'active' gRPC streamsGauge
2016-11-04 12:28:55 -07:00
67082e5bd1 v3rpc: add gRPC active streamsGauge 2016-11-04 11:09:20 -07:00
bf08a6142c grpcproxy: invalidate comparison keys after txn
If the txn comparison block makes claims about a key's current
state, then it may say a key has been updated. Future range/txn
operations may expect this update to eventually be propagated through
the cluster and show up in serialized requests. To avoid spinning
forever on txn/serialized range loops, invalidate the comparison keys.
2016-11-04 09:46:43 -07:00
27459425fa Merge pull request #6799 from gyuho/log-output
etcdmain: configurable 'etcd' binary log-output
2016-11-03 14:52:53 -07:00
a0d206c51f Merge pull request #6801 from xiang90/fix_snap_test
etcdserver: make snaptest fail fast
2016-11-03 14:49:42 -07:00
6a0a0a7ea1 etcdserver: make snaptest fail fast 2016-11-03 14:44:08 -07:00
6ffd7e3ed1 etcdmain: configurable 'etcd' binary log-output
Fix https://github.com/coreos/etcd/issues/5449.
2016-11-03 14:18:12 -07:00
aa526cd53d Merge pull request #6798 from gyuho/ctl-doc
etcdctl/ctlv3: clarify 'user add' argument (user:password)
2016-11-03 11:06:40 -07:00
31a6efbc13 etcdctl/ctlv3: clarify 'user add' argument (user:password) 2016-11-03 10:47:45 -07:00
f82aac2fc6 Merge pull request #6797 from fanminshi/lease_checker_println_fix
etcd-tester: fix lease checker logging format.
2016-11-03 10:17:54 -07:00
b7ab5c6384 Merge pull request #6788 from fanminshi/lease_http_eof_fix
etcd-tester: add retry logic on retriving lease info
2016-11-03 10:14:36 -07:00
6968028020 etcd-tester: fix lease checker logging format.
lease checker used a wrong print format for a variable. this change fixes it.
2016-11-03 10:11:00 -07:00
649fe7f2af etcd-tester: add retry logic on retriving lease info
getting lease and keys info through raw rpcs rarely experience error such as EOF. This is considered as a failure and causes tester to clean up.
however, they are just transient problem with temporary connection issue which should not be considered as a testing failure. so we add retry logic in case of transient failure.

FIX #6754
2016-11-03 10:05:06 -07:00
b28b38fb6d Merge pull request #6793 from timothysc/no-ttl
Add a no-ttl flag to etcdctl migrate to discard keys on transform.
2016-11-03 09:00:53 -07:00
c5ac02164d Merge pull request #6794 from xiang90/fix_migration
ctlv3: fix migration
2016-11-03 08:43:30 -07:00
97e96feb1d ctlv3: Add a no-ttl flag to etcdctl migrate to discard keys on transform. 2016-11-03 10:41:54 -05:00
4d2ec2fec1 Merge pull request #6792 from gyuho/leasehttp
leasehttp: use graceful close, add tests, remove TODO
2016-11-02 22:55:06 -07:00
bbc1cdafef Merge pull request #6791 from gyuho/grpc-leader
etcdserver: translate EOF to ErrNoLeader for renew, timetolive
2016-11-02 22:54:46 -07:00
cc304ac03c etcdserver: translate EOF to ErrNoLeader for renew, timetolive
Address https://github.com/coreos/etcd/issues/6754.

In case there are network errors or unexpected EOF errors
in TimeToLive http requests to leader, we translate that into
ErrNoLeader, and expects the client to retry its request.
2016-11-02 22:22:05 -07:00
2fb2b463a3 Merge pull request #6786 from mitake/empty-user
auth, etcdserver: forbid adding a user with empty name
2016-11-02 22:10:58 -07:00
f85701a46f auth, etcdserver: forbid adding a user with empty name 2016-11-03 13:45:39 +09:00
2ba42990ec ctlv3: fix migration 2016-11-02 20:00:07 -07:00
c931f4d164 leasehttp: use graceful close, add tests, remove TODO 2016-11-02 16:33:26 -07:00
378257161f Merge pull request #6789 from heyitsanthony/grpcproxy-close-send
grpcproxy: reliably track rid in watchergroups
2016-11-02 15:29:08 -07:00
fe755b6250 Merge pull request #6748 from sinsharat/client_metric_add_tests
clientv3: added test for client metrics
2016-11-02 15:00:08 -07:00
844378f0a7 Merge pull request #6790 from sinsharat/clientv3_metrics_doc_update
clientv3: updated doc for metric support
2016-11-02 14:56:04 -07:00
195570b621 clientv3: updated doc for metric support 2016-11-03 03:22:59 +05:30
8ec4215279 grpcproxy: reliably track rid in watchergroups
Couldn't find watcher group from rid on server stream close, leading to
the watcher group sending on a closed channel.

Also got rid of send closing the watcher stream if the buffer is full,
this could lead to a send after close while broadcasting to all receivers.
Instead, if a send times out then the server stream is canceled.

Fixes #6739
2016-11-02 14:42:02 -07:00
13acad85b3 clientv3: added test for client metrics 2016-11-03 00:38:29 +05:30
7d777a4a64 Merge pull request #6784 from xiang90/lock_warning
etcdserver: print out warning when waiting for file lock
2016-11-02 10:34:52 -07:00
5b7728f3cb Merge pull request #5994 from gyuho/v2-error
etcdctl/ctlv2: error handling with JSON
2016-11-01 21:51:16 -07:00
9b470ef4c0 etcdctl/ctlv2: error handling with JSON 2016-11-01 20:59:13 -07:00
c33d04fb54 etcdserver: print out warning when waiting for file lock 2016-11-01 17:55:16 -07:00
71bad561e8 Merge pull request #6782 from xiang90/v2store
store: do not modify key during scanning
2016-11-01 15:41:03 -07:00
43045500b2 store: do not modify key during scanning 2016-11-01 14:35:53 -07:00
71a533fec3 Merge pull request #6771 from fanminshi/refactor_short_lived_lease_logic
etcd-tester: refactor checking short lived lease logic
2016-11-01 14:17:43 -07:00
4f60f1b71f Merge pull request #6708 from bluepeppers/leader-sync-deadlock
client: Prevent deadlocks in Sync
2016-11-01 14:11:21 -07:00
8a03c95dd4 etcd-tester: refactor checking short lived lease logic
move the logic of waiting lease expired from stresser to checker
2016-11-01 14:06:22 -07:00
b30dc10812 Merge pull request #6770 from heyitsanthony/fix-grpc
grpcproxy: add SetHeader support to ServerStream
2016-11-01 13:55:07 -07:00
7ef17d3e97 grpcproxy: add SetHeader support to ServerStream
Fixes #6726
2016-11-01 13:28:02 -07:00
4575353693 Merge pull request #6768 from gyuho/wtwt
clientv3/integration: close active connection to get ErrClientConnClosing
2016-11-01 12:37:04 -07:00
0684d8c4c6 clientv3/integration: close active connection to get ErrClientConnClosing
because clientv3.Close won't trigger it any more

clientv3.Close just closes watch client
instead of closing grpc connection
2016-11-01 11:13:33 -07:00
94c804b81a Merge pull request #6766 from fanminshi/stabilization-logic-refractoring
functional-tester: remove stablilization limit
2016-11-01 10:43:00 -07:00
de008c8a4a client: prevent deadlock in Sync 2016-11-01 17:26:53 +00:00
c781f30ed5 functional-tester: remove stablilization limit
This change removes the waiting needed to ensure the cluster to be stable.

FIX #6760
2016-11-01 10:01:59 -07:00
db83736b7b Merge pull request #6774 from mitake/linearizable-password-checking
etcdserver: linearizable password checking at the API layer
2016-11-01 07:51:27 -07:00
fdf433024f etcdserver: linearizable password checking at the API layer
For avoiding a schedule that can cause an inconsistent auth store [1],
password checking must be done in a linearizable manner.

Fixes https://github.com/coreos/etcd/issues/6675 and https://github.com/coreos/etcd/issues/6683

[1] https://github.com/coreos/etcd/issues/6675#issuecomment-255006389
2016-11-01 00:02:33 -07:00
136c02da71 Merge pull request #6738 from gyuho/raft-cleanup
etcdserver: move 'EtcdServer.send' to raft.go
2016-10-31 15:15:08 -07:00
b64de4707d Merge pull request #6724 from johnbazan/ctlv3_add_user_with_password_inline
etcdctl: allow to add a user within one command line
2016-10-31 14:31:09 -07:00
d51a7dba43 etcdctl: Adding e2e tests for userAddTest 2016-10-31 18:14:29 -03:00
73b4a58ac0 etcdctl: allow to add a user within one command line
This makes the "user add usr:pwd" feature available for ctlv3
without asking for the password in a new prompt.
2016-10-31 18:14:19 -03:00
4969a0e9e7 Merge pull request #6758 from heyitsanthony/move-checker
etcd-tester: refactor stresser / checker management
2016-10-31 13:59:54 -07:00
308f2a1695 etcd-tester: refactor stresser/checker organization
The checkers and stressers should be composable without special cases; this
patch tries to address that while refactoring out some old cruft.

Namely,
* Single stresser/checker for a tester; built from composition
* Composite stresser via comma-separated list of stressers
* Split stressers into separate files
* Removed v2 only flags and special cases
* Rate limiter shared among key stresser and leases stresser
* Composite checker is now concurrent
* Stresser can return a Checker to check its invariants
* Each lease checker only operates on a single lease stresser
2016-10-31 13:59:04 -07:00
72fc5f7d1b Merge pull request #6765 from xiang90/s
etcd-runner: move string generation to pkg/stringutil
2016-10-31 12:37:18 -07:00
9f0ee53e86 etcd-runner: move string generation to pkg/stringutil 2016-10-31 12:20:02 -07:00
30d37b2165 Merge pull request #6763 from gyuho/spell
*: fix minor typos
2016-10-31 10:43:17 -07:00
5bd00ab1f6 *: fix minor typos 2016-10-31 09:47:15 -07:00
a1a2d2b1e7 Merge pull request #6762 from gyuho/doc
op-guide: 'strict-reconfig-check' true by default
2016-10-31 09:44:57 -07:00
7e06a95942 Merge pull request #6759 from xiang90/tester
etcd-runner: refactor code structure and flag cleanup
2016-10-31 09:07:18 -07:00
4a42c72b5e op-guide: 'strict-reconfig-check' true by default 2016-10-31 07:59:33 -07:00
e5c3978725 etcd-runner: refactor code structure and flag cleanup 2016-10-30 18:45:16 -07:00
86c4a74139 etcd-tester: move stresser and checker to tester
These really belong in tester code; the stressers and
checkers are higher order operations that are orchestrated
by the tester. They're not really cluster primitives.
2016-10-29 10:57:17 -07:00
4a08678ce1 Merge pull request #6749 from gyuho/raft-prevote
raft: do not attach term to MsgReadIndex
2016-10-28 22:29:08 -07:00
cb5c92f69b raft: do not attach term to MsgReadIndex
Fix https://github.com/coreos/etcd/issues/6744.

MsgReadIndex, as MsgProp, is to be forwarded to leader.
So we should treat it as local message.
2016-10-28 22:12:25 -07:00
0345226759 Merge pull request #6751 from heyitsanthony/fix-require-leader-test
integration: put key on watch target member for TestWatchWithRequireLeader
2016-10-28 23:24:00 -04:00
bc3e056b4a Merge pull request #6755 from fanminshi/log-statement-fix
functional-tester: fix log statement
2016-10-28 14:40:11 -07:00
34c906be55 functional-tester: fix log statement
simple fix for wrongly printed statement.
2016-10-28 14:27:09 -07:00
d8ea9d22b6 integration: put key on watch target member for TestWatchWithRequireLeader
It's possible the put will not propagate to all members before removing quorum,
causing watches on the key to wait forever.

Fixes #6386
2016-10-28 13:12:26 -04:00
a0360a83c9 Merge pull request #6745 from heyitsanthony/private-recipe
contrib/recipes: unexport and clean up keys.go
2016-10-28 12:44:58 -04:00
8f718e2e5a contrib/recipes: unexport and clean up keys.go
Fixes #6731
2016-10-28 11:41:13 -04:00
c6cd63dc35 Merge pull request #6747 from sinsharat/client_metric_add_example
clientv3: added example for client metrics
2016-10-27 16:42:18 -07:00
a1bfb31219 clientv3: added example for client metrics 2016-10-28 04:30:17 +05:30
ea05711522 Merge pull request #6746 from fanminshi/tester-recovery-error-fix
functional-tester: always clean up if tester encouters an error
2016-10-27 15:22:07 -07:00
7f5a7d1da5 functional-tester: always clean up if tester encouters an error
The current tester doesn't not clean up if any of the failure injection/recovery fails. if tester fails to recover a dead node, tester hangs in the next round because the tester will keep waiting until cluster becomes healthy which is impossible since a node is down. To fix this issue, we will always clean up if any error happens during each round so that cluster will be healthy for next round.

FIX #6743
2016-10-27 15:07:58 -07:00
89107a49fa Merge pull request #6741 from sinsharat/clientv3_add_client_side_metrics
clientv3: added client side metrics support
2016-10-27 13:22:10 -07:00
1b36162659 Merge pull request #6647 from gyuho/watch
clientv3: send create event over outc
2016-10-27 11:45:22 -07:00
0a3d45a307 clientv3: send create event over outc 2016-10-27 11:11:16 -07:00
8fd1dd7862 clientv3: added client side metrics support 2016-10-27 22:47:45 +05:30
c99a9f4075 clientv3: added entries for go-grpc-prometheus for build 2016-10-27 22:44:19 +05:30
2c974abcb9 clientv3: added go-grpc-prometheus for client meterics 2016-10-27 22:36:05 +05:30
6ec03d3f7c etcdserver: move 'EtcdServer.send' to raft.go
Clear 'TODO'
2016-10-26 16:26:00 -07:00
8825392da2 Merge pull request #6714 from fanminshi/short_term_lease_check
functional-tester: add short lived leases checking
2016-10-26 14:50:55 -07:00
8d9e2623e1 functional-tester: add short lived leases checking
lease stresser now generates short lived leases that will expire before invariant checking.
this addition verifies that the expired leases are indeed being deleted on the sever side.
2016-10-26 14:46:57 -07:00
d7c21e6837 Merge pull request #6737 from fanminshi/lease_expired_fix
functional-tester: increase lease TTL
2016-10-26 10:34:38 -07:00
1dc60bb97e functional-tester: increase lease TTL
increasing lease TTL ensure that lease doesn't expire during hashes stabilization period.
I observed that it can take a long time for etcd cluster to become stable.
2016-10-26 10:32:52 -07:00
c58ae95429 Merge pull request #6732 from JoshRosso/etcdctl-specify-ttl-unit
etcdctl: add ttl unit to flag description
2016-10-25 18:08:02 -07:00
e489229153 etcdctl: add ttl unit to flag description
Add the ttl unit (seconds) to --ttl description for etcdctl's mk, mkdir, set,
setdir, update, and updatedir commands.
2016-10-25 17:12:15 -07:00
12e4dfa9c4 Merge pull request #6715 from fanminshi/lease_hash_fix
Lease hash fix
2016-10-25 16:28:11 -07:00
b398233f4f Merge pull request #6730 from gyuho/round-prefix
etcd-runner: fix typo in round prefix
2016-10-25 16:24:27 -07:00
99539ff031 Merge pull request #6727 from sinsharat/etcd-runner_add_client_timeout_flag
etcd-runner: Added connection timeout flag for client
2016-10-25 16:09:10 -07:00
12488d4a70 etcd-runner: fix typo in round prefix 2016-10-25 15:59:44 -07:00
bb97adda0d functional-tester: add retries to hash checking
allows hashes to converge through retrying.
2016-10-25 14:27:36 -07:00
6e7e346c93 etcd-runner: Added client connection timeout flag 2016-10-26 01:58:22 +05:30
d7bc15300b Merge pull request #6624 from bdarnell/pre-vote
raft: Implement the PreVote RPC described in thesis section 9.6
2016-10-25 13:18:22 -07:00
ddc94aaf9e Merge pull request #6725 from gyuho/btree
vendor: backport 'google/btree' changes
2016-10-25 12:34:52 -07:00
4ba63237ce Merge pull request #6705 from gyuho/dump-db
etcd-dump-db: initial commit
2016-10-25 11:43:42 -07:00
cd618323d0 vendor: backport 'google/btree' changes 2016-10-25 10:53:35 -07:00
924ece6ae7 etcd-dump-db: initial commit 2016-10-25 10:18:51 -07:00
4e1d3f0f52 mvcc: expose 'backend.IgnoreKey' 2016-10-25 10:07:08 -07:00
18739e766a Merge pull request #6721 from sinsharat/etcd_runner_remove_unused_code
etcd-runner: remove unused code and change name for randClient
2016-10-25 10:01:20 -07:00
efeceef0ca Merge pull request #6703 from FedericoCeratto/patch-1
Add etcd client for Nim
2016-10-25 09:28:08 -07:00
8d5e969f12 raft: Separate test methods for vote and pre-vote tests 2016-10-25 23:31:44 +09:00
69ae49a1dd etcd-runner: remove unused code and change name for randClient 2016-10-25 19:16:27 +05:30
f2cff42cb8 libraries-and-tools: add Nim client 2016-10-25 12:20:42 +01:00
8e5f34fd97 Merge pull request #6709 from yudai/error_url
clientv3: Fix URL to rpc errors
2016-10-24 18:52:46 -07:00
e7e29ba249 clientv3: Fix URL to rpc errors 2016-10-24 16:38:05 -07:00
c549978b8e Merge pull request #6712 from doodles526/change_boom_to_hey
hack/benchmark: change boom to hey
2016-10-24 14:51:58 -07:00
4eefdaa4bb hack/benchmark: change boom to hey
boom has moved to hey, due to a conflicting binary name with another
project
2016-10-24 13:28:53 -07:00
0bb2384547 Merge pull request #6707 from mkumatag/ppc64le_support
Add ppc64le travis builds
2016-10-24 12:33:21 -07:00
77be124391 Merge pull request #6691 from xiang90/fix_retry
clientv3: do not retry on mutable operations
2016-10-24 10:32:34 -07:00
0642b4e61e travis: Add ppc64le travis builds 2016-10-24 22:46:14 +05:30
a1afb21e33 Merge pull request #6710 from fasaxc/report-cluster-id
client: Return the server's cluster ID as part of the Response
2016-10-24 09:46:57 -07:00
06e2ce116c Merge pull request #6704 from heyitsanthony/proxy-broadcast-race
grpcproxy: fix race on watcher revision
2016-10-24 09:17:29 -07:00
ae99c91903 Merge pull request #6698 from heyitsanthony/session-close
concurrency: terminate session.Close if revoke takes longer than TTL
2016-10-24 09:14:09 -07:00
43df091067 client: Return the server's cluster ID as part of the Response
This allows the client to spot if the cluster ID changes, which
would indicate that the cluster has been rebuilt and watches may be
out of sync.

Helps work around #6652.
2016-10-24 14:51:00 +01:00
22aa710c1f raft: Improve comments and formatting for PreVote change 2016-10-24 22:29:33 +09:00
81f151eed2 clientv3: fix retry logic
1. Balancer should setup gRPC error code correctly for retry.

2. We should not mask context error.
2016-10-22 22:15:43 -07:00
92c987f75d Merge pull request #6695 from sinsharat/watch_runner_respect_rounds
etcd-runner: watcher runner respect rounds
2016-10-21 20:28:29 -07:00
90146d863c etcd-runner: watcher runner respect rounds 2016-10-22 05:00:10 +05:30
cb3a5eaff1 Merge pull request #6702 from heyitsanthony/minmax-proxy
grpcproxy: respect {min,max}{create,mod} revision
2016-10-21 16:29:40 -07:00
a5c93840b4 Merge pull request #6701 from heyitsanthony/compact-resume
integration: account for unsynced server in TestWatchResumeCompacted
2016-10-21 16:29:27 -07:00
f38a5d19a8 concurrency: add WithContext option to sessions
Makes it possible to cancel session requests without having to
close the entire client.
2016-10-21 16:26:59 -07:00
1e330a90c7 concurrency: terminate session.Close if revoke takes longer than TTL
Fixes #6681
2016-10-21 16:21:01 -07:00
bd1985d84b grpcproxy: fix race on watcher revision
Was racing between broadcast setting the watchgroup revision
and joining single watchers.
2016-10-21 16:09:39 -07:00
65eb3038fe grpcproxy: respect {min,max}{create,mod} revision
Mutexes were breaking in proxy integration tests.
2016-10-21 15:02:00 -07:00
8f3abda5b8 integration: account for unsynced server in TestWatchResumeCompacted
The watch's etcd server is shutdown to keep the watch in a retry state as
keys are put and compacted on the cluster. When the server restarts,
there is a window where the compact hasn't been applied which may cause
the watch to receive all events instead of only a compaction error.

Fixes #6535
2016-10-21 13:42:10 -07:00
21e65eec08 Merge pull request #6692 from fanminshi/lease_expire_compact_fix
functional-tester: add rate limiter to lease stresser
2016-10-21 12:47:27 -07:00
d582fdcc1b functional-tester: add rate limiter to lease stresser
too many leases created can cause compaction to timeout. adding a rate limiter limits number of leases and attched keys.
2016-10-21 12:34:49 -07:00
1ad038d02e Merge pull request #6662 from gyuho/db-panic
backend: skip *bolt.DB.Size call when nil
2016-10-21 11:38:54 -07:00
ef9d55800f integration: test inflight Hash call on nil db 2016-10-21 11:02:54 -07:00
994e8e4f40 mvcc: test inflight Hash to trigger Size on nil db 2016-10-21 11:02:09 -07:00
7d30326968 backend: skip *bolt.DB.Size call when nil
Fix https://github.com/coreos/etcdlabs/issues/30.
2016-10-21 11:01:23 -07:00
791aeb39a6 Merge pull request #6653 from gyuho/acbuild
acbuild: add symlinks to /usr/local/bin/etcd*
2016-10-21 10:48:08 -07:00
60c0a5503e Merge pull request #6636 from heyitsanthony/watch-resume-close
clientv3: only receive from closing streams in Watcher close
2016-10-21 10:06:03 -07:00
b72a413b71 Merge pull request #6697 from gyuho/fmt
*: fix gofmt issues with go tip
2016-10-20 17:04:39 -07:00
0626ee048e rafthttp: fix gofmt issues with go tip 2016-10-20 16:32:56 -07:00
46716fe9fb mvcc: fix gofmt issues from Go tip 2016-10-20 16:32:47 -07:00
161eb2c457 Merge pull request #6696 from fanminshi/lease_expire_fix
functional-tester: modify lease renew logic
2016-10-20 16:25:04 -07:00
c100e40715 clientv3: only receive from closing streams in Watcher close
Was overcounting the number of expected closing messages; the resuming
list may have nil entries. Also the full client wasn't closing the watcher
client, only canceling its context, so client closes weren't joining with
the watcher shutdown.

Fixes #6605
2016-10-20 15:33:11 -07:00
a66c25121b integration: stress closing while resuming watchers 2016-10-20 15:33:11 -07:00
a25d4ac821 functional-tester: modify lease renew logic
only renew a lease if the lease is present.
2016-10-20 15:27:46 -07:00
a2cfb56581 Merge pull request #6689 from fanminshi/function-tester-ensure-etcd-fullly-restarted
functional-tester: add logic to ensure etcd node is alive after fault recovery returns
2016-10-20 13:30:48 -07:00
0f1eb14374 Merge pull request #6694 from gyuho/travis
travis: test with Go 1.7.3
2016-10-20 12:04:01 -07:00
dd1920883c Merge pull request #6693 from philips/fix-nb
Documentation: admin guide remove NB
2016-10-20 11:58:32 -07:00
9e6912fe82 travis: test with Go 1.7.3
Go 1.7.3 released.
2016-10-20 11:56:10 -07:00
e719d8641e Merge pull request #6688 from gyuho/compact-rev
e2e: compact with latest rev in alarm test
2016-10-20 11:54:04 -07:00
970abbb60a Documentation: admin guide remove NB
I have no idea what NB means but just change it to Note
2016-10-20 11:47:41 -07:00
9bfbc12d7d e2e: compact with latest rev in alarm test
Fix https://github.com/coreos/etcd/issues/6677.
2016-10-20 11:06:30 -07:00
a47797fdf1 Merge pull request #6690 from hongchaodeng/f
etcdctl: fix migrate in outputing client.Node to json
2016-10-20 10:50:58 -07:00
9205a242b9 clientv3: do not retry on mutable operations 2016-10-20 10:48:10 -07:00
94ea82c00d functional-tester: add logic to ensure etcd node is alive after fault recovery returns
failure recovery needs to wait etcd node to become alive before returning

FIX #6654
2016-10-20 10:31:08 -07:00
b3f0eeabe4 etcdctl: fix migrate in outputing client.Node to json
Using printf will try to parse the string and replace special
characters. In migrate code, we want to just output the raw
json string of client.Node.
For example,
    Printf("%\\") => %!\(MISSING)
    Print("%\\") => %\
Thus, we should use print instead.
2016-10-20 10:03:45 -07:00
6b1b13eabb Merge pull request #6687 from sinsharat/build_add_option_for_binary_stripping
build: add option to enable binaries stripping for windows
2016-10-19 13:25:25 -07:00
4dab78e72c Merge pull request #6680 from sinsharat/etcd_runner_make_run_watcher_fail_safe
etcd-runner: make run watcher fail safe
2016-10-19 13:24:14 -07:00
751a8d5b04 build: add option to enable binaries stripping for windows 2016-10-20 00:52:57 +05:30
50523e22d8 etcd-runner: make run watcher fail safe 2016-10-20 00:23:35 +05:30
e95b571e7c Merge pull request #6684 from gyuho/build-with-strip
release: build binary without symbols for debug
2016-10-19 10:33:50 -07:00
0bd9179835 release: build binary without symbols for debug 2016-10-19 09:45:10 -07:00
28a29d9ecd Merge pull request #6676 from nekto0n/build_args
build: add option to enable binaries stripping
2016-10-19 09:33:22 -07:00
46d4ff823f Merge pull request #6678 from manishrjain/master
raft: Add dgraph to the list of users
2016-10-19 09:31:07 -07:00
401ef96ace Merge pull request #6682 from sinsharat/update_txn_interactive_cmd_output
etcdctlv3: update txn interactive command output
2016-10-19 09:26:40 -07:00
00837b0736 etcdctlv3: update txn interactive command output 2016-10-19 19:55:09 +05:30
cf93a74aa8 raft: Refactor vote handling
Move all vote handling from the per-state step functions to the
top-level Step(). This wasn't necessary before because MsgVote would
cause us to become a follower, but MsgPreVote needs to be handled
without changing the node's current state.
2016-10-19 19:35:21 +08:00
73cae7abd0 raft: Implement the PreVote RPC described in thesis section 9.6
This prevents disruption when a node that has been partitioned
away rejoins the cluster.

Fixes #6522
2016-10-19 19:35:20 +08:00
ca87a13b18 raft: More realistic terms in tests
Some tests were starting nodes with a non-empty log but a term of zero,
which cannot happen in the real world. This was affecting the final term
being tested in TestLeaderElection.
2016-10-19 19:35:20 +08:00
10cead3139 test: Ignore gopath.proto in test script 2016-10-19 19:35:20 +08:00
255670106f raft: Add dgraph to the list of users
Because Dgraph is a notable user of RAFT.
2016-10-19 17:26:51 +11:00
c6ebc13b43 build: build unstripped binaries by default 2016-10-19 11:15:38 +05:00
11c38fb1eb Merge pull request #6661 from manishrjain/startnode
Update README to explain starting a single node cluster and joining it.
2016-10-18 21:03:28 -07:00
e69c2fd382 raft: update README to explain starting a single node cluster and joining it
this PR helps clients of RAFT set up the cluster correctly, when they're
starting with a single node cluster.
2016-10-19 14:09:48 +11:00
c9b7fc46ff Merge pull request #6672 from gyuho/etcdctl-sort-by
*: sort by ASCEND on missing sort order
2016-10-18 17:07:38 -07:00
f550af7ef4 integration: test sort ASCEND by default in range 2016-10-18 16:50:30 -07:00
4de2128344 clientv3/integration: test missing sort order get 2016-10-18 16:29:22 -07:00
3a6d4b7f12 e2e: test sort ASCEND when sort target is missing 2016-10-18 16:29:22 -07:00
1cd6fefd49 etcdserver: set sort ASCEND for empty sort order
when target is not key
2016-10-18 16:29:19 -07:00
20bdb315f5 Merge pull request #6670 from fanminshi/lease_stressor
functional-tester: add lease stresser
2016-10-18 14:38:42 -07:00
ab2b58a80f functional-tester: add lease stresser
Add lease stresser to test lease code under stress and etcd failures

resolve #6380
2016-10-18 14:20:26 -07:00
ed75d93625 Merge pull request #6666 from fanminshi/function-tester-refractor
functional-tester: move checker logic to cluster
2016-10-18 11:44:37 -07:00
7d86d1050e functional-tester: move checker logic to cluster
I move the checker logic from tester to cluster so that stressers and checkers can be initialized at the same time.
this is useful because some checker depends on stressers.
2016-10-18 11:17:40 -07:00
5c60478953 Merge pull request #6656 from yudai/balancer_fast_fail
clientv3: make balancer respect FastFail
2016-10-17 15:04:04 -07:00
6a33f0ffd5 clientv3: make balancer respect FastFail
The simpleBalancer.Get() blocks grpc.Invoke() even when the Invoke() is called
with the FailFast option. Therefore currently any requests with the
FastFail option actually doesn't fail fast. They get blocked when there is
no endpoints available.
Get() method needs to respect the BlockingWait option when
picks up an endpoint address from the list and fail immediately when the option is
enabled and no endpoint is available.
2016-10-17 14:11:51 -07:00
24c284160b Merge pull request #6635 from sinsharat/etcd_runner_add_watcher_runner
etcd-runner:added watch runner
2016-10-17 11:02:06 -07:00
8297322176 etcd-runner:added watch runner 2016-10-17 23:04:33 +05:30
7022d2d00c Merge pull request #6660 from gyuho/delete-all-keys
etcdctl/ctlv3: support del all keys with '--prefix'
2016-10-17 09:57:19 -07:00
75a65e1a70 e2e: add test cases for del all keys 2016-10-17 09:34:21 -07:00
fac20b228d ctlv3: support del all keys by '--prefix' 2016-10-17 09:33:59 -07:00
5457c029d7 Merge pull request #6640 from mitake/bcrypt-async
auth, etcdserver: check password at API layer
2016-10-17 09:24:34 -07:00
39e9b1f75a auth, etcdserver: check password at API layer
The cost of bcrypt password checking is quite high (almost 100ms on a
modern machine) so executing it in apply loop will be
problematic. This commit exclude the checking mechanism to the API
layer. The password checking is validated with the OCC like way
similar to the auth of serializable get.

This commit also removes a unit test of Authenticate RPC from
auth/store_test.go. It is because the RPC now accepts an auth request
unconditionally and delegates the checking functionality to
authStore.CheckPassword() (so a unit test for CheckPassword() is
added). The combination of the two functionalities can be tested by
e2e (e.g. TestCtlV3AuthWriteKey).

Fixes https://github.com/coreos/etcd/issues/6530
2016-10-17 14:18:21 +09:00
cc96f91156 Merge pull request #6659 from kragniz/python-client
Add link to python-etcd3
2016-10-16 15:20:37 -07:00
1e29715185 Documentation: add link to python-etcd3 2016-10-16 20:55:53 +01:00
e1547a775b Merge pull request #6646 from MartyMacGyver/windows_build_cleanup
build: Windows build cleanup
2016-10-14 18:57:36 -07:00
698a789644 Merge pull request #6655 from kragniz/range_end-docs
etcdserver: document DeleteRangeRequest prefixes
2016-10-14 15:00:24 -07:00
f2b953d4f7 version: bump up to v3.1.0-rc.0+git 2016-10-14 14:53:13 -07:00
8334790777 Merge pull request #6657 from gyuho/build
*: fix build script, bump up version
2016-10-14 14:40:17 -07:00
a81997ac3f version: bump up to v3.1.0-rc.0 2016-10-14 14:21:32 -07:00
06fd31cde9 build: get GitSHA first 2016-10-14 14:21:20 -07:00
4c444df7a6 Revert "version: bump to v3.1.0-rc.0"
This reverts commit cb178a78ea.
2016-10-14 14:20:33 -07:00
cb178a78ea version: bump to v3.1.0-rc.0 2016-10-14 14:06:21 -07:00
ce6276a2e8 etcdserver: document DeleteRangeRequest prefixes
There was missing info about deleting prefixes in the proto docs for
DeleteRangeRequest.

Closes #6641.
2016-10-14 21:39:03 +01:00
45588c1f9f Merge pull request #6650 from gyuho/flag
*: tests, README on environment variables in etcdctl v3
2016-10-14 12:15:27 -07:00
66f9e81c9a etcdctl: update README on environment variables 2016-10-14 11:58:59 -07:00
8081254498 e2e: add tests with environment vars for flags 2016-10-14 11:58:56 -07:00
a00ed609c3 pkg/flags: export 'FlagToEnv' for e2e tests 2016-10-14 11:15:28 -07:00
522be31192 acbuild: add symlinks to /usr/local/bin/etcd*
And uses latest acbuild (v0.4.0, --to-dir flag is deprecated).

For https://github.com/coreos/etcd/issues/6057.
2016-10-14 10:35:26 -07:00
77d6ecbc5f Merge pull request #6649 from fanminshi/discovery_max_wait
discovery: add upper limit for waiting on a retry
2016-10-14 09:46:08 -07:00
84508697ce Merge pull request #6639 from mitake/functional-tester-external
functional-tester: a new option -failure-wrapper for enabling/disabli…
2016-10-14 07:56:26 -07:00
296427fc78 build: Windows build cleanup
Remove spurious warnings and prompts
Make normal output quieter
Add filesys check (warn and exit on FAT* systems)

Fixes #5866
2016-10-14 02:07:53 -07:00
d1660b5ba3 Merge pull request #6619 from mitake/health-key
etcdctl, e2e: add --check-key option to endpoint health
2016-10-13 20:27:37 -07:00
eb9a01258e discovery: add upper limit for waiting on a retry
Adding upper limit ensures that expoential backoff doesn't reach more than 5 min on a re-try.

FIX #6648
2016-10-13 20:14:41 -07:00
d585b43abe etcdctl, e2e: add --check-key option to endpoint health
This commit adds a new option --check-key to endpoint health command
for health checking with a custom key. It is mainly for avoiding
permission problem.
2016-10-14 11:39:46 +09:00
b2b03d9926 functional-tester: a new option -failure-wrapper for enabling/disabling external fault injector
This commit adds a new option -failure-wrapper to etcd-tester. The
option receives a path of script that is used for enabling/disabling
external fault injectors. The script is called with an option "enable"
when it needs to be enabled (when failure.Inject() is called) and
called with "disabled" in an opposite case (when failure.Recover() is
called).
2016-10-14 11:31:28 +09:00
052e314372 build: Windows build cleanup
Remove spurious warnings and prompts; make output more informative

Fixes #5866
2016-10-13 13:05:24 -07:00
57008f1690 Merge pull request #6644 from kragniz/increase-warn-duration
etcdserver: increase warnApplyDuration from 10ms to 100ms
2016-10-13 10:58:58 -07:00
9df97eb441 etcdserver: increase warnApplyDuration from 10ms to 100ms
When running test suites for a client locally I'm getting spammed by log
lines such as:

    etcdserver: apply entries took too long [14.226771ms for 1 entries]

The comments in #6278 mention there were future plans of increasing the
threshold for logging these warnings, but it hadn't been done yet.
2016-10-13 17:55:50 +01:00
354891f75d Merge pull request #6634 from gyuho/manual
integration: add TestV3WatchWithPrevKV
2016-10-12 16:42:42 -07:00
c3948284a0 integration: add TestV3WatchWithPrevKV 2016-10-12 16:21:52 -07:00
614adb0230 Merge pull request #6628 from gyuho/fix-waitgroup
etcdserver: make WaitGroup.Add sync with Wait
2016-10-12 14:10:54 -07:00
546873f27e Merge pull request #6632 from heyitsanthony/grpc-naming
clientv3/naming: support resolving to multiple hosts
2016-10-12 13:18:36 -07:00
0c61d8804a etcdserver: make WaitGroup.Add sync with Wait 2016-10-12 13:11:35 -07:00
a97866b629 Merge pull request #6633 from xiang90/fix_rev_inconsistency
mvcc: fix rev inconsistency
2016-10-12 13:04:15 -07:00
3dbd30fcaa Documentation: add grpc naming resolver doc 2016-10-12 11:56:14 -07:00
7d50dc06a2 clientv3/naming: support resolving to multiple hosts
Previous implementation watches a single key so there's no way
to have separate hosts associate with separate keys for a single
grpc target. Instead, accept all keys on a prefix.

Also fixes first the Next() to read current name data from etcd instead
of waiting for the next event on a synced watcher.
2016-10-12 11:27:22 -07:00
93225ebafc mvcc: fix rev inconsistency
Try:

./etcdctl put foo bar
./etcdctl del foo
./etcdctl compact 3

restart etcd

./etcdctl get foo
mvcc: required revision has been compacted

The error is unexpected when range over the head revision.

Internally, we incorrectly set current revision smaller than the
compacted revision when we remove all keys around compacted revision.

This commit fixes the issue by recovering the current revision at least
to compacted revision.
2016-10-12 10:42:57 -07:00
cb9c77c4ba Merge pull request #6620 from nekto0n/put_update_optimize
Optimize updating key by storing lease in lessor
2016-10-12 09:47:11 -07:00
064e02f4b3 mvcc: Optimize updating key by storing lease in lessor 2016-10-12 09:37:09 +05:00
66f945c4bf Merge pull request #6629 from gyuho/clientv3-logger
clientv3: drop Config.Logger field
2016-10-11 17:01:13 -07:00
084c407a8d clientv3: drop Config.Logger field
Fix https://github.com/coreos/etcd/issues/6603.

Instead adds 'SetLogger' to set global logger interface
to avoid unnecessary logger updates.
2016-10-11 16:38:32 -07:00
e9f3101c49 Merge pull request #6625 from xiang90/grpc_proxy_doc
doc: add grpc proxy doc
2016-10-11 16:06:05 -07:00
17a6025ac8 doc: add grpc proxy doc 2016-10-11 15:15:45 -07:00
4c1a738caf Merge pull request #6627 from xiang90/apply_log
etcdserver: better panic logging
2016-10-11 14:44:46 -07:00
dbaa44372b etcdserver: better panic logging 2016-10-11 13:34:18 -07:00
c10dad41a3 Merge pull request #6604 from sinsharat/support_debug_build_using_delve_gdb
build: Added support for debugging using delve, gdb, etc
2016-10-11 13:03:35 -07:00
9ac2c8072a build: Added support for debugging using delve, gdb, etc 2016-10-12 01:00:15 +05:30
a7247b3c7e Merge pull request #6618 from heyitsanthony/fix-e2e-err-leak
e2e: close process if spawnWithExpects fails
2016-10-11 11:30:28 -07:00
2448f6a003 e2e: close process if spawnWithExpects fails
Was causing a process leak in TestCtlV3Alarm
2016-10-10 15:52:37 -07:00
d7f69d0f92 Merge pull request #6617 from gyuho/vendor-update
vendor: update glide and grpc-go
2016-10-10 14:48:17 -07:00
4a07bbec59 clientv3: implement new grpc.Balancer interface 2016-10-10 11:18:29 -07:00
e3558a64cf vendor: update grpc-go v1.0.2 tag
Fix https://github.com/coreos/etcd/issues/6529.
2016-10-10 11:18:01 -07:00
69ea359e62 vendor: update glide.yaml with grpc-go v1.0.2 tag 2016-10-10 11:17:47 -07:00
b9f3ef09e1 vendor: clean up dependencies (remove unused ones) 2016-10-10 11:17:27 -07:00
def1a3b77f script/updatedep: update glide, glide-vc version 2016-10-10 11:11:58 -07:00
3a6fe61c03 Merge pull request #6610 from heyitsanthony/bench-lease
benchmark: submit keepalive requests concurrently with report.Run()
2016-10-10 09:53:08 -07:00
fd60205e95 Merge pull request #6616 from bdarnell/genproto-gopath
scripts: Don't erase gopath.proto after genproto.sh
2016-10-10 09:19:49 -07:00
ef4e3ef55a scripts: Don't erase gopath.proto after genproto.sh
Wiping gopath.proto after a successful run does nothing but slow down
the next run unnecessarily as it downloads everything again.
2016-10-10 11:33:43 +08:00
602fd6a67e Merge pull request #6613 from mitake/ep-health
etcdctl: parse auth related options in endpoint health command
2016-10-09 06:58:06 -07:00
644ec0ddef etcdctl, e2e: parse auth related options in endpoint health command
Partially fixes https://github.com/coreos/etcd/issues/6611
2016-10-09 20:34:09 +09:00
c1d115b322 benchmark: submit keepalive requests concurrently with report.Run()
Otherwise report won't consume the results and the benchmark hangs.
2016-10-07 15:57:38 -07:00
ac4d39cfb0 Merge pull request #6583 from sinsharat/windows_etcd3.0.1_etcdctlv2api_issue_fix
etcdctlv2: windows compatibility issue fix for etcd v3.0.1
2016-10-07 13:58:57 -07:00
3f60ee0d27 Merge pull request #6590 from gyuho/etcdserver
etcdserver: separate EtcdServer from raftNode
2016-10-07 13:39:37 -07:00
e011ea25ca etcdserver: separate EtcdServer from raftNode 2016-10-07 13:18:39 -07:00
e1e16d9b28 Merge pull request #6608 from gyuho/news
NEWS: add 'prev-kv' feature for upcoming v3.0.11
2016-10-07 12:43:17 -07:00
ab2a20402e NEWS: add 'prev-kv' feature for upcoming v3.0.11 2016-10-07 11:22:02 -07:00
71f8f3ceb6 Merge pull request #6607 from glevand/for-merge-typo
Documentation: Minor typo fix
2016-10-07 10:31:38 -07:00
f1437a8932 Documentation: Minor typo fix
Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-10-07 10:17:43 -07:00
75f812eaa3 etcdctlv2: windows compatibility issue fix for etcd v3.0.1 2016-10-07 22:15:30 +05:30
4e4140040a Merge pull request #6602 from nekto0n/watchable_store_bench
mvcc: add BenchmarkWatchableStoreTxnPut benchmark
2016-10-07 09:13:44 -07:00
e2bd6f2213 Merge pull request #6601 from nekto0n/interval_tree_fast_stab
adt: fast path Stab in empty interval tree
2016-10-07 09:13:23 -07:00
f3cdfcdcf4 Merge pull request #6486 from glevand/for-merge-arm64
Get tests working on ARM64
2016-10-06 17:53:10 -07:00
686282393d Merge pull request #6600 from heyitsanthony/report
benchmark: split out report and add --precise option
2016-10-06 17:14:08 -07:00
e7d8292cd1 benchmark: add --precise flag
Usually benchmark writes with %4.4f; this adds optional %g formatting.
2016-10-06 16:18:47 -07:00
3d28faa3eb pkg/report, tools/benchmark: refactor report out of tools/benchmark
Only tracks time series when requested. Can configure output precision.
2016-10-06 16:18:47 -07:00
ea9e857eb9 Merge pull request #6599 from fanminshi/lease_error_type_fix
Lease: Add lease errors to togRPCError()
2016-10-06 15:47:51 -07:00
cbbd1f0f44 Merge pull request #6598 from xiang90/cleanup
v3rpc: return nil as error explicitly
2016-10-06 15:30:04 -07:00
a862fd9f0f Lease: Add lease errors to togRPCError()
This allows lease's function to convert lease error to appropriate GRPC errors
2016-10-06 14:29:31 -07:00
10cafe56b8 v3rpc: return nil as error explicitly 2016-10-06 14:14:43 -07:00
4a5fa261c6 Merge pull request #6596 from gyuho/protect-TTL
lease: add TTL() method
2016-10-06 11:41:51 -07:00
65ac718a11 etcdserver: use 'TTL()' on lease.Lease 2016-10-06 11:24:12 -07:00
5adca4a720 lease, leasehttp: add TTL() method
Fix https://github.com/coreos/etcd/issues/6595.
2016-10-06 11:24:09 -07:00
9970ded79f mvcc: add BenchmarkWatchableStoreTxnPut benchmark 2016-10-06 22:44:25 +05:00
eae70c9379 adt: fast path Stab in empty interval tree 2016-10-06 22:41:33 +05:00
b8079b7fc0 Merge pull request #6594 from heyitsanthony/e2e-etcdctl-timeout
e2e: print correct timeout for etcdctl tests
2016-10-06 10:40:46 -07:00
fa1e28102e Merge pull request #5316 from ajityagaty/too_many_allocs
mvcc: Reduce number of allocs in PUT when watchableStore has no watchers.
2016-10-06 09:47:59 -07:00
e28706d9e2 e2e: print correct timeout for etcdctl tests 2016-10-06 09:18:41 -07:00
cc04d80b09 Merge pull request #6578 from glevand/for-merge-serial
test: Run integration pass in series
2016-10-05 19:28:15 -07:00
54c252ee63 clientv3/kv_test: Fix quota test
Updates TestKVPutError.  Change the quota to work with systems
that have a 64 KiB page size. Increase the db sync wait time to
one second.  Also, add some comments for the hard coded value.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-10-05 16:41:06 -07:00
84d2ff93b0 integration/v3_grpc_test: Fix quota tests
Use the system page size to set the test quota size.  Also, change
a comment related to setting the node quota to be more clear.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-10-05 16:41:06 -07:00
de8adc9e03 e2e/ctl_v3_alarm_test: Fix quota test
Rework the over quota test to be more a realistic test.  Take into
consideration that the system page size will be different across
platforms.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-10-05 16:41:06 -07:00
8c60a532a6 e2e/ctl_v3_alarm_test: Use fixed small buf size
We just need a small chunk of data to test put, so to be
consistent across platforms use a fixed size of 64 bytes.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-10-05 16:41:06 -07:00
beb194967e Documentation: Improve quota example
Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-10-05 16:41:06 -07:00
bdbb32dfe8 Documentation: Set ETCDCTL_API for v3 features
Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-10-05 16:41:06 -07:00
b65a2cec18 Documentation: Clearify Space quota section
Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-10-05 16:41:06 -07:00
f0469f7f25 Merge pull request #6570 from xiang90/lease_expire
Fix lease expire
2016-10-05 15:49:45 -07:00
3cbc5285e0 test: Run integration pass in series
On slower or heavily loaded platforms running the integration pass in
parallel results in test timeout errors.

Rename the integration_pass function to integration_e2e_pass, and add two
new functions integration_pass and e2e_pass.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-10-05 15:35:14 -07:00
0f0c048e29 etcdserver: fix early lessor promotion issue
If we promote the lessor before finish applying all
entries from the last term, we might incorrectly renew
the already revoked leases.

Here is an example:

- Term 1: revoke lease A accepted by raft
- Old leader failed, new election happened
- Term 2: promote
- Term 2: keep alive A succeed. A now has 10 seconds TTL
- Term 2: revoke lease A from Term 1 got committed and applied
- Term 2: the lease A with 10 seconds TTL is revoked

To solve this, the new leader MUST apply all entries from old term
before promote its lessor to start accept renew requests.
2016-10-05 14:41:47 -07:00
279c103517 lease: fix lease expire and add a test 2016-10-05 14:41:47 -07:00
7f0d5946ff Merge pull request #6589 from heyitsanthony/etcdctl-lock-one-session
etcdctl: remove superfluous session in lock command
2016-10-05 14:36:11 -07:00
b980ab0c67 Merge pull request #6582 from heyitsanthony/fix-cancel-close
clientv3: only return closing error to watcher if context is not canceled
2016-10-05 13:37:29 -07:00
f2af08f5aa etcdctl: remove superfluous session in lock command 2016-10-05 13:30:36 -07:00
f67f8d3b31 Merge pull request #6587 from heyitsanthony/watch-fix-revrace
clientv3: fix race on watch initial revision
2016-10-05 10:55:31 -07:00
d5cd563ce7 Merge pull request #6572 from glevand/for-merge-release_pass
Fixes for release_pass test
2016-10-05 09:42:16 -07:00
06d5cf2d52 clientv3: fix race on watch initial revision
The initial revision was being updated in the substream goroutine defer;
this was racing with the resume path fetching the initial revision when
the substream closes during resume. Instead, update the initial revision
whenever the substream processes a new watch response. Since the substream
cannot receive a watch response while it is resuming, the write to the
initial revision is ordered to always happen after the resume read.

Fixes #6586
2016-10-05 09:36:06 -07:00
e285f599e2 clientv3: only return closing error to watcher if context is not canceled
Fixes #6503
2016-10-04 16:09:50 -07:00
8e1c989ec3 integration: test a canceled watch won't return a closing error 2016-10-04 14:47:40 -07:00
98897b7603 Merge pull request #6580 from spoonben/fix-404-docs
docs: link directly to github procfile
2016-10-04 13:54:10 -07:00
25f1088edd test: Fixes for release_pass
Some fixes related to release_pass:

o Create the output directory ./bin if it does not exist.
o Define the GOARCH variable if it is not defined.
o Simplify the race detection test.
o Download the relese archive based on GOARCH.
o If the release file is not found, return success.  This will allow the tests
  to continue.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-10-04 13:42:53 -07:00
9c5a32eb7a docs: link directly to github procfile
This is in response to https://github.com/coreos/docs/issues/822
Unfortunately because of how the doc sync works there has to be
a direct link here.
2016-10-04 13:42:17 -07:00
5269bbd277 Merge pull request #6513 from gyuho/manual
raft: refactor inflight
2016-10-04 13:31:43 -07:00
dc8bf26cd8 raft: refactor inflight 2016-10-04 13:12:16 -07:00
19122b463e Merge pull request #6525 from heyitsanthony/watcher-disconn
clientv3: simplify watcher synchronization
2016-10-04 11:21:12 -07:00
02f557068e Merge pull request #6576 from xiang90/fix_doc
doc: build should work for non-github users
2016-10-04 10:32:37 -07:00
904e5090fd doc: build should work for non-github users 2016-10-04 10:26:51 -07:00
5b50658118 clientv3: simplify watch synchronization
Was more complicated than it needed to be and didn't really work in the
first place. Restructured watcher registation to use a queue.
2016-10-03 16:56:14 -07:00
9ce398f8a6 integration: test canceling watchers when disconnected 2016-10-03 16:56:14 -07:00
33e4f2ea28 Merge pull request #6563 from gyuho/gen-proto
scripts/genproto: use 'gopath.proto' for $GOPATH
2016-10-03 15:54:38 -07:00
9b56e51ca7 *: regenerate proto + gofmt change 2016-10-03 15:34:34 -07:00
8174fcf201 scripts/genproto: use 'gopath.proto' for $GOPATH 2016-10-03 15:34:31 -07:00
dfe85b26cc Merge pull request #6571 from xiang90/log_pkg
*: set repo correctly for logging
2016-10-03 15:49:44 -05:00
b7f02a8c0a Merge pull request #6568 from gyuho/e2e
e2e: test 'https' scheme endpoints
2016-10-03 13:24:00 -07:00
29dd3cf5bd Revert "clientv3/integration: add TestDialWithHTTPS"
This reverts commit a96a28d603.
2016-10-03 13:05:08 -07:00
0dc14d1771 e2e: test 'https' scheme endpoints 2016-10-03 13:04:58 -07:00
c26ebe3262 Merge pull request #6453 from vimalk78/wal-optimize-marshal-outside-lock
wal/wal.go: optimized WAL.SaveSnapshot to do Marshal outside the mutex lock
2016-10-03 11:50:11 -07:00
dd607b5eff Merge pull request #6560 from gyuho/scheme
clientv3: handle 'https' scheme in endpoint
2016-10-03 09:44:46 -07:00
a96a28d603 clientv3/integration: add TestDialWithHTTPS 2016-10-03 02:16:07 -07:00
962433c17f *: set repo correctly for logging 2016-10-03 17:03:22 +08:00
f45542394b clientv3: handle 'https' scheme in endpoint 2016-10-03 01:03:28 -07:00
02912fe8c4 Merge pull request #6564 from gyuho/nil-ref
e2e: skip when 'etcdProcess' is nil
2016-10-01 01:32:56 -07:00
5c51c600aa e2e: skip when 'etcdProcess' is nil 2016-10-01 00:45:28 -07:00
37bd0932f7 Merge pull request #6557 from heyitsanthony/fix-publish-retry
etcdserver: use stream recorder for TestPublishRetry
2016-09-30 18:40:18 -07:00
613525f711 Merge pull request #6559 from heyitsanthony/fix-lease-hash
lessor: delete keys in deterministic order on revoke
2016-09-30 17:23:00 -07:00
4f9be94643 lessor: delete keys in deterministic order on revoke
Fixes #6558
2016-09-30 16:45:52 -07:00
289e3c0c63 etcdserver: use stream recorder for TestPublishRetry
Fixes #6546
2016-09-30 15:43:32 -07:00
7225c77a3b Merge pull request #6556 from gyuho/simplify
lease: remove redundant lookup methods
2016-09-30 11:19:14 -07:00
4871a4a5f3 lease: remove redundant get method 2016-09-30 10:27:27 -07:00
c349e089b1 Merge pull request #6550 from heyitsanthony/watch-prog-notify
clientv3: make IsProgressNotify() false on compact event and closed channel
2016-09-29 11:12:25 -07:00
6ac284a577 grpcproxy: use valid progress notification in broadcast test 2016-09-29 10:45:25 -07:00
dac6e700f8 Merge pull request #6519 from mitake/functional-tester
functional-tester: decoupling functionalities of etcd-tester
2016-09-29 10:07:47 -07:00
868617ef86 Merge pull request #6548 from gyuho/get-config-embed
embed: add 'Config' method
2016-09-29 09:14:32 -05:00
b8017004ba embed: add 'Config' method 2016-09-29 07:10:59 -07:00
a781f4ebda Merge pull request #6551 from xiang90/fix_log_repo
pkg: use etcd as logging repo
2016-09-29 02:46:57 -05:00
9473e9c30e pkg: use etcd as logging repo 2016-09-29 15:29:38 +08:00
d80c13555a Merge pull request #6543 from xiang90/improve_txn
etcdserver: use linearizableReadNotify for txn
2016-09-28 19:54:30 -05:00
bf2581390d clientv3: make IsProgressNotify() false on compact event and closed channel
Fixes #6549
2016-09-28 16:49:39 -07:00
0ca0260c89 Merge pull request #6531 from sinsharat/glossary_update
Documentation/learning: Glossary update
2016-09-28 11:39:02 -07:00
2353cbca71 Merge pull request #6544 from gyuho/page-offset
wal, ioutil: set page offset for encoder
2016-09-28 11:37:24 -07:00
f5588526cc wal: set PageWriter offset in file encoder 2016-09-28 11:03:24 -07:00
d0c29cc610 pkg/ioutil: configure pageOffset in NewPageWriter 2016-09-28 09:45:54 -07:00
0b8b40ccca Merge pull request #6545 from gyuho/grammar
wal: fix minor wording in comment
2016-09-28 09:34:43 -07:00
231530e0c5 wal: fix minor wording in comment 2016-09-28 09:12:31 -07:00
ea0c65797a etcdserver: use linearizableReadNotify for txn 2016-09-28 20:47:49 +08:00
6c2414ebd1 Documentation/learning: Glossary update 2016-09-28 11:18:47 +05:30
f4ec303d1b wal/wal.go: modified WAL.SaveSnapshot to do the Marshal before aquiring the mutex 2016-09-28 10:35:19 +05:30
1e1dd24d05 Merge pull request #6536 from sinsharat/etcdctlv3_readme_update
etcdctlv3: minor updates to put and make-mirror command
2016-09-27 23:58:42 -05:00
dcfbcb7a68 etcdctlv3: minor updates to put and make-mirror command 2016-09-28 10:20:08 +05:30
3807faeddf Merge pull request #6541 from hhkbp2/improve-test-coverage
raft: add test cases to improve test coverage
2016-09-27 23:24:52 -05:00
eee23eaf43 Merge pull request #6540 from fanminshi/lease_panic_fix
etcdserver: fix a node panic bug caused LeaseTimeToLive call on a nonexistent lease
2016-09-27 23:17:16 -05:00
7d48855630 functional-tester: decouple failures from tester
This commit adds a new option --failures to etcd-tester. The option
receives a comma-delimited argument like this:
"default,failpoints". The given arguments are interpreted as names of
failures and they are injected to an etcd cluster. Available failures
are default (default scenario in etcd-tester) and failpoints. If no
args are passed to the option (--failures=""), no failures are
injected during testing.
2016-09-28 11:30:53 +09:00
a6eb2939b1 raft: add test cases to improve test coverage 2016-09-28 10:19:30 +08:00
8ef6687018 etcdserver: fix a node panic bug caused LeaseTimeToLive call on a nonexistent lease
When the non Leader etcd server receives a LeaseTimeToLive on a nonexistent lease, it responds with a nil resp and a nil error The invoking function parses the nil resp and results a segmentation fault.
I fix the bug by making sure the lease not found error is returned so that the invoking function parses the the error message instead.

fix #6537
2016-09-27 17:46:30 -07:00
e68cd086ee Merge pull request #6532 from heyitsanthony/no-gopath-build
build: support building out of path when GOPATH is not set
2016-09-27 13:25:04 -07:00
1e3a71d098 build: support building out of path when GOPATH is not set
Otherwise gets "go: GOPATH entry is relative; must be absolute path: ""."
2016-09-27 10:20:52 -07:00
150576fa72 Merge pull request #6212 from xiang90/readindex
etcdserver: initial read index implementation
2016-09-27 11:51:08 -05:00
e5f4fb1a79 Merge pull request #6527 from sinsharat/intracting_v3
etcdctlv3: interactive_v3 compaction and timetolive command update
2016-09-27 06:14:18 -05:00
ab20187f93 etcdctlv3: interactive_v3 compaction and timetolive command update 2016-09-27 16:19:55 +05:30
6167a2aaa7 Merge pull request #6524 from sinsharat/intracting_v3
etcdctlv3: interactive_v3 watch command update
2016-09-27 01:35:04 -05:00
e3e3993022 etcdserver: support read index
Use read index to achieve l-read.
2016-09-27 13:41:40 +08:00
7d9355ffba Merge pull request #6523 from vimalk78/correct-compactor-logger-package
compactor/compactor.go : corrected the capnslog package name
2016-09-26 14:21:24 -07:00
cd1306f866 etcdctlv3: interactive_v3 watch command update 2016-09-27 00:00:05 +05:30
e1550bae61 compactor/compactor.go: corrected the capnslog package name 2016-09-26 23:52:48 +05:30
e1efdd591e Merge pull request #6521 from sinsharat/intracting_v3
etcdctlv3: interactive_v3 del command update
2016-09-26 10:48:09 -05:00
83f2fa7adc etcdctlv3: interactive_v3 del command update 2016-09-26 19:56:20 +05:30
e2d51961dd Merge pull request #6520 from sinsharat/intracting_v3
etcdctlv3: interactive_v3 get command update
2016-09-26 07:20:44 -05:00
213e8a5b15 Merge pull request #6514 from gyuho/sort
test: grep versions with --sort
2016-09-26 06:31:05 -05:00
595743651b etcdctlv3: interactive_v3 get command update 2016-09-26 16:28:29 +05:30
06546cf100 Merge pull request #6517 from sinsharat/intracting_v3
etcdctlv3: interactive_v3 version and put command update
2016-09-26 03:53:13 -05:00
7a95831018 etcdctlv3: interactive_v3 version and put command update 2016-09-26 12:32:08 +05:30
cf83de6488 Merge pull request #6510 from sinsharat/etcdctlv3_readme_final_draft
etcdctlv3:corrected and organised etcdctl commands
2016-09-25 19:19:06 -05:00
f5b9238a3c Merge pull request #6516 from gyuho/vvv
vendor: remove unused code
2016-09-23 18:54:05 -07:00
f957c401d3 vendor: remove unused code 2016-09-23 16:57:28 -07:00
20211ed6bf test: grep versions with --sort 2016-09-23 15:49:20 -07:00
cf09562e40 Merge pull request #6512 from gyuho/dep
vendor: update 'google/btree'
2016-09-23 13:21:52 -07:00
ecb577d40c vendor: update 'google/btree' 2016-09-23 12:54:25 -07:00
15d268709e version: bump to v3.1.0-alpha.1+git 2016-09-23 11:32:39 -07:00
2469a95685 version: bump to v3.1.0-alpha.1 2016-09-23 11:19:22 -07:00
4ef44d1130 Merge pull request #6506 from mitake/decouple-stresser
functional-tester: decouple stresser from tester
2016-09-23 10:05:03 -07:00
044e5cf3a9 Merge pull request #6498 from ychen11/ychen11/etcdserverpb
Added more lines of comments into rpc.proto
2016-09-23 10:04:24 -07:00
0e493c11c2 functional-tester: decouple stresser from tester
This commit decouples stresser from the tester of
functional-tester. For doing it, this commit adds a new option
--stresser to etcd-tester. The option accepts two types of stresser:
"default" and "nop". If the option is "default", etcd-tester stresses
its etcd cluster with the existing stresser. If the option is "nop",
etcd-tester does nothing for stressing.

Partially fixes https://github.com/coreos/etcd/issues/6446
2016-09-24 01:04:57 +09:00
69f5b4ba79 Documentation:made watch request doc more clear 2016-09-23 23:13:55 +08:00
af8728f328 etcdctlv3:corrected and organised etcdctl commands 2016-09-23 18:21:54 +05:30
51aa220449 Merge pull request #6507 from sinsharat/readme_del_cmd_options_example_update
etcdctlv3 : added options and examples for del from-key
2016-09-22 17:08:50 -05:00
308038e96a etcdctlv3 : added options and examples for del from-key 2016-09-22 22:54:20 +05:30
b1e4defc48 Merge pull request #6501 from sinsharat/feature_add_del_from-key
etcdctlv3: del command from-key feature added
2016-09-22 09:15:04 -05:00
804e215981 Merge pull request #6505 from sinsharat/compaction_options_update
etcdctlv3: updated compaction options
2016-09-22 06:52:43 -07:00
5fa233a564 etcdctlv3: updated compaction options 2016-09-22 19:06:05 +05:30
35ff70656b etcdctlv3: del command from-key feature added 2016-09-22 16:55:36 +05:30
ea97aa3f0f Merge pull request #6504 from sinsharat/member_command_options_update
etcdctlv3: updated member command options
2016-09-22 03:47:49 -07:00
1601ee761a etcdctlv3: updated member command options 2016-09-22 15:04:54 +05:30
4de39d3683 Merge pull request #6502 from xiang90/etcdctl_mirror
etcdctl: remove the use of remprefix
2016-09-22 01:05:55 -05:00
30b26f8f50 etcdctl: remove the use of remprefix 2016-09-22 08:43:31 +08:00
3453ce55e3 Merge pull request #6496 from sinsharat/refactor_mirror_command_tests
e2e: refactored ctlv3_make_mirror_test
2016-09-21 19:33:42 -05:00
4ec0fce109 Merge pull request #6493 from gyuho/tester-build
functional-tester: build from repo root, vendor
2016-09-21 16:57:34 -07:00
27c500d8d0 Merge pull request #6487 from heyitsanthony/watch-stress
clientv3: process closed watcherStreams in watcherGrpcStream run loop
2016-09-21 13:55:25 -07:00
3f7f6fb557 Merge pull request #6500 from sinsharat/readme_del_option_update
etcdctlv3: updated del command options
2016-09-21 13:54:18 -07:00
a32518006c clientv3: process closed watcherStreams in watcherGrpcStream run loop
Was racing with Watch() when closing the grpc stream on no watchers.

Fixes #6476
2016-09-21 13:28:00 -07:00
bcda9af15d etcdctlv3: updated del command options 2016-09-22 00:16:53 +05:30
d743b8b866 Merge pull request #6474 from gyuho/auto-sync
clientv3: add 'Sync' method
2016-09-21 10:57:10 -07:00
deef16b376 integration: test client watchers with overlapped context cancels 2016-09-21 09:40:24 -07:00
592538986d e2e: refactored ctlv3_make_mirror_test 2016-09-21 22:07:03 +05:30
cdb1e34799 clientv3: add 'Sync' method 2016-09-21 09:10:25 -07:00
c016325647 Merge pull request #6495 from vimalk78/wal-improve-coverage-add-testcase-save-with-cut
wal/wal.go : improved coverage by testing WAL.Save which causes a WAL…
2016-09-21 11:04:21 -05:00
4426e282d6 Merge pull request #6497 from gyuho/raft-example
raftexample: remove snapshot TODO in README
2016-09-21 08:44:04 -07:00
3492753edf e2e: refactored ctlv3_make_mirror_test 2016-09-21 20:01:24 +05:30
113b27229b raftexample: remove snapshot TODO in README 2016-09-21 05:07:04 -07:00
13e7172b4b Merge pull request #6244 from gyuho/raft-example
raftexample: implement Raft snapshot
2016-09-21 04:55:29 -07:00
e4fbf7db00 raftexample: implement Raft snapshot 2016-09-21 04:23:05 -07:00
4b83f40618 raftexample: add index fields to filter entries 2016-09-21 04:23:05 -07:00
666d555450 raftexample: add snapshotter, handle Ready in raft 2016-09-21 04:23:05 -07:00
15fa8dd866 raftexample: add snapshot methods to kvstore 2016-09-21 04:23:01 -07:00
064411b51c wal/wal.go : improved coverage by testing WAL.Save which causes a WAL.cut to happen 2016-09-21 16:50:55 +05:30
d3906e75bf Merge pull request #6494 from sinsharat/update_snapshot_restore_options
etcdctlv3: updated snapshot restore options
2016-09-21 05:50:34 -05:00
05175480b3 etcdctlv3: updated snapshot restore options 2016-09-21 16:17:32 +05:30
0604fccfea Merge pull request #6492 from sinsharat/make-mirror_no_dest_test
etcdctlv3: test case: make-mirror no dest prefix
2016-09-21 03:12:01 -07:00
cff06ef64d Merge pull request #6491 from gyuho/functional
functional-tester: use different ports in Procfile
2016-09-21 02:54:54 -07:00
409fc439d1 etcdctlv3: test case: make-mirror no dest prefix 2016-09-21 15:12:36 +05:30
b2c4992a82 functional-tester: use different ports in Procfile 2016-09-21 02:39:45 -07:00
e8adc24c32 functional-tester: build from repo root, vendor 2016-09-21 02:06:13 -07:00
d6a3ce17d5 Merge pull request #6472 from sinsharat/make-mirror_modify_dest_test
etcdctlv3: test case: make-mirror modify dest prefix
2016-09-21 00:43:56 -07:00
e5ff5d92e6 etcdctlv3: test case: make-mirror modify dest prefix 2016-09-21 05:40:52 +05:30
b91d8625c8 Merge pull request #6485 from sinsharat/readme_get_features_update
ctlv3: updated readme for options and examples for get command
2016-09-21 07:26:46 +08:00
9743ee8b83 etcdctlv3: updated readme for options and examples for get command 2016-09-21 04:51:13 +05:30
095cff4415 Merge pull request #6478 from heyitsanthony/untangle-check
etcd-tester: split out consistency checking code from tester
2016-09-20 10:56:17 -07:00
d4eff5381c etcd-tester: split out consistency checking code from tester 2016-09-20 10:26:58 -07:00
3da8c6512b Merge pull request #6481 from sinsharat/update_timetolive_options
etcdctlv3: updated options for TIMETOLIVE
2016-09-20 23:29:15 +08:00
3e67702d4b etcdctlv3: updated options for TIMETOLIVE 2016-09-20 16:40:58 +05:30
b586060812 Merge pull request #6475 from fanminshi/leaseparallel
etcdserver: parallelize expired leases process
2016-09-19 16:46:31 -07:00
690a0b6f00 etcdserver: parallelize expired leases process
When 1000 leases expired at the same time, etcd takes more than 5 seconds to clean them. This means that even after the leases have expired, keys associated with leases are still accessible. I increase the deletion throughput by parallelizing leases deletion process.
2016-09-19 16:17:49 -07:00
69c7ea0b4a Merge pull request #6473 from heyitsanthony/watchreconn-putretry
integration: l-read before Put in TestWatchReconnRequest
2016-09-19 14:52:26 -07:00
0fb2cab221 integration: l-read before Put in TestWatchReconnRequest
TestWatchReconnRequest occasionally triggers elections because it spins on
drop connections, eating up CPU. In case there's an election, submit an
l-read to wait for the cluster to settle down.

Fixes #6314
2016-09-19 14:14:32 -07:00
c9e06fa1ed Merge pull request #6330 from gyuho/balancer-sync
clientv3: add SetEndpoints method
2016-09-20 04:52:13 +09:00
d26cfdb7d1 Merge pull request #6425 from heyitsanthony/etcdserver-wg
etcdserver: tighten up goroutine management
2016-09-19 12:51:16 -07:00
f11b35eb71 clientv3/integration: test 'SetEndpoints' 2016-09-20 04:36:14 +09:00
b9d18d4ac9 clientv3: add 'SetEndpoints' method 2016-09-20 04:36:01 +09:00
3866e78c26 etcdserver: tighten up goroutine management
All outstanding goroutines now go into the etcdserver waitgroup. goroutines are
shutdown with a "stopping" channel which is closed when the run() goroutine
shutsdown. The done channel will only close once the waitgroup is totally cleared.
2016-09-19 12:10:41 -07:00
a70513621c Merge pull request #6470 from xiang90/fix_doc
doc: use 2379 as port of the first member in local cluster
2016-09-19 08:34:11 -05:00
328c42f1b7 doc: use 2379 as port of the first member in local cluster 2016-09-19 21:28:33 +08:00
2dc06787ae Merge pull request #6467 from coreos/revert-6465-tls-copy
Revert "pkg/transport: update tls.Config copy method"
2016-09-19 16:02:41 +09:00
629d9e7dab Revert "pkg/transport: update tls.Config copy method" 2016-09-19 15:07:12 +09:00
db9ed233dc Merge pull request #6465 from gyuho/tls-copy
pkg/transport: update tls.Config copy method
2016-09-19 00:46:08 +09:00
8c9a88c7d4 pkg/transport: update tls.Config copy method
For Go 1.7
2016-09-18 22:50:45 +09:00
33dbf5c6bd Merge pull request #6463 from xiang90/fix_http
embed: fix go 1.7 http issue
2016-09-18 08:44:04 -05:00
7a48ca4cea embed: fix go 1.7 http issue
go 1.7 introduces HTTP2 compability issue. Now we
need to explicitly enable HTTP2 when TLS is set.
2016-09-18 18:38:55 +08:00
ac2077559d Merge pull request #6461 from gyuho/travis
travis: test with Go 1.7.1
2016-09-17 22:10:09 +09:00
63d6a4e0e1 travis: test with Go 1.7.1 2016-09-17 20:57:28 +09:00
4a7c1da9b3 Merge pull request #6460 from sinsharat/readme_update
etcdctlv3: updated readme for make-mirror: modify/remove prefix in dest cluster
2016-09-17 19:57:15 +09:00
6c408eb779 etcdctlv3:updated readme.md for make-mirror modify/remove prefix in dest cluster 2016-09-17 16:13:01 +05:30
86aeeca644 Merge pull request #6454 from sinsharat/windows_save_snapshot_fix
ctlv3: close snapshot file before rename (Windows)
2016-09-16 18:09:59 -05:00
0d65061a2d Merge pull request #6439 from sinsharat/make_mirror_feature_add
etcdctl/ctlv3: make-mirror: feature add to modify/remove prefix in dest cluster
2016-09-16 18:07:20 -05:00
01a0db0fce Merge pull request #6456 from heyitsanthony/version-bump-git
version: bump to 3.1.0-alpha.0+git
2016-09-16 15:12:30 -07:00
0a8bf60a9d version: bump to 3.1.0-alpha.0+git 2016-09-16 09:56:29 -07:00
fef6557f6c ctlv3: close snapshot file before rename (Windows) 2016-09-16 21:55:04 +05:30
b571f4d627 etcdctl/ctlv3: feature added to modify/remove prefix in the destination cluster 2016-09-16 18:48:41 +05:30
5c2053109b Merge pull request #6449 from gyuho/supported-stream
rafthttp: add v3.x to supported streams
2016-09-16 21:47:20 +09:00
8827619f5b rafthttp: add v3.x to supported streams 2016-09-16 20:49:00 +09:00
143e2f27fc Merge pull request #6447 from xiang90/cap
api: update capability map
2016-09-16 02:35:26 -05:00
d6904ce415 Merge pull request #6441 from petermattis/pmattis/tick-quiesced
raft: add RawNode.TickQuiesced
2016-09-16 01:48:21 -05:00
c6feb695dc api: update capability map 2016-09-16 14:34:55 +08:00
37fa6ac45c raft: add RawNode.TickQuiesced
TickQuiesced allows the caller to support "quiesced" Raft groups which
do not perform periodic heartbeats and elections. This is useful in a
system with thousands of Raft groups where these periodic operations can
be overwhelming in an otherwise idle system.

It might seem possible to avoid advancing the logical clock at all in
such Raft groups, but doing so has an interaction with the CheckQuorum
functionality. If a follower is not quiesced while the leader is the
follower can call an election that will fail because the leader's lease
has not expired (electionElapsed < electionTimeout). The next time the
leader sends a heartbeat to this follower the follower will see that the
heartbeat is from a previous term and respond with a MsgAppResp. This in
turn will cause the leader to step down and become a follower even
though there isn't a leader in the group. By allowing the leader's
logical clock to advance via TickQuiesced, the leader won't reject the
election and there will be a smooth transfer of leadership to the
follower.
2016-09-15 21:05:18 -04:00
2724c3946e Merge pull request #6444 from heyitsanthony/version-bump-3.1
version: bump to 3.1.0-alpha.0
2016-09-15 15:24:59 -07:00
c658fa62c5 version: bump to 3.1.0-alpha.0 2016-09-15 15:13:51 -07:00
624eb609fa Merge pull request #6443 from gyuho/news
NEWS: add v3.0.8, v3.0.9
2016-09-16 07:09:42 +09:00
1b1e54a281 NEWS: add v3.0.8, v3.0.9 2016-09-16 07:05:31 +09:00
9913e0073c Merge pull request #6438 from gyuho/e2e-backends
e2e: rename 'backends' to 'processes'
2016-09-15 19:00:28 +09:00
7cd7b5d539 e2e: rename 'backends' to 'processes' 2016-09-15 18:30:08 +09:00
a12b317552 Merge pull request #6428 from gyuho/snapshot-test
e2e: test snapshot restore
2016-09-15 04:22:03 -05:00
bb337c87d0 e2e: test snapshot restore 2016-09-15 17:58:00 +09:00
fb760b4c53 Merge pull request #6403 from vimalk78/rafthttp-mertics-record-rw-failures
rafthttp/metrics.go:fixed TODO: record write/recv failures.
2016-09-15 02:46:20 -05:00
d814804fa1 Merge pull request #6437 from sinsharat/readme_update
etcdctl: readme.md display fix
2016-09-15 16:20:42 +09:00
cd3a7fb833 etcdctl: readme.md display fix 2016-09-15 12:23:56 +05:30
64e1a327ee rafthttp/metrics.go:fixed TODO: record write/recv failures. 2016-09-15 11:32:08 +05:30
b3a083d336 Merge pull request #6436 from LiamHaworth/bugfix/6433-support-for-charset-in-content-type-header
etcdserver, api, v2http, client: Added support for semicolons
2016-09-14 23:25:31 -05:00
5cfa9e2384 etcdserver, api, v2http, client: Added support for semicolons
Added support into the v2 API to fix an issue (6433) where if there is a semicolon
and fields after it the API would return an "invalid Content-type" message even
if the content type was actually correct
2016-09-15 13:54:22 +10:00
e77baa3dcb Merge pull request #6424 from heyitsanthony/v3api-createminmax
etcdserver: range queries with min/max create revision
2016-09-14 19:10:52 -07:00
059f419ac5 Merge pull request #6429 from xiang90/fix_balancer
clientv3: balancer panics when call up after close
2016-09-14 19:42:24 -05:00
82af0c4a7d ctlv3: remove superfluous session creation 2016-09-14 17:03:33 -07:00
9b1fe45853 concurrency: use create max revision for locks and elections 2016-09-14 17:03:33 -07:00
004a5f0dbc clientv3: balancer panics when call up after close
Fix the issue by adding a simple guard varable.
2016-09-15 07:43:42 +08:00
aa7a35798d integration: add tests for MinCreateRev and MaxCreateRev 2016-09-14 15:31:45 -07:00
5bd251a6fa clientv3: WithMinCreateRev, WithMaxCreateRev 2016-09-14 15:31:45 -07:00
c0981a90f7 etcdserver, etcdserverpb: range min_create_revision and max_create_revision 2016-09-14 15:31:45 -07:00
c74ac99871 Merge pull request #6423 from heyitsanthony/fix-rwmutex
recipes: fix rwmutex locking
2016-09-14 09:50:26 -07:00
3730802fef Merge pull request #6427 from mitake/prefix-print
etcdctl: improve printing of role get for prefix permission
2016-09-14 02:27:28 -05:00
8eac9fb93d Merge pull request #6401 from hhkbp2/add-read-index-for-raft-rawnode
raft: add read index for RawNode
2016-09-14 02:14:49 -05:00
4211c0b7af etcdctl, clientv3: improve printing of role get for prefix permission
This commit improves printing of role get command for prefix
permission. If a range permission corresponds to a prefix permission,
it is explicitly printed for a user. Below is an example of the new
printing:

$ ETCDCTL_API=3 bin/etcdctl --user root:p role get r1
Role r1
KV Read:
        [/dir/, /dir0) (prefix /dir/)
        [k1, k5)
KV Write:
        [/dir/, /dir0) (prefix /dir/)
        [k1, k5)
2016-09-14 16:10:32 +09:00
eeca614cd3 raft: add read index for RawNode 2016-09-14 14:43:46 +08:00
672472f85e Merge pull request #6414 from mitake/prefix-perm
etcdctl: an option for granting permission with key prefix
2016-09-13 23:29:40 -05:00
4e2b09a7ca etcdctl: an option for granting permission with key prefix
This commit adds a new option --prefix to "role grant-permission"
command. If the option is passed, the command interprets the key as a
prefix of range permission.

Example of usage:
$ ETCDCTL_API=3 bin/etcdctl --user root:p role grant-permission --prefix r1 readwrite /dir/
Role r1 updated
$ ETCDCTL_API=3 bin/etcdctl --user root:p role get r1
Role r1
KV Read:
        [/dir/, /dir0)
        [k1, k5)
KV Write:
        [/dir/, /dir0)
        [k1, k5)
$ ETCDCTL_API=3 bin/etcdctl --user u1:p put /dir/key val
OK
2016-09-14 12:54:14 +09:00
c350cd7679 Merge pull request #6417 from xiang90/fix_TestPipelineExceedMaximumServing
rafthttp: fix TestPipelineExceedMaximumServing
2016-09-13 17:59:43 -05:00
9b91e96510 integration: fix rwmutex test to check write locking 2016-09-13 14:09:59 -07:00
9f829fdab7 recipes: fix rwmutex so locking works
Fixes #6408
2016-09-13 14:09:59 -07:00
c6bfdb909b Merge pull request #6412 from heyitsanthony/revert-domain-listener
embed: warn on domain name in listener
2016-09-13 10:25:18 -07:00
afef9cc312 Merge pull request #6418 from sinsharat/update_readme
etcdctl\ctlv3: updated readme.md for timetolive example
2016-09-14 02:06:57 +09:00
6f4e3696d2 etcdctl\ctlv3: updated readme.md for timetolive example 2016-09-13 22:31:34 +05:30
c7212b438d embed: warn on domain name in listener 2016-09-13 09:17:40 -07:00
0d35ba9b94 rafthttp: fix TestPipelineExceedMaximumServing
The timeout is too short. It might take more than 10ms to send
request over a blocking chan (buffer is full). Changing the timeout
to 1 second can fix this issue.
2016-09-13 19:06:11 +08:00
e6a7f25065 Merge pull request #6411 from heyitsanthony/v3api-minmaxmod
etcdserver: Range with min/max mod revision
2016-09-13 05:54:58 -05:00
cfe717e926 Merge pull request #6275 from xiang90/raft_l
raft: support safe readonly request
2016-09-13 01:36:04 -05:00
8c492c70ef Merge pull request #6413 from xiang90/fix_wait
clientv3: return error from response when possible
2016-09-12 22:54:42 -05:00
56084a7cc8 clientv3: return error from response when possible 2016-09-13 11:18:21 +08:00
fa2e9c2449 Revert "Merge pull request #6365 from heyitsanthony/fix-dns-bind"
This reverts commit af5ab7b351, reversing
changes made to da6a0f0594.
2016-09-12 19:45:35 -07:00
17e7f83212 integration: test MinModRev/MaxModRev 2016-09-12 19:44:14 -07:00
b0481ba858 clientv3: WithMinModRev and WithMaxModRev 2016-09-12 19:44:14 -07:00
3df8838501 Merge pull request #6404 from glycerine/range_fixes
etcd/auth: fix range handling bugs.
2016-09-12 21:26:59 -05:00
af0264d2e6 etcdserver, etcdserverpb: add MinModRevision and MaxModRevision options to Range 2016-09-12 15:17:57 -07:00
ce01fb3cdf Merge pull request #6410 from fanminshi/master
etcd-tester: fix peer-port parsing bug with localhost url
2016-09-12 14:00:06 -07:00
8a63071463 etcd-tester: fix peer-port parsing bug with localhost url
The following format "http://localhost:1234" causes existing port parser to fail. Add new logic to parse the host name first then extract port.

Fixes #6409
2016-09-12 13:29:52 -07:00
ef1ef0ba16 auth: fix range handling bugs.
Test 15, counting from zero, in TestGetMergedPerms
in etcd/auth/range_perm_cache_test.go, was trying
incorrectly assert that [a, b) merged with [b, "")
should be [a, b). Added a test specifically for
this. This patch fixes the incorrect larger test
and the bugs in the code that it was hiding.

Fixes #6359
2016-09-12 09:23:19 -05:00
710b14ce56 raft: support safe readonly request
Implement raft readonly request described in raft thesis 6.4
along with the existing clock/lease based approach.
2016-09-12 15:13:52 +08:00
840f4d48c8 Merge pull request #6402 from gyuho/logger
*: separate 'capnslog' log level setting
2016-09-10 21:38:53 -05:00
bfb9d837d9 Merge pull request #6399 from AdoHe/master
update language bindings doc to add coreos/jetcd
2016-09-10 21:55:41 +09:00
caaa8a48aa libraries-and-tools.md: add Java client 2016-09-10 20:47:31 +08:00
03b9d6f24c *: separate 'capnslog' log level setting 2016-09-10 20:26:51 +09:00
9a67d71e6c Merge pull request #6396 from heyitsanthony/rafthttp-msg-leak
rafthttp: log stream stopped message before closing channel
2016-09-09 17:52:03 -05:00
8f47468a40 Merge pull request #6397 from fanminshi/master
functional-tester: correct goreman command in readme
2016-09-09 17:30:54 -05:00
a571655983 functional-tester: correct goreman command in readme
update readme file to have the correct goreman command to start the functional tester locally.
2016-09-09 14:56:23 -07:00
0250f0c984 rafthttp: log stream stopped message before closing channel
Was causing spurious goroutine leak failures in testing.
2016-09-09 12:47:06 -07:00
92f141d670 Merge pull request #6393 from sinsharat/readme_update
etcdctl:readme.md doc made uniform
2016-09-09 12:04:48 -07:00
d5edb62bd0 etcdctl:readme.md doc made uniform 2016-09-10 00:32:36 +05:30
b22b405465 Merge pull request #6390 from gyuho/simple
wal: simplify dir.Close call
2016-09-09 09:50:38 +09:00
20fc9dc463 Merge pull request #6389 from heyitsanthony/func-tester-noroot
functional-tester: run locally
2016-09-08 19:48:33 -05:00
ccb46d2024 wal: simplify dir.Close call 2016-09-09 09:23:55 +09:00
0b675845f6 Merge pull request #6321 from gyuho/lease-information
*: lease timetolive
2016-09-09 08:43:28 +09:00
aa6b1e6a10 functional-tester: add Procfile 2016-09-08 16:35:55 -07:00
b7dc6cc604 e2e: test 'lease timetolive' 2016-09-09 08:22:41 +09:00
04a4cea630 etcdctl/ctlv3: add 'lease timetolive' command 2016-09-09 08:21:58 +09:00
4c08f6767c clientv3: add lease.TimeToLive + tests 2016-09-09 08:18:45 +09:00
55ba3d95fb etcd-tester: support per-agent client/peer/failpoint ports 2016-09-08 16:15:18 -07:00
78cfc8db95 grpcproxy: implement 'LeaseTimeToLive' 2016-09-09 08:14:46 +09:00
63b0cd470d etcdserver: implement 'LeaseTimeToLive' 2016-09-09 08:14:14 +09:00
0712ebc9b5 v2http: handle '/leases/internal' 2016-09-09 08:12:31 +09:00
2e25a772a5 etcd-agent: support rootless operation and configurable gofail ports 2016-09-08 16:12:00 -07:00
617d2d5b98 lease/*: add lease handler for 'LeaseTimeToLive' 2016-09-09 08:11:46 +09:00
3132e36bf3 etcdserverpb: add 'LeaseTimeToLive' RPC 2016-09-09 08:08:14 +09:00
33b3fdc627 Merge pull request #6388 from groxxda/patch-1
etcd.service: order after network.target
2016-09-08 16:31:29 -05:00
758f0d9017 Merge pull request #6387 from sinsharat/fix_ctl_win
ctlv3: fix line parsing for Windows
2016-09-08 16:27:26 -05:00
17377f5642 example .service file: Order after network.target
From (systemd NetworkTarget description)[https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/]:
```
[...]since the shutdown ordering of units in systemd is the reverse of the startup ordering, any unit that is order After=network.target can be sure that it is stopped before the network is shut down if the system is powered off. This allows services to cleanly terminate connections before going down, instead of abruptly losing connectivity for ongoing connections, leaving them in an undefined state.[...]
```
2016-09-08 23:11:01 +02:00
8b764aac71 ctlv3: fix line parsing for Windows 2016-09-09 01:58:33 +05:30
bb3ba1ee1c Merge pull request #6381 from heyitsanthony/fix-wal-rename
wal: fsync directory after wal file rename
2016-09-08 12:56:50 -07:00
28d80ad709 Merge pull request #6370 from xiang90/fix_restore
etcdctl: restore should create a snapshot
2016-09-08 14:25:07 -05:00
e9f841627c Merge pull request #6384 from hhkbp2/add-test-case-for-leader-transfer-from-follower
raft: add test case for leader transfer from follower
2016-09-08 13:58:03 -05:00
4563efd766 Merge pull request #6382 from heyitsanthony/unhealthy-err
v3api, rpctypes: add ErrUnhealthy
2016-09-08 09:15:58 -07:00
68f2fdc1ff raft: add test case for leader transfer from follower 2016-09-08 17:22:52 +08:00
bd7107bd4b wal: fsync directory after wal file rename
Fixes #6368
2016-09-08 00:09:16 -07:00
c449da6ff9 fileutil: windows OpenDir
Windows needs to open a directory with write access to fsync but the go
runtime won't open directories that way.
2016-09-08 00:09:16 -07:00
0cc2f82e7e Merge pull request #6383 from gyuho/lease-client
clientv3: use correct context in toErr (lease)
2016-09-08 01:39:40 -05:00
1aec483e42 clientv3: use correct context in toErr (lease) 2016-09-08 10:58:11 +09:00
1defeda792 v3api, rpctypes: add ErrUnhealthy 2016-09-07 16:51:49 -07:00
0b6350227c Merge pull request #6341 from xiang90/handle_overload
grpcproxy: handle overloaded stream
2016-09-07 16:55:41 -05:00
656167d760 etcdctl: Corrected command in Readme.md (#6376)
Corrected command in Readme.md
2016-09-07 21:09:24 +09:00
a6c905ad96 Merge pull request #6367 from heyitsanthony/fix-watch-init-reconn
clientv3: drain buffered WatchResponses before resuming
2016-09-07 03:15:01 -05:00
f411583ed1 Merge pull request #6374 from sinsharat/master
etcdctlv3: Readme.md updated
2016-09-07 02:29:14 -05:00
534cb0b749 etcdctlv3: Readme.md updated
1. Under PUT example the put command was mentioned in capital which will
give the below error:
Error: unknown command "PUT" for "etcdctl"
Hence corrected the same.
2. The lease id is mentioned with 0x to denote hex but since its an
example, copy pasting the command will give the below error:
Error: bad lease ID (strconv.ParseInt: parsing "0x1234abcd": invalid
syntax), expecting ID in Hex
Hence modified the same to a sample correct value so that a user new to
etcd does not get confused.
3. The command ./etcdctl range foo does not work and gives the below
error:
Error: unknown command "range" for "etcdctl"
Hence corrected the same

#6372
2016-09-07 12:35:20 +05:30
7b7b29ad1e Merge pull request #6373 from vimalk78/master
pkg/pbutil: corrected the package name in logger in pbutil.go
2016-09-07 01:35:21 -05:00
5ea6990a73 corrected the package name in logger 2016-09-07 11:52:01 +05:30
ce49fb6ec4 raft: add tests for IsLocalMsg (#6357)
* raft: add tests for IsLocalMsg

* report index of failed tests
2016-09-07 12:52:37 +09:00
7e182fa24a etcdctl: restore should create a snapshot
Restore should create a snasphot. So the new db file
can be sent to newly joined member.
2016-09-07 11:21:53 +08:00
b24527f2f0 Merge pull request #6353 from petermattis/pmattis/grow-inflights-buffer
raft: grow the inflights buffer instead of preallocating
2016-09-07 09:51:45 +09:00
ad318ee891 clientv3: drain buffered WatchResponses before resuming
Otherwise, the watcherStream can receive WatchResponses in the
middle of a resume, corrupting the stream.

Fixes #6364
2016-09-06 17:15:39 -07:00
af5ab7b351 Merge pull request #6365 from heyitsanthony/fix-dns-bind
embed: reject domain names before binding
2016-09-06 16:02:46 -07:00
7644a8ad76 integration: test domain name URLs are rejected before binding 2016-09-06 15:33:47 -07:00
2752169d6a embed: reject binding listeners to domain names
Fixes #6336
2016-09-06 15:33:28 -07:00
c1948f2940 raft: grow the inflights buffer instead of preallocating
Grow the inflights buffer as needed instead of preallocating it to its
max size. This avoids preallocating a lot of unnecessary
space (8*MaxInflightMsgs) when using lots of raft groups while still
allowing for a reasonable MaxInflightMsgs configuration.
2016-09-06 18:07:01 -04:00
da6a0f0594 Merge pull request #6362 from kevinburke/fix-typo
Documentation: fix typo
2016-09-06 14:45:03 -05:00
96ed856bca Merge pull request #6345 from topecongiro/patch-1
rafthttp: remove unnecessary sendc from peer
2016-09-06 11:32:16 -07:00
e508ce36ef Documentation: fix typo
"its" in this case is not short for "it is", it should be a possessive.
2016-09-06 11:26:27 -07:00
0b9c65c82f Merge pull request #6360 from jonboulle/master
scripts, doc: remove actool references
2016-09-06 18:37:28 +02:00
fd0539c8cc scripts, doc: remove actool references
Since c597d591b5 the release script uses
acbuild instead of actool, so purge all the references and have the
release script check for acbuild's presence instead.
2016-09-06 17:47:41 +02:00
d36c0a1444 Merge pull request #6356 from mitake/root-role
auth, e2e: the root role should be granted access to every key
2016-09-06 15:31:20 +08:00
bc5d7bbe03 auth, e2e, clientv3: the root role should be granted access to every key
This commit changes the semantics of the root role. The role should be
able to access to every key.

Partially fixes https://github.com/coreos/etcd/issues/6355
2016-09-06 16:10:28 +09:00
271df0dd71 Merge pull request #6354 from es-chow/fix-typo-in-interacting_v3-md
interacting_v3.md: fix typo
2016-09-06 10:17:56 +09:00
b17b482268 interacting_v3.md: fix typo 2016-09-06 09:08:37 +08:00
65fb1ad362 Merge pull request #6351 from petermattis/pmattis/raft-global-rand
raft: use a singleton global rand
2016-09-05 22:25:18 +08:00
4a33aa3917 raft: use a singleton global rand
rand.NewSource creates a 4872 byte object. With a small number of raft
groups in a process this isn't a problem. With 10k raft groups we'd use
46MB for these random sources. The only usage is in
raft.resetRandomizedElectionTimeout which isn't performance critical.

Fixes #6347.
2016-09-05 09:03:18 -04:00
1ebeef5cbf Merge pull request #6350 from nekto0n/fix_message_limit
rafthttp: fix misprint in readBytesLimit value
2016-09-05 15:26:19 +09:00
1b40fe7709 Merge pull request #6348 from plasticbox/master
libraries-and-tools.md: remove C++
2016-09-05 15:07:23 +09:00
da26e230a0 rafthttp: fix misprint in readBytesLimit value
and make test path in restricted test environments
2016-09-05 11:06:08 +05:00
f36267bf74 libraries-and-tools.md: remove C++ 2016-09-05 15:03:07 +09:00
a66b1e7c60 Merge pull request #6349 from gyuho/decode-length-limit
rafthttp: check decode size before buffer alloc
2016-09-05 14:25:23 +09:00
5c8ba23767 rafthttp: check decode size before buffer alloc
Fix https://github.com/coreos/etcd/issues/5386.
2016-09-05 14:06:03 +09:00
ec9e77db96 rafthttp: remove unnecessary sendc from peer 2016-09-04 13:07:31 +09:00
2e0dc8467d Merge pull request #6344 from glycerine/partial_fix_6343
etcdctl/ctlv3: don't crash when we should prompt for pw.
2016-09-03 10:55:38 -07:00
cccbf302f2 etcdctl/ctlv3: don't crash when we should prompt for pw.
when 'etcdctl --user name get blah' is invoked to
 prompt for password, don't panic.

 addresses the segfault part of #6343
2016-09-03 10:32:16 -07:00
56cfe40184 grpcproxy: fix a data race 2016-09-03 07:53:18 -07:00
b56ee178d5 grpcproxy: handle overloaded stream 2016-09-03 07:49:20 -07:00
0d07154926 Merge pull request #6340 from xiang90/fix_double_create
grpcproxy: fix double create event
2016-09-02 16:37:29 -07:00
81bd381048 Merge pull request #6339 from xiang90/close
grpcproxy: stop watchers in watch groups
2016-09-02 16:03:12 -07:00
805d4cbd93 grpcproxy: fix double create event 2016-09-02 16:02:46 -07:00
eded62e60c grpcproxy: stop watchers in watch groups 2016-09-02 16:01:11 -07:00
5b14b834c9 Merge pull request #6338 from xiang90/create
grpcproxy: fix more issues in watch path
2016-09-02 15:14:12 -07:00
8cd47c4348 grpcproxy: fix more issues in watch path 2016-09-02 15:13:21 -07:00
f7293125cf Merge pull request #6337 from xiang90/watch_cancel
grpcproxy: support cancel watcher
2016-09-02 13:38:20 -07:00
51b4d6b7a8 grpcproxy: support cancel watcher
We do not wait for the cancellation from actual etcd server,
but generate it at the proxy side. The rule is to return the
latest rev that the watcher has seen. This should be good
enough for most use cases if not all.
2016-09-02 12:36:47 -07:00
acc270edbf Merge pull request #6333 from plasticbox/master
libraries-and-tools.md: add C++ client package
2016-09-02 09:29:49 -07:00
ed2b3314b8 libraries-and-tools.md: add C++ client package 2016-09-02 14:05:49 +09:00
e93ee6179c Merge pull request #6325 from heyitsanthony/etcdctl-txn-quotes
etcdctl: fix quotes in txn and watch
2016-09-01 19:55:16 -07:00
666e7bd120 e2e: add quoted key/value to txn test 2016-09-01 19:39:23 -07:00
b1740f5fe4 etcdctl: fix quoted string handling in txn and watch
Fixes #6315
2016-09-01 19:39:23 -07:00
c59e0aa83e Merge pull request #6332 from heyitsanthony/fix-watcher-stream-cancel
grpcproxy: shutdown on client context cancel
2016-09-01 16:18:29 -07:00
7b2f769643 clientv3: only resume watcher if error is non-halting 2016-09-01 15:22:35 -07:00
3489fa82fb integration: don't nest proxies in cluster_proxy mode 2016-09-01 15:21:52 -07:00
d3ecebd14e grpcproxy: shut down watcher proxy when client context is done 2016-09-01 15:20:50 -07:00
26999db927 Merge pull request #6331 from xiang90/fix_proxy
grpcproxy: fix stream closing issue
2016-09-01 11:27:37 -07:00
9ef0f5ef8a grpcproxy: fix stream closing issue 2016-09-01 09:35:56 -07:00
9e5bccd458 Merge pull request #6324 from xiang90/fix_proxy_data_race
grpcproxy: fix data race
2016-08-31 18:48:51 -07:00
b982c80c14 grpcproxy: fix data race 2016-08-31 16:52:04 -07:00
48706a9cd6 Merge pull request #6320 from xiang90/fixTestIssue3699
integration: fix live lock in issue3699
2016-08-31 12:43:43 -07:00
5b60be9626 integration: fix live lock in issue3699
Do not restart the killed member immediately.
The member will advance its election timeout after restart
So it will have a better chance to become the leader again.
2016-08-31 12:25:24 -07:00
d016383740 Merge pull request #6319 from gyuho/news
NEWS: add v3.0.7
2016-08-31 11:22:09 -07:00
44e710f76c NEWS: add v3.0.7 2016-08-31 09:31:05 -07:00
a6d22b96c3 Merge pull request #6317 from gyuho/release-test
e2e: add 'TestReleaseUpgradeWithRestart'
2016-08-30 21:22:20 -07:00
2d552927e0 Merge pull request #6316 from gyuho/grpc-endpoints
e2e: remove stripSchema
2016-08-30 21:03:06 -07:00
a1598d767b e2e: add 'TestReleaseUpgradeWithRestart' 2016-08-30 21:01:10 -07:00
54ab9a1aba Merge pull request #6312 from gyuho/release-upgrade-test-v2
test: test with v3.0 (preparation for v3.1)
2016-08-30 20:57:18 -07:00
3aa2d1b40e test: test with v3.0 (preparation for v3.1) 2016-08-30 20:54:07 -07:00
c8ad147c0a e2e: remove stripSchema 2016-08-30 20:52:33 -07:00
e29c79c54c Merge pull request #6310 from heyitsanthony/wal-page-write
wal: use page buffered writer for writing records
2016-08-30 19:34:12 -07:00
28277b5a65 wal: use page buffered writer for writing records
Forces torn writes to only happen on sector boundaries.

Fixes #6271
2016-08-30 15:49:07 -07:00
2943bf9086 ioutil: add page buffered writer
A buffered writer that only writes full pages or when explicitly flushed.
2016-08-30 15:49:07 -07:00
48941cea95 Merge pull request #6308 from gyuho/manual2
client: do not send previous node data (optional)
2016-08-30 13:33:22 -07:00
ff7458508f Documentation/v2: add 'noValueOnSuccess' example 2016-08-30 11:49:12 -07:00
b9cd329c61 Merge pull request #6309 from xiang90/fix_upgrade
etcdserver: allow zero kv index for cluster upgrade
2016-08-30 11:46:14 -07:00
771ee43169 etcdserver: allow zero kv index for cluster upgrade
If a user upgrades etcd from 2.3.x to 3.0 and shutdown the
cluster immediately without triggering any new backend writes,
then the consistent index in backend would be zero.

The user cannot restart etcdserver due to today's strick index
match checking. We now have to lose this a bit for this case.
2016-08-30 11:28:18 -07:00
5c06fc9093 integration: change to 'NoValueOnSuccess' 2016-08-30 10:58:44 -07:00
2da7b63809 v2http: change to 'NoValueOnSuccess' 2016-08-30 10:53:02 -07:00
fb39e96862 client: change to 'NoValueOnSuccess' 2016-08-30 10:52:58 -07:00
572bfd99ff v2http: update function returns 2016-08-30 10:29:37 -07:00
82053f04b2 client: do not send previous node data (optional)
- Do not send back node data when specified
- remove node and prevNode when noDataOnSuccess is set
2016-08-30 10:04:09 -07:00
7873c25abd Merge pull request #6307 from gyuho/manual
libraries-and-tools.md: add C++ client package
2016-08-30 10:00:49 -07:00
e7314a2460 libraries-and-tools.md: add C++ client package 2016-08-30 09:51:27 -07:00
9e9bbb829e Merge pull request #6289 from purpleidea/feat/move-readynotify
embed: Move the ReadyNotify() call to a more sane place
2016-08-29 20:06:17 -07:00
547bf1a92d Merge pull request #6284 from glycerine/fix6278
fix unintended deadlock on key prefixes
2016-08-29 19:50:50 -07:00
9aee3f01cd embed: Move the ReadyNotify() call to a better place
When using the embed functionality, you can't call the Server.Stop()
function until StartEtcd returns, which can block until there is a call
to Server.Stop() in error situations. Since we have a catch-22, the
ReadyNotify() can be called manually by the user if they wish to wait
for the server startup, or in parallel with a timeout if they wish to
cancel it after some time.

Chzz pointed out that this is also more consistent with the
etcdserver.Start() behaviour too.

purpleidea pointed out that this is actually more correct too, because
we can now register the stop interrupt handler before we block on
startup.
2016-08-29 22:45:41 -04:00
9497e9678c clientv3/concurrency: allow election on prefixes of keys.
After winning an election or obtaining a lock, we
auto-append a slash after the provided key prefix.
This avoids the previous deadlock due to waiting
on the wrong key.

Fixes #6278
2016-08-29 18:34:14 -07:00
48f4a7d037 Merge pull request #6286 from bdarnell/initial-election-check-quorum
raft: Allow an election immediately after start with checkQuorum
2016-08-29 17:59:32 -07:00
a7a867c1e6 raft: Allow an election immediately after start with checkQuorum
Previously, the checkQuorum flag required an election timeout to
expire before a node could cast its first vote. This change permits
the node to cast a vote at any time when the leader is not known,
including immediately after startup.
2016-08-30 08:28:41 +08:00
f4c30425c0 Merge pull request #6298 from sinsharat/master
store: added missing test case scenerio for scan of de-queued entries
2016-08-29 13:55:55 -07:00
452dedf8ab Merge pull request #6297 from gyuho/grpc-proxy
grpcproxy: fix recursive Context method
2016-08-29 13:31:44 -07:00
f6cda8ac0b Merge pull request #6299 from sinsharat/master
store: removed duplicate method call for the same method
2016-08-29 13:27:57 -07:00
396fac416e Merge pull request #6273 from gyuho/get-cmd
ctlv3: add 'print-value-only' flag to get command
2016-08-29 13:25:30 -07:00
db7e38b0ed Merge pull request #6300 from sinsharat/master
wal: document grammar correction
2016-08-29 12:22:38 -07:00
69ed560fae wal: document grammar correction
Corrected grammar mistake for doc.go
2016-08-30 00:50:02 +05:30
754b9025c4 store: removed duplicate method call for the same method
the get func was calling path's Join and clean method which is already
being in internalGet(nodePath) func. Hence the func was getting called
unnecessarily twice which is not needed.

#6295
2016-08-30 00:44:53 +05:30
1c59708c51 e2e: test 'print-value-only' flag 2016-08-29 12:09:16 -07:00
524a5a1afb ctlv3: add 'print-value-only' flag to get command 2016-08-29 12:09:07 -07:00
45079ec6c1 Merge pull request #6274 from dghubble/etcd3-rkt-docs
Documentation: Add initial etcd3 with rkt docs
2016-08-29 12:01:27 -07:00
4f150b06e5 store: added missing test case scenerio for scan of de-queued entries
Test case added to check err handing for replaced entries.

#6255
2016-08-30 00:30:48 +05:30
fa79d42b98 Documentation: Add initial etcd3 with rkt docs 2016-08-29 11:59:46 -07:00
86bf2bc443 grpcproxy: fix recursive Context method 2016-08-29 11:37:35 -07:00
e53b99588a Merge pull request #6288 from heyitsanthony/fix-retryread
clientv3: retry non-mutable rpcs on Internal codes
2016-08-28 20:41:19 -07:00
5e963608b7 clientv3: do not treat Internal codes as halting
Fixes #6277
2016-08-28 20:20:22 -07:00
3552420dfd clientv3: set failfast=false on read-only txns 2016-08-28 19:40:38 -07:00
64ac631863 rpctypes: set unknown codes to Unknown instead of internal
An unrecognized error code isn't "very broken".
2016-08-28 19:37:35 -07:00
f73258a51f Merge pull request #6282 from gyuho/tester-error
etcd-tester: return error for mismatch rev/hash
2016-08-27 22:25:18 -07:00
0bf2ef3c1b etcd-tester: return error for mismatch rev/hash 2016-08-27 22:14:42 -07:00
a0759298c5 Merge pull request #6281 from xiang90/fix
etcd-tester: do not restart stresser on error
2016-08-27 20:49:08 -07:00
017aac88a8 etcd-tester: do not restart stresser on error 2016-08-27 20:47:45 -07:00
0be190df4d Merge pull request #6279 from xiang90/fix_hash
mvcc: force commit and hash should be atomic for getting hash
2016-08-27 20:09:22 -07:00
1437388f77 mvcc: force commit and hash should be atomic for getting hash 2016-08-27 19:22:22 -07:00
c388b2f22f Merge pull request #6264 from heyitsanthony/error-codes
clientv3: use grpc codes to translate raw grpc errors
2016-08-26 11:52:37 -07:00
a50c707050 clientv3/integration: wait for two request timeouts in txn tests
Read only txns and Get may timeout once if the leader is lost.
2016-08-26 10:04:10 -07:00
3a49cbb769 Merge pull request #6269 from aaronlehmann/hold-lock-while-renaming
On non-Windows OS, hold file lock while renaming WAL directory
2016-08-26 09:53:59 -07:00
af4f82228c wal: hold file lock while renaming WAL directory on non-Windows
Windows requires this lock to be released before the directory is
renamed. But on unix-like operating systems, releasing the lock and
trying to reacquire it immediately can be flaky if a process is forked
around the same time. The file descriptors are marked as close-on-exec
by the Go runtime, but there is a window between the fork and exec where
another process will be holding the lock.
2016-08-26 09:27:51 -07:00
df54ad2208 v3rpc, rpctypes: add error types for timeouts 2016-08-26 09:22:09 -07:00
267063efd0 clientv3: use grpc codes to translate raw grpc errors 2016-08-26 09:22:09 -07:00
417b9469aa Merge pull request #6270 from heyitsanthony/etcdserver-timeout
etcdserver: use request timeout defined by ServerConfig for v3 requests
2016-08-25 20:50:21 -07:00
254c0ea814 etcdserver: use request timeout defined by ServerConfig for v3 requests 2016-08-25 18:39:01 -07:00
4f5cacc835 Merge pull request #6267 from heyitsanthony/fix-wal-tear
wal: fix CRC corruption on writes following write tears
2016-08-25 17:10:08 -07:00
f1ead43482 wal: zero out wal tail past its first zero record
Whenever the WAL is opened for writes, it should write zeroes to its tail
starting from the first zero record. Otherwise, if there are entries past
the first zero record due to a torn write, any new writes that overlap the
old entries will lead to a garbage record on the tail and cause a CRC
mismatch.
2016-08-25 14:24:46 -07:00
58a36cb651 fileutil: add ZeroToEnd for zeroing files 2016-08-25 14:24:46 -07:00
0d8d9a374c wal: test for truncation on torn writes 2016-08-25 14:24:46 -07:00
488ae52a51 Merge pull request #6259 from xiang90/fix_test_c
clientv3/integration: fix TestKVPutStoppedServerAndClose
2016-08-24 14:14:17 -07:00
f2b7c501cc clientv3/integration: fix TestKVPutStoppedServerAndClose 2016-08-24 13:57:27 -07:00
bb110b0a2d Merge pull request #6257 from heyitsanthony/doc-fix-buglink
Documentation: update links for unaligned 64-bit atomics issue
2016-08-24 09:37:00 -07:00
159c8ee6e0 Documentation: update links for unaligned 64-bit atomics issue
Fixes #6256
2016-08-24 09:13:53 -07:00
1c989edb47 Merge pull request #6253 from heyitsanthony/srv-arec
discovery: reject IP address records in SRVGetCluster
2016-08-24 06:56:17 -07:00
3dc12e33f1 discovery: reject IP address records in SRVGetCluster
Was incorrectly trimming the trailing '.' from the target; this in turn
caused the etcd server to accept any SRV record with an IP target
instead of only targets with A records.
2016-08-23 18:10:42 -07:00
8e4fcaa6dc Merge pull request #6251 from xiang90/ctl_doc
etcdctl: list output options
2016-08-23 11:32:33 -07:00
86dcfbf205 etcdctl: list output options 2016-08-23 11:32:00 -07:00
83e66d2962 Merge pull request #6248 from xiang90/fix_mvcc
mvcc: only write txn should update index
2016-08-23 10:50:46 -07:00
c12104bd15 Merge pull request #6247 from xiang90/fix_snap
etcdserver: kv.commit needs to be serialized with apply
2016-08-23 09:39:54 -07:00
7f3d4bfae5 etcdserver: kv.commit needs to be serialized with apply
kv.commit updates the consistent index in backend. When
executing in parallel with apply, it might grab tx lock
after apply update the consistent index and before apply
starts to execute the opeartion. If the server dies right
after kv.commit, the consistent is updated but the opeartion
is not executed. If we restart etcd server, etcd will skip
the operation. :(

There are a few other places that we need to take care of,
but let us fix this first.
2016-08-23 09:16:09 -07:00
959f860a40 Merge pull request #6249 from gyuho/fix-count
etcd-tester: fix compact rev counting
2016-08-22 23:36:57 -07:00
0c37df7265 etcd-tester: fix compact rev counting 2016-08-22 22:58:44 -07:00
e1789aa531 mvcc: only write txn should update index 2016-08-22 22:05:51 -07:00
028b954052 Merge pull request #6245 from requenym/patch-1
documentation: update libraries-and-tools.md
2016-08-22 19:08:15 -07:00
49ef47a9a4 documentation: update libraries-and-tools.md 2016-08-22 20:21:29 -04:00
13f79affb6 Merge pull request #6243 from xiang90/fix_m
e2e: remove server testing in etcdctl test
2016-08-22 16:14:51 -07:00
aa89bc35fd Merge pull request #6242 from heyitsanthony/rwdial-timeout
pkg/transport: bump wait time in TestReadWriteTimeoutDialer for write deadline
2016-08-22 16:13:50 -07:00
722d66b03d Merge pull request #6241 from gyuho/progress-doc
clientv3: specify watch progress notify interval
2016-08-22 15:59:01 -07:00
be38c50567 clientv3: specify watch progress notify interval
For watch request
2016-08-22 15:44:59 -07:00
1d58c7d3b2 e2e: remove server testing in etcdctl test 2016-08-22 15:34:50 -07:00
3b92384394 pkg/transport: bump wait time in TestReadWriteTimeoutDialer for write deadline
Was able to get 2s wait times with 500 concurrent requests on a fast machine;
a slower machine could possibly see similar delays with a single connection.

Fixes #6220
2016-08-22 15:30:44 -07:00
c39b7205a6 Merge pull request #6228 from mitake/e2e-txn-auth
e2e: a test case for txn and permission
2016-08-22 09:24:18 -07:00
3d5d3b90e9 e2e: a test case for txn and permission
This commit adds a new test case for checking the permission mechanism
can work well in txn requests.
2016-08-22 12:06:19 +09:00
0504b277b6 Merge pull request #6235 from coreos/procfile-location
local_cluster: make it clear where Procfile is
2016-08-21 19:55:50 -07:00
4c7bced34e local_cluster: make it clear where Procfile is
It isn't clear where to start with these instructions, fix this.
2016-08-21 17:14:59 -04:00
8c88c1611e Merge pull request #6231 from heyitsanthony/fix-rafthttp-test
rafthttp: fix race in TestStreamWriterAttachOutgoingConn
2016-08-19 20:40:42 -07:00
784c4446d9 rafthttp: fix race in TestStreamWriterAttachOutgoingConn
Fixes #6230
2016-08-19 19:59:16 -07:00
262c98f327 Merge pull request #6229 from xiang90/applynotify
etcdserver: add waitApplyIndex
2016-08-19 16:58:21 -07:00
83de13e4a8 etcdserver: support apply wait 2016-08-19 16:18:35 -07:00
940402a27d Merge pull request #6225 from xiang90/cache
grpc-proxy: invalidate cache entries when there is a put/delete
2016-08-19 15:11:59 -07:00
8db4f5b8e1 pkg/wait: change wait time to use logical clock 2016-08-19 15:10:37 -07:00
146bce3377 Merge pull request #6211 from gyuho/proxy-timeout
integration: improve TestTransferLeader
2016-08-19 13:32:18 -07:00
eaa5d9772f integration: improve TestTransferLeader
so that it can check leader transition
2016-08-19 13:11:38 -07:00
c8bbb8c53e grpc-proxy: invalidate cache entries when there is a put/delete 2016-08-19 12:52:19 -07:00
5e6d2a23b7 Merge pull request #6226 from gyuho/vendor
vendor: update grpc/grpc-go for clientconn patch
2016-08-18 20:35:25 -07:00
01471481a9 vendor: update grpc/grpc-go for clientconn patch 2016-08-18 20:17:24 -07:00
f4b6ed2469 Merge pull request #6223 from heyitsanthony/fix-rafthttp-badoutgoing
rafthttp: remove WaitSchedule() from tests
2016-08-18 16:44:56 -07:00
da1e022890 rafthttp: remove WaitSchedule() from tests
Fixes #6187
2016-08-18 16:26:35 -07:00
5e9fe0dc23 Merge pull request #6222 from hongchaodeng/master
integration: NewClusterV3() should launch cluster before creating clients
2016-08-18 14:52:04 -07:00
5630a76766 integration: NewClusterV3 should launch cluster before creating clients 2016-08-18 14:05:21 -07:00
8021487b7a Merge pull request #6219 from sinsharat/master
raft: handled panic for Term due to IOB
2016-08-18 12:33:52 -07:00
a8fc4396e2 Merge pull request #6218 from gyuho/boltdb
vendor: boltdb/bolt v1.3.0 for Go 1.7
2016-08-18 11:06:05 -07:00
9b3b1f80dd raft: handled panic for Term due to IOB
Instead of raising panic, returning an error instead for better handling

#6215
2016-08-18 23:11:38 +05:30
00f5a01378 vendor: boltdb/bolt v1.3.0 for Go 1.7 2016-08-18 10:36:20 -07:00
cc4f4b47bc Merge pull request #6198 from heyitsanthony/reenable-outside-gopath
build: re-enable building outside gopath
2016-08-18 09:44:34 -07:00
a20d4a2d31 Merge pull request #6209 from heyitsanthony/fix-waittime-test
pkg/wait: don't expect time.Now() to be strict increasing in WaitTime tests
2016-08-17 13:46:11 -07:00
14f6dd4ded Merge pull request #6210 from gyuho/race
integration: fix race in TestDoubleBarrierFailover
2016-08-17 12:19:06 -07:00
10c9e238f0 integration: fix race in TestDoubleBarrierFailover 2016-08-17 11:56:49 -07:00
f9d122066e pkg/wait: don't expect time.Now() to be strict increasing in WaitTime tests 2016-08-17 11:53:34 -07:00
57fde954b9 Merge pull request #6208 from xiang90/better_logging
etcdserver: improve logging for leadership transfer
2016-08-17 11:47:38 -07:00
d0fa390048 etcdserver: improve logging for leadership transfer 2016-08-17 11:40:46 -07:00
5aa935f3b7 Merge pull request #6207 from gyuho/wait-extra
integration: write to leader group first, or wait
2016-08-17 11:25:09 -07:00
f2fedbae9b integration: write to leader group first, or wait
Write to leader group first, or give more time to
acknowledge the leader after network partition recovery
2016-08-17 11:09:33 -07:00
a5022c1cba Merge pull request #6205 from heyitsanthony/ft-large-writes
functional-tester: put large keys
2016-08-17 10:49:56 -07:00
e7a7fb2bb1 Merge pull request #6204 from gyuho/news
NEWS: add v3.0.5
2016-08-17 09:57:06 -07:00
6655afda4b NEWS: add v3.0.5 2016-08-17 09:56:45 -07:00
47b6449934 functional-tester: put large keys
For testing writes that must span multiple pages.
2016-08-17 09:51:44 -07:00
30cf8b7f0f Merge pull request #6197 from gyuho/mutex-proxies
integration: fix race in setting shared proxies
2016-08-17 09:15:10 -07:00
83dd121bae build: re-enable building outside gopath
Have build return an error code if build fails and add a test to travis
to confirm running build outside the gopath works.
2016-08-16 20:06:05 -07:00
38c370a7c5 Merge pull request #6196 from gyuho/clockwork
vendor: use v0.1.0 clockwork
2016-08-16 19:52:34 -07:00
fb00a32b86 integration: fix races in global proxies 2016-08-16 19:43:31 -07:00
f91f7dfb91 v2http: fix tests to use new clockwork 2016-08-16 16:36:24 -07:00
3f0f4bfee7 vendor: clockwork v0.1.0 2016-08-16 16:31:10 -07:00
28b797b538 Merge pull request #6194 from heyitsanthony/fix-gofail
build: don't override gopath by default, demote old gopath on override
2016-08-16 14:27:08 -07:00
cf063ed475 Merge pull request #6193 from xiang90/gw
docs: add gateway
2016-08-16 14:16:22 -07:00
b499f69181 docs: add gateway 2016-08-16 14:02:45 -07:00
e1519cf460 build: don't override gopath by default, demote old gopath on override
Builds already vendor through cmd/ so there's no reason to set the GOPATH; it
was also breaking gofail builds. For builds that need to override GOPATH, also
include the old GOPATH as a fallback for dependencies outside cmd/vendor/.
2016-08-16 13:46:07 -07:00
8d7703528a Merge pull request #5845 from heyitsanthony/clientv3-ignore-dead-eps
clientv3: respect up/down notifications from grpc
2016-08-16 11:56:03 -07:00
3eadf964f4 clientv3: use failfast and retry wrappers for at-most-once rpcs 2016-08-16 10:49:50 -07:00
ee3797ddff integration: treat client TLS connecting to insecure server as timeout 2016-08-16 10:17:16 -07:00
46765ad79c clientv3: respect up/down notifications from grpc
Fixes #5842
2016-08-16 09:49:36 -07:00
462eb511c5 Merge pull request #6183 from heyitsanthony/go-install-etcd
build: support go install github.com/coreos/etcd/cmd/etcd
2016-08-15 16:29:36 -07:00
b125d590cf Merge pull request #6186 from gyuho/grpcproxy-fix
proxy/grpcproxy: fix nil-map assign to 'singles'
2016-08-15 16:25:02 -07:00
b9d01fb98b vendor: update grpc 2016-08-15 16:19:40 -07:00
a4ef36c8bf proxy/grpcproxy: fix nil-map assign to 'singles' 2016-08-15 15:48:45 -07:00
d5d2370fc8 Merge pull request #6172 from xiang90/session
session: remove session manager and add ttl
2016-08-15 15:20:19 -07:00
961b03420e Merge pull request #6185 from heyitsanthony/wait-time-collision
wait: make WaitTime robust against deadline collisions
2016-08-15 15:15:29 -07:00
16b2d9ca5e Merge pull request #6170 from heyitsanthony/default-advertise-ip
use default ip for advertise URL
2016-08-15 15:12:25 -07:00
449923c98b build: support go install github.com/coreos/etcd/cmd/etcd
Could build via github.com/coreos/etcd/cmd but that would generate a binary
named "cmd", which is not ideal.
2016-08-15 15:08:41 -07:00
7b84456366 Merge pull request #6163 from gyuho/vendor
vendor: migrate to glide + update go-systemd, probing
2016-08-15 15:01:09 -07:00
c3f069c9fc wait: make WaitTime robust against deadline collisions 2016-08-15 14:38:41 -07:00
0307382c1a Merge pull request #6184 from xiang90/rm
ROADMAP: update
2016-08-15 14:30:23 -07:00
db834301eb ROADMAP: update 2016-08-15 14:30:10 -07:00
feaff17259 session: remove session manager and add ttl 2016-08-15 14:12:25 -07:00
2cc245e8bf etcdmain: report default advertise detection / fallback 2016-08-15 14:08:09 -07:00
29372f9dd2 vendor: update go-systemd, probing 2016-08-15 14:04:07 -07:00
ddf65421e7 scripts: use glide in updatedep.sh 2016-08-15 14:04:03 -07:00
b207dd095c glide: initial commit 2016-08-15 12:10:32 -07:00
d5900e8b63 vendor: migrate to glide 2016-08-15 12:10:21 -07:00
e810dec662 Merge pull request #6182 from gyuho/fix
rafthttp: use reportCriticalError, fix typo
2016-08-15 11:48:30 -07:00
e8594b60b1 embed: use default route IP for default advertise URL
Fixes #2858
2016-08-15 11:12:26 -07:00
d23392ed8e netutil: GetDefaultHost for getting the default IP of the host machine 2016-08-15 11:12:26 -07:00
bd450c1ba3 rafthttp: use reportCriticalError, fix typo 2016-08-15 10:40:58 -07:00
561c3b918a Merge pull request #6179 from ypu/binDir
e2e: Update binary path with binDir
2016-08-15 10:36:04 -07:00
9eb6ea34bd Merge pull request #6175 from heyitsanthony/fix-conn-race
rafthttp: fix race between streamReader.stop() and connection closer
2016-08-15 09:27:24 -07:00
d0d8e49e20 e2e: Update binary path with binDir
Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2016-08-15 17:22:42 +08:00
911c8442b7 rafthttp: fix race between streamReader.stop() and connection closer 2016-08-15 01:36:09 -07:00
96e018634a Merge pull request #6173 from gyuho/ccc
pkg/httputil: simplify RequestCanceler args
2016-08-14 20:41:19 -07:00
f14fd43548 proxy/httpproxy: fix httputil.RequestCanceler 2016-08-14 14:37:08 -07:00
0503676bde rafthttp: fix httputil.RequestCanceler 2016-08-14 14:36:51 -07:00
ae4b4109b2 pkg/httputil: simplify RequestCanceler args 2016-08-14 14:35:50 -07:00
1b5a129bbe Merge pull request #6171 from gyuho/go-vet
*: fix spell errors from go report card
2016-08-13 23:10:17 -07:00
19b35c939a proxy/grpcproxy: fix spell 'gropu' to 'group' 2016-08-13 20:55:15 -07:00
4d3b281369 etcdserver: fix spell errors 2016-08-13 20:54:48 -07:00
6b671b88dc etcdctl/ctlv3: fix spell errors 2016-08-13 20:54:27 -07:00
d788eb8d92 Merge pull request #6038 from gyuho/leader
*: transfer leadership when stopping leader
2016-08-13 14:47:54 -07:00
a205242ca5 integration: add 'TestTransferLeader/Stop' 2016-08-13 14:32:01 -07:00
64a0e34602 etcdserver: transfer leadership when stopping 2016-08-13 14:31:58 -07:00
7b11c288fe Merge pull request #6169 from sinsharat/master
etcdserver: optimized veryfying local member
2016-08-12 19:09:55 -07:00
1fec4ba127 etcdserver: optimized veryfying local member
moved the code for perparing and sorting of advertising peer urls and
sorting of peer urls only when strict verification needs to be done.
This is done to avoid this processing when strict verification is not
required like in case of VerifyJoinExisting function.

#6165
2016-08-13 06:17:21 +05:30
817de6d212 Merge pull request #6168 from heyitsanthony/fix-periodic-test-block
compactor: wait for After() in TestPeriodic
2016-08-12 13:54:06 -07:00
5eff6fb7db compactor: wait for After() in TestPeriodic
If the test calls clock.Advance() after the compactor checks clock.Now()
but before the compactor calls clock.After(), the compactor will wait
forever on clock.After() expecting the lost clock.Advance().

Reproduced failure by putting a Sleep() in the clock.Now() continue path.

Fixes #6060 (again)
2016-08-12 13:28:40 -07:00
f975fe8068 Merge pull request #6140 from gyuho/network-partition
*: add network partition tests
2016-08-12 12:33:24 -07:00
0a00328a7c integration: add network partition tests 2016-08-12 12:15:29 -07:00
82a3d90763 Merge pull request #6167 from xiang90/fix_txn_rev
etcdserver: fix wrong rev in header when nothing is actually got executed
2016-08-12 12:14:48 -07:00
92a0f08722 etcdserver: fix wrong rev in header when nothing is actually got executed 2016-08-12 11:44:13 -07:00
67b1c7cce5 Merge pull request #6166 from heyitsanthony/clientv3-nonblock-new
clientv3: support non-blocking New()
2016-08-12 10:57:45 -07:00
429d5ab20b clientv3: only block on New() when DialTimeout > 0
Fixes #6162
2016-08-12 10:33:11 -07:00
c6c6cfb502 etcdserver: implement 'CutPeer', 'MendPeer' 2016-08-12 07:38:52 -07:00
c33ea20fef Merge pull request #6161 from sinsharat/master
etcdserver: stats/server - refactored
2016-08-11 17:03:23 -07:00
965b2901d5 Merge pull request #6156 from heyitsanthony/remove-member-quorum
etcdserver: reject member removal that breaks active quorum
2016-08-11 11:40:38 -07:00
aa9837e8ff e2e: support --strict-reconfig-check=false 2016-08-11 11:14:14 -07:00
e742ff331f integration: test member removal which breaks active quorum is rejected 2016-08-11 11:14:14 -07:00
6205a9a6cb etcdserver: stats/server - refactored
removed code duplicacy and improved readability

#6160
2016-08-11 22:09:25 +05:30
de06dc1272 Merge pull request #6155 from gyuho/raft-leader-transfer
*: expose Raft leader transfer
2016-08-11 08:03:28 -07:00
d3812ed664 Merge pull request #6157 from siddontang/siddontang/fix-overflow
raft: fix overflow
2016-08-11 07:53:48 -07:00
f8ee322b08 raft: fix overflow 2016-08-11 09:24:49 +08:00
8a32929d29 Merge pull request #6154 from gyuho/rafthttp-pause
rafthttp: add Transport.Cut/MendPeer
2016-08-10 17:10:30 -07:00
937ae658dd rafthttp: add Transport.Cut/MendPeer
From https://github.com/coreos/etcd/pull/6140.
2016-08-10 17:09:35 -07:00
a1ce07a321 etcdserver: reject member removal that breaks the current active quorum 2016-08-10 17:00:39 -07:00
a56cb82180 etcdserver: add TransferLeadership for raft.Node 2016-08-10 16:26:11 -07:00
e64ef3f261 raft: add 'TransferLeadership' to Node interface 2016-08-10 16:25:22 -07:00
f4141f0f51 raft: handle 'MsgTransferLeader' in follower 2016-08-10 16:24:29 -07:00
d72cee1b0c Merge pull request #6153 from gyuho/example
clientv3: update base example with TLS
2016-08-10 14:53:42 -07:00
1644679d00 clientv3: add 'ExampleConfig_withTLS' 2016-08-10 14:37:34 -07:00
7eb43ea75b Merge pull request #6152 from xiang90/fix_count
mvcc: fix count
2016-08-10 11:42:10 -07:00
f5549cba2a Merge pull request #6151 from heyitsanthony/configfile-defaults
embed: load config defaults before loading from file
2016-08-10 11:27:57 -07:00
de864d3b58 mvcc: fix count 2016-08-10 10:54:25 -07:00
2bb1f9c8a4 Merge pull request #6150 from gyuho/metrics
etcdserver: use Counter for proposals_failed_total
2016-08-10 09:59:10 -07:00
eb97aba581 e2e: test etcd boots with example config file 2016-08-10 09:45:17 -07:00
6de993b468 embed: load config defaults before loading config from file 2016-08-10 09:44:50 -07:00
06e2338108 Merge pull request #6113 from ypu/e2e
Add some test flags for e2e test
2016-08-10 09:28:27 -07:00
d219e96359 etcdserver: use Counter for proposals_failed_total
It only ever goes up.
2016-08-10 09:27:51 -07:00
b6f5b6b1c9 Merge pull request #6147 from sinsharat/master
etcdserver: Error handling for invalid empty raft cluster
2016-08-10 08:52:45 -07:00
2b5a5c77cf etcdserver: Error handling for invalid empty raft cluster
TODO implemented for GetClusterFromRemotePeers should not return nil
error with an invalid empty cluster

#6137
2016-08-10 19:23:19 +05:30
a5e4fbd335 e2e: Make the certificate file path configurable
This commit will help us to run the e2e tests in an enviroment
without e2e source code more convenient.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2016-08-10 15:40:12 +08:00
2ca87f6c03 e2e: Make it can run with exist binary
Add the bin-dir option to the command line, so the e2e tests can
run with an exist binary. For example(run the command under e2e
directory):
go test -v -timeout 10m -bin-dir /usr/bin -cpu 1,2,4

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2016-08-10 15:40:12 +08:00
81f5e31ed2 Merge pull request #6142 from heyitsanthony/fix-cancel-watch-imm
clientv3: handle watchGrpcStream shutdown if prior to goroutine start
2016-08-09 20:53:56 -07:00
2d3eda4afa Merge pull request #6139 from aaronlehmann/export-segment-size
wal: Export SegmentSizeBytes as a variable
2016-08-09 20:39:56 -07:00
1c83a46c6d clientv3: handle watchGrpcStream shutdown if prior to goroutine start
Fixes #6141
2016-08-09 19:59:04 -07:00
2b996b6038 wal: Export SegmentSizeBytes as a variable
In test situations, it's useful to create smaller than usual WAL files
to test rotation and to avoid the overhead of preallocation on old-style
filesystems that don't handle it efficiently. This commit changes
segmentSizeBytes to an exported variable so that tests can override it
from an init() function.
2016-08-09 15:38:30 -07:00
88a77f30e1 Merge pull request #6136 from heyitsanthony/fix-watcher-leak
clientv3: close watcher stream once all watchers detach
2016-08-09 10:23:15 -07:00
8c1c291332 clientv3/integration: test watcher cancelation propagation to server 2016-08-09 00:10:57 -07:00
5e651a0d0d clientv3: close watcher stream once all watchers detach
Fixes #6134
2016-08-09 00:10:57 -07:00
c3c41234f1 integration: support querying member metrics 2016-08-08 23:45:50 -07:00
c7e4198742 Merge pull request #6129 from xiang90/fix_raft
raft: fix getting unapplied log entries
2016-08-08 16:30:42 -07:00
8f3a11c73c Merge pull request #6105 from gyuho/release-notes
NEWS: add release notes for >v3.0.0 releases
2016-08-08 15:39:14 -07:00
f58a119b44 Merge pull request #6132 from gyuho/manual
Documentation/dev-guide: add bash syntax to doc
2016-08-08 15:26:14 -07:00
adbd936f22 Documentation/dev-guide: add bash syntax to doc 2016-08-08 15:06:02 -07:00
39f39c185e NEWS: add release notes for >v3.0.0 releases
Fix https://github.com/coreos/etcd/issues/6049.
2016-08-08 15:01:17 -07:00
918af500c3 Merge pull request #6130 from gyuho/port-e2e
e2e: use unix port for release tests
2016-08-08 14:41:09 -07:00
311c19e494 e2e: use unix port for release tests
Fix https://github.com/coreos/etcd/issues/5947.

When we restart, the previous port could have been still bind
by the OS. Use Unix port to avoid such rebind cases.
2016-08-08 14:26:19 -07:00
5f0c122496 raft: fix getting unapplied log entries 2016-08-08 10:44:02 -07:00
bb28c9ab00 Merge pull request #6126 from gyuho/tester
etcd-tester: fix tester for 5-node cluster
2016-08-07 21:58:49 -07:00
c6cf015e26 etcd-tester: fix tester for 5-node cluster
1. fix failure case counting
2. match ErrClientConnClosing in stresser
3. longer timeout for set-health-key
4. fixed range for range/delete stresser
5. remove Limit in RangeRequest
2016-08-07 21:15:01 -07:00
fb7c4da361 Merge pull request #6124 from heyitsanthony/share-limiter
functional-tester: share limiter among stresser
2016-08-07 19:17:06 -07:00
978ae9de29 functional-tester: share limiter among stresser
Otherwise, adding more members stresses the cluster with more ops.
2016-08-07 19:15:00 -07:00
7678b84f2c Merge pull request #6123 from xiang90/fix_limiter
tools/functional-tester: fix limiter
2016-08-07 16:20:17 -07:00
619a40b22b Merge pull request #6122 from xiang90/debug_stresser
tools/functional-tester: better logging
2016-08-07 16:17:52 -07:00
f6a1585902 functional-tester: reduce rate to 3000 2016-08-07 14:34:01 -07:00
107a07563f tools/functional-tester: fix limiter 2016-08-07 14:28:16 -07:00
69204397ee tools/functional-tester: better logging 2016-08-07 14:21:44 -07:00
f505bcb91a Merge pull request #6117 from gyuho/lease-test
integration: add more lease tests
2016-08-05 19:25:07 -07:00
f1f31f1015 integration: add more lease tests
Fix https://github.com/coreos/etcd/issues/6102.
2016-08-05 19:09:46 -07:00
c71f0ea174 Merge pull request #6106 from heyitsanthony/strict-reconfig-healthy
etcdserver, embed: stricter reconfig checking
2016-08-05 17:15:01 -07:00
9063ce5e3f etcdserver, embed: stricter reconfig checking
Make --strict-reconfig-check a default and check if cluster is healthy when
adding a member.
2016-08-05 16:59:25 -07:00
9764652356 Merge pull request #6081 from gyuho/functional-tester
etcd-tester: delete/range with limit, clean up
2016-08-05 11:28:41 -07:00
854a215329 etcd-tester: delete/range with limit, clean up 2016-08-05 11:21:36 -07:00
4a7fabd219 Merge pull request #6098 from xiang90/lease
Fix Lease
2016-08-05 10:08:24 -07:00
6c3efde51b Merge pull request #6099 from sinsharat/master
raft: handling of applying old snapshots
2016-08-05 07:38:07 -07:00
d69d438289 *: minor cleanup for lease 2016-08-04 20:39:32 -07:00
7ed8a133d2 Merge pull request #6104 from gyuho/typo
pkg/transport: fix minor typo
2016-08-04 16:03:40 -07:00
c38f0290a7 pkg/transport: fix minor typo 2016-08-04 16:00:18 -07:00
c46955b60a Merge pull request #6097 from swingbach/master
raft: fix #6096
2016-08-04 11:40:02 -07:00
e2a956c0c4 Merge pull request #6100 from gyuho/sort-comment
clientv3: ignore sort-ascend-key option
2016-08-04 11:28:49 -07:00
bd62b0a646 mvcc: attach keys to leases after recover all state
The previous logic is wrong. When we have hisotry like Put(foo, bar, lease1),
and Put(foo, bar, lease2), we will end up with attaching foo to two leases 1 and
2. Similar things can happen for deattach by clearing the lease of a key.

Now we try to fix this by starting to attach leases at the end of the recovery.
We use a map to keep the last lease attachment state.
2016-08-04 11:17:58 -07:00
ddddecc3ab clientv3: ignore sort-ascend-key option 2016-08-04 11:13:41 -07:00
75c06cacae lease: do lease delection in the kv txn 2016-08-04 10:06:47 -07:00
4d59b6f52c lease: delete kvs in a txn 2016-08-04 10:06:46 -07:00
fd757756f5 raft: handling of applying old snapshots
There was a TODO requirement to handle ErrorSnapshotOutOfDate for the
function ApplySnapshot. The same has been implemented

#6090
2016-08-04 21:08:24 +05:30
29a077bdbe etcdserver: always recover lessor first 2016-08-04 08:06:19 -07:00
41dee84733 raft: fix #6096 2016-08-04 18:31:22 +08:00
eb36d0dbba Merge pull request #6084 from heyitsanthony/srv-servername
etcdctl: set TLS servername on discovery
2016-08-03 23:51:11 -07:00
a752338d45 Documentation: update clustering guide about PKI SRV record forging 2016-08-03 22:28:03 -07:00
d1809830bb embed: use ServerName on TLS DNS discovery without CA file 2016-08-03 22:28:03 -07:00
ab4ac828f3 etcdmain: check TLS on gateway SRV records 2016-08-03 22:28:03 -07:00
e218834b58 etcdctl: set ServerName for TLS when using --discovery-srv 2016-08-03 22:28:03 -07:00
cd781bf30c transport: add ServerName to TLSConfig and add ValidateSecureEndpoints
ServerName prevents accepting forged SRV records with cross-domain
credentials. ValidateSecureEndpoints prevents downgrade attacks from SRV
records.
2016-08-03 22:28:03 -07:00
6e7baab32c Merge pull request #6070 from swingbach/master
raft: fix #6068
2016-08-03 19:59:07 -07:00
cabd28516c Merge pull request #6092 from gyuho/transport
pkg/transport: update scheme to unix without copy
2016-08-03 10:59:00 -07:00
c8cc87c3f5 pkg/transport: update scheme to unix copying URL 2016-08-03 10:35:28 -07:00
bc9882f521 Merge pull request #6087 from xiang90/grpc_create
grpcproxy: handle create event
2016-08-03 09:31:33 -07:00
57c68ab1db grpcproxy: handle create event 2016-08-02 20:51:30 -07:00
c30a436829 Merge pull request #6086 from xiang90/sc
clientv3: add send created notification
2016-08-02 20:27:04 -07:00
33c3583b50 clientv3: add send created notification 2016-08-02 20:08:11 -07:00
76e62c39b0 Merge pull request #6085 from heyitsanthony/lease-elect-timeout
etcdserver, lease: tie lease min ttl to election timeout
2016-08-02 13:27:04 -07:00
bf71497537 etcdserver, lease: tie lease min ttl to election timeout 2016-08-02 13:06:57 -07:00
c0a8da7fd0 raft: minor refactor 2016-08-02 08:46:43 +08:00
4db07dbc93 Merge pull request #6079 from gyuho/cleanup-functional-tester
etcd-tester: remove unnecessary arg from stresser
2016-08-01 15:40:50 -07:00
755eee0d30 etcd-tester: remove unnecessary arg from stresser 2016-08-01 15:35:31 -07:00
b23045e34d Merge pull request #6078 from gyuho/release-note
dev-internal: update release note
2016-08-01 15:14:05 -07:00
fc4b30a1e0 dev-internal: update release note
For https://github.com/coreos/etcd/issues/6049.
2016-08-01 15:09:47 -07:00
9836990aa7 Merge pull request #6077 from gyuho/auth-guest
v2http: use guest access in non-TLS mode
2016-08-01 14:32:46 -07:00
87498e0209 v2http: use guest access in non-TLS mode
Fix https://github.com/coreos/etcd/issues/6075.
2016-08-01 14:00:38 -07:00
59ac42ff38 Merge pull request #6073 from heyitsanthony/rafthttp-close-stream
rafthttp: close http socket when pipeline handler gets a raft error
2016-07-31 21:49:04 -07:00
911dcc9386 rafthttp: close http socket when pipeline handler gets a raft error
Otherwise the http stream remains open and keeps receiving raft messages.
This can lead to "raft: stopped" log spam on closing an embedded server.

Fixes #5981
2016-07-31 20:25:42 -07:00
a2715e3bda Merge pull request #6072 from xiang90/tls_err
Log TLS error in health checking
2016-07-31 20:17:47 -07:00
9311d7b77e rafthttp: log health checking error early 2016-07-31 19:58:22 -07:00
5a83f05e96 dep: update probing 2016-07-31 18:24:00 -07:00
a60387bab2 Merge pull request #6001 from mitake/auth-errcode
client, etcdserver: propagate status code of auth related error
2016-07-31 08:28:41 -07:00
564bf8d17e client: utility functions for getting detail of v2 auth errors
Current v2 auth API doesn't propagate its error code. This commit adds
utility functions for parsing error messages and getting detail of v2
auth errors.

Fixes https://github.com/coreos/etcd/issues/5894
2016-07-31 21:23:58 +09:00
4d309f0cb7 Merge pull request #6054 from heyitsanthony/serialize-refactor
etcdserver: apply serialized requests outside auth apply lock
2016-07-30 22:44:26 -07:00
06da46c4ee etcdserver: apply serialized requests outside auth apply lock
Fixes #6010
2016-07-30 22:00:49 -07:00
b43722dd48 Merge pull request #6069 from xiang90/raft_doc
raft: better doc
2016-07-30 21:11:57 -07:00
8d12017fe2 raft: better doc 2016-07-30 21:11:37 -07:00
992f628e6e raft: fix #6068 2016-07-30 03:27:29 +08:00
e2088b8073 Merge pull request #6063 from siddontang/siddontang/embed-handler
embed: support registering client handlers
2016-07-27 22:57:27 -07:00
86de0797e1 embed: support registering user handlers 2016-07-28 13:39:06 +08:00
72eb2d8893 Merge pull request #6064 from heyitsanthony/clientv3-watch-filter
clientv3: watch filters
2016-07-27 21:48:25 -07:00
4c9a2a65c9 integration: test clientv3 watch filters 2016-07-27 21:25:06 -07:00
943fe70178 clientv3: support watch filters 2016-07-27 21:24:52 -07:00
79d25a6884 Merge pull request #6061 from heyitsanthony/fix-snapshot-test
etcdserver: don't race when waiting for store in TestSnapshot
2016-07-27 19:15:41 -07:00
3d8e4ace47 Merge pull request #6062 from heyitsanthony/fix-test-periodic
compactor: fix race in TestPeriodic
2016-07-27 19:15:27 -07:00
76a99fa1c3 compactor: fix race in TestPeriodic
Test ordering now similar to TestPeriodicPause

Fixes #6060
2016-07-27 16:03:22 -07:00
1153350a95 Merge pull request #6059 from jlamillan/honor_global_output
etcdctl: Add support for formating output of key related commands
2016-07-27 16:03:17 -07:00
cfe09d34b8 etcdserver: don't race when waiting for store in TestSnapshot 2016-07-27 15:37:27 -07:00
205f10aeb6 etcdctl: Add support for formating output of key related commands
All v2 key and dir related commands will now honor the global format option if
it was specified. Otherwise, the output will remain the same.
2016-07-27 14:17:19 -07:00
6136b26f38 Merge pull request #6056 from gyuho/gateway
scripts/genproto: use latest grpc-gateway c8ec92d0
2016-07-27 13:37:35 -07:00
273c6f6ba9 Merge pull request #6058 from gyuho/dockerfile-release
Dockerfile-release: add '/var/lib/etcd/'
2016-07-27 13:37:26 -07:00
de99dfb134 Dockerfile-release: add '/var/lib/etcd/'
We have '/var/etcd/' in Dockerfile for historical reason.
Most cases, user store data in '/var/lib/etcd/'.
2016-07-27 13:24:07 -07:00
982e18d80b *: regenerate proto with latest grpc-gateway 2016-07-27 13:21:03 -07:00
6e95ce26fb scripts/genproto: use latest grpc-gateway c8ec92d0 2016-07-27 13:20:15 -07:00
13c2d32061 Merge pull request #6045 from heyitsanthony/fix-version-race
etcdserver, api, membership: don't race on setting version
2016-07-27 08:56:39 -07:00
a75688bd17 Merge pull request #6039 from xiang90/fix_r
raft: hide Campaign rules on applying all entries
2016-07-26 20:52:09 -07:00
3c3b33b00f Merge pull request #5911 from mitake/skip-apply-txn
etcdserver: skip range requests in txn if the result is needless
2016-07-26 20:48:41 -07:00
0090573749 etcdserver: skip range requests in txn if the result is needless
If a server isn't serving txn requests from a client, the server
doesn't need the result of range requests in the txn.

This is a succeeding commit of
https://github.com/coreos/etcd/pull/5689
2016-07-26 19:49:07 -07:00
de2c3ec3db etcdserver, api, membership: don't race on setting version
Fixes #6029
2016-07-26 18:21:40 -07:00
640d511684 Merge pull request #6047 from gyuho/doc
Documentation: fix links in upgrades
2016-07-26 12:54:14 -07:00
914e9266cb Documentation: fix links in upgrades 2016-07-26 12:51:59 -07:00
0d6c028aa2 Merge pull request #6032 from xiang90/gateway
fix a few issues in grpc gateway
2016-07-25 16:48:38 -07:00
484f579905 raft: hide Campaign rules on applying all entries 2016-07-25 15:53:39 -07:00
864947a825 Merge pull request #6037 from heyitsanthony/disable-tracing
etcdmain: disable grpc tracing by default
2016-07-25 15:20:28 -07:00
d6b22323a8 etcdmain: disable grpc tracing by default 2016-07-25 14:23:36 -07:00
6079be7dae Merge pull request #6036 from heyitsanthony/fix-embed-defaults
embed: add listen urls to default config
2016-07-25 12:49:45 -07:00
537057bd11 Merge pull request #6033 from heyitsanthony/watch-adapter
integration: support watch with cluster_proxy tag
2016-07-25 11:34:15 -07:00
42fc36b4d6 embed: add listen urls to default config
Was only setting the advertise urls.
2016-07-25 11:06:03 -07:00
7f0f9795bf Merge pull request #6028 from xiang90/plat
doc: update platform.md
2016-07-25 09:58:55 -07:00
2b4c37f54a grpcproxy: don't leak goroutines on watch proxy shutdown 2016-07-25 09:34:36 -07:00
418bb5e176 grpcproxy: bind clientv3.Watcher on initialization 2016-07-25 09:34:36 -07:00
1cad722a6d integration: support watch apis in cluster_proxy build 2016-07-25 09:34:36 -07:00
ac96963003 clientv3: support creating a Watch from a WatchClient 2016-07-25 09:34:36 -07:00
4fa9363aca grpcproxy: client watch adapter 2016-07-25 09:34:36 -07:00
020a24f1c3 *: regenerate proto for handling eof error 2016-07-23 16:21:44 -07:00
38b69a9301 scripts:genproto.sh: update grpc-gateway 2016-07-23 16:18:42 -07:00
fffa484a9f *: regenerate proto for adding deleterange 2016-07-23 16:17:44 -07:00
b4ce427d45 etcdserverpb: add missing deleterange annotation 2016-07-23 15:59:53 -07:00
116a1b5855 Merge pull request #6031 from gyuho/vet-fix
grpcproxy: define 'watchergroups' in pointer
2016-07-22 17:39:36 -07:00
abbefc9e25 grpcproxy: define 'watchergroups' in pointer
To avoid copying mutex lock values
2016-07-22 16:54:11 -07:00
5b288f6cd1 Merge pull request #6030 from gyuho/raft-raft
raft: replace 'reflect.DeepEqual' with bytes.Equal
2016-07-22 16:53:11 -07:00
4ff6c72257 raft: replace 'reflect.DeepEqual' with bytes.Equal 2016-07-22 16:34:13 -07:00
8f4a36fd32 doc: update platform.md 2016-07-22 11:24:19 -07:00
ec5c5d9ddf Merge pull request #6021 from xiang90/gateway_test
e2e: add gateway test
2016-07-21 16:48:04 -07:00
c603b5e6a1 e2e: add gateway test 2016-07-21 16:19:54 -07:00
2bf55e3a15 Merge pull request #6016 from endocode/kayrus/fix_serve_err_return
embed: Fixed serve() err return
2016-07-21 11:17:08 -07:00
fee9e2b183 embed: Fixed serve() err return 2016-07-21 18:06:08 +02:00
de638a5e4d Merge pull request #5991 from gyuho/manual
v2http: client certificate auth via common name
2016-07-21 08:02:17 -07:00
214c1e55b0 Merge pull request #5999 from jlamillan/master
Add support for formating output of ls command in json or extended fo…
2016-07-21 07:09:52 -07:00
32553c5796 Merge pull request #6006 from dongsupark/dongsu/fix-build-error-go-systemd
etcdmain: correctly check return values from SdNotify()
2016-07-21 07:08:58 -07:00
624187d25f etcdmain: correctly check return values from SdNotify()
SdNotify() now returns 2 values, sent and err. So startEtcdOrProxyV2()
needs to check the 2 return values correctly. As the 2 values are
independent of each other, error checking needs to be slightly updated
too.

SdNotifyNoSocket, which was previously provided by go-systemd, does not
exist any more. In that case (false, nil) will be returned instead.
2016-07-21 09:19:07 +02:00
00c9fe4753 vendor: update go-systemd
Godeps.json and vendor need to be updated according to the newest
go-systemd, as SdNotify() in go-systemd has changed its API.
2016-07-21 08:20:52 +02:00
f18d5433cc etcdctl: Add support for formating output of ls command in json
The ls command will check for and honor json or extended output formats.

Fixes #5993
2016-07-20 18:05:23 -07:00
42db8f55b2 e2e: test auth enabled with CN name cert 2016-07-20 16:55:45 -07:00
e001848270 Merge pull request #5772 from heyitsanthony/integration-proxy
integration: build tag for proxy
2016-07-20 16:28:12 -07:00
5066981cc7 v2http: test with 'ClientCertAuthEnabled' 2016-07-20 16:24:33 -07:00
25aeeb35c3 v2http: set 'ClientCertAuthEnabled' in client.go 2016-07-20 16:24:15 -07:00
68ece954fb v2http: add 'ClientCertAuthEnabled' in handlers 2016-07-20 16:23:41 -07:00
be001c44e8 embed: set 'ClientCertAuthEnabled' 2016-07-20 16:23:24 -07:00
9510bd6036 etcdserver: add 'ClientCertAuthEnabled' option 2016-07-20 16:22:59 -07:00
0f0d32b073 v2http: move 'testdata' from 'etcdhttp' 2016-07-20 16:20:42 -07:00
ff5709bb41 v2http: client cert cn authentication
introduce client certificate authentication using certificate cn.
2016-07-20 16:20:13 -07:00
ab17165352 v2http: refactor http basic auth
refactor http basic auth code to combine basic auth extraction and validation
2016-07-20 16:20:05 -07:00
768ccb8c10 grpcproxy: respect prev_kv flag 2016-07-20 15:58:33 -07:00
becbd9f3d6 test: grpcproxy integration test pass
Run via
PASSES=grpcproxy ./test
2016-07-20 15:58:33 -07:00
7b3d502b96 integration: build tag cluster_proxy for testing backed by proxy 2016-07-20 15:40:33 -07:00
17e0164f57 clientv3: add KV constructor using pb.KVClient 2016-07-20 15:40:33 -07:00
54df540c2c grpcproxy: wrapper from pb.KVServer to pb.KVClient 2016-07-20 15:40:33 -07:00
15aa64eb3c Merge pull request #6009 from heyitsanthony/fix-progress-notify
v3rpc: don't elide next progress notification on progress notification
2016-07-20 13:46:11 -07:00
65d7e7963a Merge pull request #6011 from heyitsanthony/fix-migrate-test
e2e: use a single member cluster in TestCtlV3Migrate
2016-07-20 13:27:17 -07:00
8c8742f43c integration: change timeouts for TestWatchWithProgressNotify
a) 2 * progress interval was passing with dropped notifies
b) waitResponse was waiting so long that it expected a dropped notify
2016-07-20 13:23:44 -07:00
a289bf58e6 e2e: use a single member cluster in TestCtlV3Migrate
Occasionally migrate would fail because a minority node would be missing
v2 keys. Instead, just use a single member cluster.

Fixes #5992
2016-07-20 12:10:09 -07:00
299ebc6137 v3rpc: don't elide next progress notification on progress notification
Fixes #5878
2016-07-20 11:37:20 -07:00
a7b098b26d Merge pull request #6007 from heyitsanthony/fix-watch-test
integration: fix race in TestV3WatchMultipleEventsTxnSynced
2016-07-20 10:34:54 -07:00
82ddeb38b4 integration: fix race in TestV3WatchMultipleEventsTxnSynced
Writes between watcher creation request and reply were being dropped.

Fixes #5789
2016-07-20 09:55:39 -07:00
aba478fb8a Merge pull request #5793 from mitake/auth-revision
auth, etcdserver: introduce revision of authStore for avoiding TOCTOU problem
2016-07-20 09:32:54 -07:00
edcfcae332 Merge pull request #5995 from heyitsanthony/clientv3-retry-stopped
rpctypes, clientv3: retry RPC on EtcdStopped
2016-07-20 08:54:14 -07:00
ef6b74411c auth, etcdserver: introduce revision of authStore for avoiding TOCTOU problem
This commit introduces revision of authStore. The revision number
represents a version of authStore that is incremented by updating auth
related information.

The revision is required for avoiding TOCTOU problems. Currently there
are two types of the TOCTOU problems in v3 auth.

The first one is in ordinal linearizable requests with a sequence like
below ():
1. Request from client CA is processed in follower FA. FA looks up the
   username (let it U) for the request from a token of the request. At
   this time, the request is authorized correctly.
2. Another request from client CB is processed in follower FB. CB
   is for changing U's password.
3. FB forwards the request from CB to the leader before FA. Now U's
   password is updated and the request from CA should be rejected.
4. However, the request from CA is processed by the leader because
   authentication is already done in FA.

For avoiding the above sequence, this commit lets
etcdserverpb.RequestHeader have a member revision. The member is
initialized during authentication by followers and checked in a
leader. If the revision in RequestHeader is lower than the leader's
authStore revision, it means a sequence like above happened. In such a
case, the state machine returns auth.ErrAuthRevisionObsolete. The
error code lets nodes retry their requests.

The second one, a case of serializable range and txn, is more
subtle. Because these requests are processed in follower directly. The
TOCTOU problem can be caused by a sequence like below:
1. Serializable request from client CA is processed in follower FA. At
   first, FA looks up the username (let it U) and its permission
   before actual access to KV.
2. Another request from client CB is processed in follower FB and
   forwarded to the leader. The cluster including FA now commits a log
   entry of the request from CB. Assume the request changed the
   permission or password of U.
3. Now the serializable request from CA is accessing to KV. Even if
   the access is allowed at the point of 1, now it can be invalid
   because of the change introduced in 2.

For avoiding the above sequence, this commit lets the functions of
serializable requests (EtcdServer.Range() and EtcdServer.Txn())
compare the revision in the request header with the latest revision of
authStore after the actual access. If the saved revision is lower than
the latest one, it means the permission can be changed. Although it
would introduce false positives (e.g. changing other user's password),
it prevents the TOCTOU problem. This idea is an implementation of
Anthony's comment:
https://github.com/coreos/etcd/pull/5739#issuecomment-228128254
2016-07-20 14:39:04 +09:00
8abae076d1 rpctypes, clientv3: retry RPC on EtcdStopped
Fixes #5983
2016-07-19 18:29:12 -07:00
6e290abee2 Merge pull request #5998 from heyitsanthony/tls-timeout-conn
transport: wrap timeout listener with tls listener
2016-07-19 17:42:05 -07:00
99e0655c2f transport: wrap timeout listener with tls listener
Otherwise the listener will return timeoutConn's, causing a type
assertion to tls.Conn in net.http to fail so http.Request.TLS is never set.
2016-07-19 16:47:14 -07:00
80c2e4098d Merge pull request #5997 from xiang90/l_r
raft: fix readindex
2016-07-19 15:25:53 -07:00
1c5754f02d raft: fix readindex 2016-07-19 15:00:58 -07:00
e5f0cdcc69 Merge pull request #5984 from xiang90/p_b
grpcproxy: do not send duplicate events to watchers
2016-07-19 12:47:23 -07:00
783675f91c grpcproxy: do not send duplicate events to watchers 2016-07-19 10:14:57 -07:00
d3d954d659 Merge pull request #5990 from xiang90/wcr
clientv3/integration: fix race in TestWatchCompactRevision
2016-07-19 10:08:28 -07:00
e177d9eda2 clientv3/integration: fix race in TestWatchCompactRevision 2016-07-19 09:31:44 -07:00
1bf78476cf Merge pull request #5980 from xiang90/gateway
etcdmian: gateway supports dns srv discovery
2016-07-18 22:10:54 -07:00
c7c5cd324b etcdmian: gateway supports dns srv discovery 2016-07-18 21:53:24 -07:00
fcc96c9ebd Merge pull request #5976 from heyitsanthony/fix-kadc
integration: drain keepalives in TestLeaseKeepAliveCloseAfterDisconnectRevoke
2016-07-18 20:21:44 -07:00
d914502090 Merge pull request #5978 from heyitsanthony/fix-compactor
compactor: make event ordering well-defined in TestPeriodicPause
2016-07-18 20:06:57 -07:00
27a30768e1 integration: drain keepalives in TestLeaseKeepAliveCloseAfterDisconnectRevoke
Fixes #5900
2016-07-18 19:45:59 -07:00
a1d823c2aa compactor: make event ordering well-defined in TestPeriodicPause
Fixes #5847
2016-07-18 19:45:31 -07:00
a61862acc7 Merge pull request #5977 from xiang90/b_proxy
grpcproxy: return interface
2016-07-18 19:12:43 -07:00
5cccb49498 Merge pull request #5979 from heyitsanthony/unix-embed
embed: support unix sockets
2016-07-18 17:05:58 -07:00
5271cf0160 grpcproxy: return interface 2016-07-18 16:47:58 -07:00
8d897fd51f integration: use unix sockets in TestEmbedEtcd
Was getting tcp port conflicts in semphore even after assigning unique ports.

Fixes #5953
2016-07-18 16:42:08 -07:00
e177f391f2 embed: support unix peers 2016-07-18 16:41:41 -07:00
32ed0aa0b3 Merge pull request #5626 from gyuho/stresser
etcd-tester: stress with range, delete
2016-07-18 15:26:34 -07:00
969bcd282b etcd-tester: stress with range, delete 2016-07-18 15:17:08 -07:00
7fbc1e39a6 Merge pull request #5973 from heyitsanthony/purge-test
fileutil: rework purge tests so they don't poll
2016-07-18 14:59:19 -07:00
7bfe75cbf3 Merge pull request #5963 from xiang90/p_filter
grpcproxy: add filter to watcher
2016-07-18 14:56:10 -07:00
3a5e418ff9 Merge pull request #5974 from xiang90/a_proxy
grpcproxy: add auth
2016-07-18 14:55:13 -07:00
cae56f583e Merge pull request #5975 from bts/restrict-channel-types-in-demo
contrib/raftexample: Restrict commit/error channel types in raftNode
2016-07-18 14:54:56 -07:00
e1892e264d grpcproxy: add auth 2016-07-18 14:26:22 -07:00
851d69181d Merge pull request #5972 from xiang90/m_proxy
grpcproxy: add maintenance proxy
2016-07-18 14:24:22 -07:00
b86e723107 contrib/raftexample: Restrict channel types 2016-07-18 17:19:54 -04:00
c920ce0453 fileutil: rework purge tests so they don't poll
Fixes #5966
2016-07-18 14:19:09 -07:00
fd24340903 grpcproxy: add maintenance proxy 2016-07-18 13:31:03 -07:00
58aa3483c3 grpcproxy: add filter to watcher 2016-07-18 13:02:34 -07:00
6dbdf6e55f Merge pull request #5958 from xiang90/lease_proxy
*: add lease proxy
2016-07-18 12:57:14 -07:00
3f74e9db0d *: add lease proxy 2016-07-18 12:06:59 -07:00
b61f882635 Merge pull request #5962 from xiang90/c_p
*: add cluster proxy
2016-07-18 11:55:35 -07:00
1c8b30dbdb Merge pull request #5957 from heyitsanthony/wait-panic
testutil, clientv3: wait for panics in txn tests to complete
2016-07-18 11:18:23 -07:00
dc80ae86d9 Merge pull request #5969 from gyuho/vendor-fix
*: fix 'gogo/protobuf' compatibility issue
2016-07-18 10:56:34 -07:00
8893ab0198 Merge pull request #5965 from endocode/kayrus/build_env
build: allow to build outside the etcd directory
2016-07-18 10:36:27 -07:00
984badeb03 testutil, clientv3: wait for panics in txn tests to complete
Fixes #5901
2016-07-18 09:37:33 -07:00
50be793f09 *: regenerate proto 2016-07-18 09:33:32 -07:00
e7c1594c82 vendor: update 'gogo/protobuf' 2016-07-18 09:33:09 -07:00
6e53f75092 scripts: update gogo/protobuf, use 'gofast' plugin
- Fix https://github.com/coreos/etcd/issues/5942
- Partial fix for https://github.com/coreos/etcd/issues/5865
2016-07-18 09:31:27 -07:00
cab2e45319 build: allow to build outside the etcd directory
And added gopath hack which allows to build without setting any GOPATH
env. Just run the build script when you have installed golang.
2016-07-18 17:40:08 +02:00
336e4f2f28 Merge pull request #5960 from xiang90/a_i
etcdserver: set applied index correctly
2016-07-16 19:56:27 -07:00
d9e939d5d1 Merge pull request #5961 from heyitsanthony/test-e2e-unsupported
e2e: run e2e tests on unsupported architectures
2016-07-16 17:12:04 -07:00
52764f1e5a Merge pull request #5959 from heyitsanthony/build-same-place-xarch
build: build cross-compiled binaries in bin/ by default
2016-07-16 17:11:57 -07:00
bdfbd26e94 *: add cluster proxy 2016-07-16 12:15:32 -07:00
2d761d64a4 etcdserver: set applied index correctly 2016-07-16 11:44:18 -07:00
884452c403 e2e: run e2e tests on unsupported architectures 2016-07-16 10:30:19 -07:00
cb9ee7320b build: build cross-compiled binaries in bin/ by default
Otherwise GOARCH=386 PASSES="build integration" ./test fail on amd64
because the e2e tests can't find the binaries. Added a BINDIR option
for writing the build output to somewhere else, in case it's needed.
2016-07-16 10:21:25 -07:00
331ec82400 Merge pull request #5955 from gyuho/port
integration: new ports for embed test
2016-07-15 20:19:33 -07:00
4a5795b55f integration: new ports for embed test 2016-07-15 16:47:32 -07:00
04155423f5 Merge pull request #5956 from xiang90/fix_renew
*: fix issue found in fast lease renew
2016-07-15 15:53:59 -07:00
4835322aa1 Merge pull request #5954 from heyitsanthony/fix-embed-cfg-validate
embed: fix nil dereference on error to set up initial cluster
2016-07-15 15:41:40 -07:00
b26f1bb2b6 Merge pull request #5951 from gyuho/vendor
*: update grpc-gateway and its import paths
2016-07-15 15:33:18 -07:00
93e3112471 Merge pull request #5910 from xiang90/grpc_proxy
grpcproxy: initial watch proxy
2016-07-15 15:12:21 -07:00
3839a55910 *: fix issue found in fast lease renew 2016-07-15 15:07:15 -07:00
34602b87ec embed: fix nil dereference on error to set up initial cluster 2016-07-15 14:43:00 -07:00
5f3aa43899 grpcproxy: initial watch proxy 2016-07-15 14:30:45 -07:00
ecebe7b979 vendor: change to 'grpc-ecosystem' from 'gengo' 2016-07-15 13:29:05 -07:00
5b92e17e86 *: regenerate proto files 2016-07-15 13:24:19 -07:00
4a7b730e69 scripts: update genproto with grpc-ecosystem 2016-07-15 13:21:41 -07:00
4ec94989cf Documentation: change to grpc-ecosystem 2016-07-15 12:11:30 -07:00
b2b98399fb embed: change import path to 'grpc-ecosystem' 2016-07-15 12:10:38 -07:00
1ba7bb237f Merge pull request #5939 from heyitsanthony/x86-unit-test
travis: unit test on 386
2016-07-15 09:43:31 -07:00
38d38f2635 travis: unit test on 386 2016-07-14 20:23:35 -07:00
1dfafd8fe0 test: separate phases of tests into configurable passes 2016-07-14 20:23:35 -07:00
b50d2395fd Merge pull request #5949 from heyitsanthony/fix-functester-failfast
etcd-tester: add FailFast(false) to grpc calls
2016-07-14 19:50:21 -07:00
0419d3ecf7 etcd-tester: add FailFast(false) to grpc calls 2016-07-14 19:16:41 -07:00
3e21d9f023 Merge pull request #5945 from Infra-Red/patch-bench
hack/benchmark: remove deprecated boom parameter
2016-07-14 18:44:48 -07:00
bf0be0fe5e Merge pull request #5948 from heyitsanthony/upgrade-grpc-cred-clobber
vendor: update grpc
2016-07-14 18:44:35 -07:00
b3f8490660 integration: add FailFast(false) to failing tests 2016-07-14 17:58:58 -07:00
d8f0ef0e80 clientv3: use grpc.FailFast(false) for all calls 2016-07-14 17:58:58 -07:00
d9a8a326df vendor: update grpc
Fixes #5871
2016-07-14 17:58:58 -07:00
07ed4da2ff integration: test grpc error equivalence with Error() 2016-07-14 17:58:49 -07:00
51c5c307fa rpctypes: test error equivalence with Error()
grpc.Errorf() now returns *rpcError, which makes comparisons shallow.
2016-07-14 15:59:06 -07:00
ee78f590ba hack/benchmark: remove deprecated boom parameter
Benchmark script will fail to run with -readall flag provided
2016-07-14 23:49:53 +03:00
575682f593 Merge pull request #5944 from heyitsanthony/mvcc-failpoints
build, backend: add backend commit failpoints
2016-07-14 13:08:25 -07:00
14d7dc940d Merge pull request #5943 from gyuho/pause-before-compaction-2
etcd-tester: pause before compaction, fix races, cleanups
2016-07-14 13:02:53 -07:00
ba2725c2d0 build, backend: add backend commit failpoints 2016-07-14 12:26:35 -07:00
ceb9fe4822 etcd-tester: stop stress before compact, fix races
fix race condition between stresser cancel, start
2016-07-14 12:16:42 -07:00
b0f2e5e64a Merge pull request #5927 from xiang90/pacing
*: deny proposals when there is a huge gap between apply/commit
2016-07-14 11:47:53 -07:00
8e59fb749c etcd-tester: increase default qps, fix cleanup 2016-07-14 11:20:16 -07:00
c0cc161ba8 Merge pull request #5937 from coreos/revert-5876-manual
Revert "Dockerfile: use 'ENTRYPOINT' instead of 'CMD'"
2016-07-14 10:35:21 -07:00
27b03f0ed5 *: deny proposals when there is a huge gap between apply/commit 2016-07-14 10:02:55 -07:00
35d379b052 Merge pull request #5934 from heyitsanthony/fix-publish-race
e2e: wait for every etcd server to publish to cluster
2016-07-13 19:22:08 -07:00
2f7da66d43 Revert "Dockerfile: use 'ENTRYPOINT' instead of 'CMD'" 2016-07-13 19:06:20 -07:00
6b487fb199 e2e: wait for every etcd server to publish to cluster
If etcdctl accesses the cluster before all members are published, it
will get an "unsupported protocol scheme" error. To fix, wait for both
the capabilities and published message.

Fixes #5824
2016-07-13 17:01:43 -07:00
3d109be3b4 Merge pull request #3621 from yichengq/usage-stderr
etcdmain: print usage in stderr when flag.Parse fail
2016-07-13 16:56:26 -07:00
071eac3838 Merge pull request #5918 from xiang90/init
etcdmain: only get initial cluster setting if the member is not initi…
2016-07-13 16:28:32 -07:00
c7881fddc2 Merge pull request #5933 from xiang90/doc
doc: better link for embed etcd
2016-07-13 16:27:32 -07:00
9bcf5a83fb doc: better link for embed etcd 2016-07-13 16:24:56 -07:00
c32dd164fe Merge pull request #5932 from heyitsanthony/nuke-etcdctl-v0.4
etcdctl: remove v0.4 support
2016-07-13 16:18:33 -07:00
8368e6a992 embed: only get initial cluster setting if the member is not init 2016-07-13 16:03:27 -07:00
97ff1abb3e etcdctl: remove 0.4 import command 2016-07-13 15:30:37 -07:00
439b96f090 etcdctl: remove 0.4 peer syncing 2016-07-13 15:26:25 -07:00
06fd46f835 Merge pull request #5928 from xiang90/err_code
rpctypes: use permission deny code for permission deny error
2016-07-13 15:00:02 -07:00
41a98dbd66 Merge pull request #5925 from heyitsanthony/embed-etcdmain
embeddable etcdmain
2016-07-13 13:51:19 -07:00
f6ef6157cc Documentation: link embedding etcd into docs 2016-07-13 13:28:11 -07:00
c0299ca6f4 integration: test embedded etcd 2016-07-13 10:40:03 -07:00
f4f33ea767 etcdmain, embed: export Config and StartEtcd into embed/
Lets programs embed etcd.

Fixes #5430
2016-07-13 10:40:03 -07:00
81d5ae3ce1 rpctypes: use permission deny code for permission deny error 2016-07-13 10:32:10 -07:00
7114a27345 Merge pull request #5922 from xiang90/l_b
tools/benchmark: add benchmark for lease keepalive
2016-07-12 10:48:04 -07:00
8273e1c07e tools/benchmark: add benchmark for lease keepalive 2016-07-12 10:40:56 -07:00
a243064e76 Merge pull request #5924 from xiang90/rm_04
integration: remove upgrade test for etcd0.4
2016-07-12 10:36:16 -07:00
6392ef5c44 integration: remove upgrade test for etcd0.4 2016-07-12 10:13:03 -07:00
7432e9fbe9 Merge pull request #5809 from swingbach/master
raft: make leader transferring workable when quorum check is on
2016-07-12 09:46:18 -07:00
b9f6de9277 Merge pull request #5895 from smallfish/master
etcdserver/api/v2http, Documentation: fix debug pprof index miss / in end
2016-07-12 07:10:53 -07:00
b2c1112288 Merge pull request #5921 from xiang90/r
raft: do not change RecentActive when resetState for progress
2016-07-12 06:54:14 -07:00
c36a40ca15 raft: introduce top-level context in message struct 2016-07-12 16:14:06 +08:00
eb08f2274e raft: do not change RecentActive when resetState for progress 2016-07-11 21:12:14 -07:00
cc26f2c889 Merge pull request #5913 from rboyer/correct-sample-peer-config-file
Correct security configuration for peers in sample config file.
2016-07-11 19:41:41 -07:00
4bc29e2b9c Merge pull request #5902 from mitake/bench-auth
tools: add --user for auth in benchmarks
2016-07-11 18:38:07 -07:00
8a21be721f Merge pull request #5919 from gyuho/raft-lead
raft: set leader id in stepFollower
2016-07-11 18:34:07 -07:00
7edb6bcbe1 etcd: correct security configuration for peers in sample config file 2016-07-11 20:19:27 -05:00
6f3a40cb53 raft: set leader id in stepFollower
Follower has already set its leader ID from
previous append messages from the leader, but
to be consistent,  this adds a line to set its
leader id from leader snapshot message.
2016-07-11 16:37:31 -07:00
ea0a569c4d Merge pull request #5917 from xiang90/rm
*: remove unnecessary data upgrade code
2016-07-11 15:38:07 -07:00
f65e75e4b3 *: remove unnecessary data upgrade code 2016-07-11 15:11:56 -07:00
c0f292e6b8 Merge pull request #5916 from xiang90/ctl
etcdctl: only takes 127.0.0.1:2379 as default endpoint
2016-07-11 13:34:55 -07:00
55ca788efe etcdctl: only takes 127.0.0.1:2379 as default endpoint 2016-07-11 13:28:02 -07:00
2b6f04a58e Merge pull request #5906 from gyuho/release-test
e2e: add basic upgrade tests
2016-07-11 12:42:54 -07:00
a3347e3e68 Merge pull request #5915 from heyitsanthony/doc-new-platform
Documentation: clarify support policy
2016-07-11 12:41:38 -07:00
5b0d52f8c3 Documentation: clarify support policy 2016-07-11 12:10:17 -07:00
e8e561e8f5 e2e: add basic upgrade tests 2016-07-11 11:28:04 -07:00
e5b5cf02d3 test: add upgrade test flag 2016-07-11 11:10:24 -07:00
0d9b6ba0ab raft: fix a few problems 2016-07-11 14:59:53 +08:00
da44e17b58 Merge pull request #5908 from gyuho/raft-cleanup
raft: remove unnecessary type-cast, else-clause
2016-07-10 16:42:42 -07:00
c396b6aaaa raft: remove unnecessary type-cast, else-clause 2016-07-09 22:01:19 -07:00
c47689d98f Merge pull request #5689 from mitake/skip-apply
RFC: etcdserver, pkg: skip needless log entry applying
2016-07-10 01:23:35 +09:00
474eb1b44b Merge pull request #5890 from jaredeh/32bit
Easy 32bit architecture fixes
2016-07-08 13:36:52 -07:00
f78d4713ea etcdserver: atomic access alignment
Most fields accessed with sync/atomic functions are 64bit aligned, but a couple
are not.  This makes comments out of date and therefore misleading.

Affected fields reordered, comments scrubbed and updated.
2016-07-08 11:20:47 -07:00
90889ebc0f raftpb: atomic access alignment
The Entry struct has misaligned fields that are accessed atomically.  The
misalignment is caused by the EntryType enum which the Protocol Buffers
spec forces to be a 32bit int.

Moving the order of the fields without renumbering them in the .proto file
seems to align the go structure without changing the wire format.
2016-07-08 11:13:53 -07:00
df94f58462 raft: atomic access alignment
The relevant structures are properly aligned, however, there is no comment
highlighting the need to keep it aligned as is present elsewhere in the
codebase.

Adding note to keep alignment, in line with similar comments in the codebase.
2016-07-08 11:05:41 -07:00
eded9f5f84 Merge pull request #5887 from gyuho/rate-limiting-stresser
etcd-tester: add rate limits to stresser
2016-07-08 09:32:25 -07:00
a153448b84 tools: add --user for auth in benchmarks
This commit adds --user for auth in benchmarks. Its purpose is
measuring overhead of authentication of v3 API. Of course the given
user must be granted permission of target keys before benchmarking.

Example of a case with no authentication:
% ./benchmark range k1
bench with linearizable range
 10000 / 10000 Booooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! 100.00%2m10s

Summary:
  Total:        130.1850 secs.
  Slowest:      0.4071 secs.
  Fastest:      0.0064 secs.
  Average:      0.0130 secs.
  Stddev:       0.0079 secs.
  Requests/sec: 76.8138

Response time histogram:
  0.006 [1]     |
  0.046 [9990]  |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.087 [3]     |
  0.127 [0]     |
  0.167 [3]     |
  0.207 [2]     |
  0.247 [0]     |
  0.287 [0]     |
  0.327 [0]     |
  0.367 [0]     |
  0.407 [1]     |

Latency distribution:
  10% in 0.0076 secs.
  25% in 0.0086 secs.
  50% in 0.0113 secs.
  75% in 0.0146 secs.
  90% in 0.0209 secs.
  95% in 0.0272 secs.
  99% in 0.0344 secs.

Example of a case with authentication:
% ./benchmark --user=u1:p range k1
bench with linearizable range
 10000 / 10000 Booooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! 100.00%2m11s

Summary:
  Total:        131.4923 secs.
  Slowest:      0.1637 secs.
  Fastest:      0.0065 secs.
  Average:      0.0131 secs.
  Stddev:       0.0070 secs.
  Requests/sec: 76.0501

Response time histogram:
  0.006 [1]     |
  0.022 [9075]  |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.038 [875]   |∎∎∎
  0.054 [36]    |
  0.069 [5]     |
  0.085 [1]     |
  0.101 [1]     |
  0.117 [0]     |
  0.132 [0]     |
  0.148 [5]     |
  0.164 [1]     |

Latency distribution:
  10% in 0.0076 secs.
  25% in 0.0087 secs.
  50% in 0.0114 secs.
  75% in 0.0150 secs.
  90% in 0.0215 secs.
  95% in 0.0272 secs.
  99% in 0.0347 secs.

It seems that current auth mechanism does not introduce visible overhead.
2016-07-08 16:53:05 +09:00
abb20ec51f etcdserver, pkg: skip needless log entry applying
This commit lets etcdserver skip needless log entry applying. If the
result of log applying isn't required by the node (client that issued
the request isn't talking with the node) and the operation has no side
effects, applying can be skipped.

It would contribute to reduce disk I/O on followers and be useful for
a cluster that processes much serializable get.
2016-07-08 15:16:45 +09:00
7c39f41e7c etcd-tester: add rate limiter to stresser 2016-07-07 21:55:12 -07:00
b970e03e19 Merge pull request #5446 from gyuho/gateway_log
tcpproxy: log proxy start
2016-07-07 21:38:01 -07:00
ce8900e3b4 Merge pull request #5899 from heyitsanthony/qos-tuning
Documentation: tuning advice for peer prioritization
2016-07-07 19:48:07 -07:00
e6d15b966c etcdserver/api/v2http, Documentation: fix debug pprof index miss / in end 2016-07-08 10:21:05 +08:00
6f0a67603a Documentation: tuning advice for peer prioritization 2016-07-07 19:14:31 -07:00
a2760c9f49 Merge pull request #5888 from heyitsanthony/v2-one-shot
client: make set/delete one shot operations
2016-07-07 16:41:01 -07:00
c30f89f1d0 client/integration: test v2 client one shot operations 2016-07-07 15:58:58 -07:00
946b3cce1d client: make set/delete one shot operations
Old behavior would retry set and delete even if there's an error. This
can lead to the client returning an error for deleting twice, instead
of returning an error for an interdeterminate state.

Fixes #5832
2016-07-07 15:51:08 -07:00
4f2da16d82 Merge pull request #5897 from xiang90/lock
v3rpc: lock progress and prevKV map correctly
2016-07-07 15:20:37 -07:00
427496ebb8 v3rpc: lock progress and prevKV map correctly 2016-07-07 15:01:05 -07:00
dc2dced129 Merge pull request #5892 from heyitsanthony/auth-cheap-bcrypt
auth: cheap bcrypt for tests
2016-07-07 09:04:57 -07:00
b6a497214e Merge pull request #5883 from westhood/master
clientv3: fix sync base
2016-07-07 07:09:55 -07:00
0b0cbaac09 clientv3: use cheap bcrypt for ExampleAuth and use embedded auth api
Fixes #5783
2016-07-06 23:35:14 -07:00
d4e0e419dc auth: set bcrypt cost to minimum for test cases
DefaultCost makes auth tests 10x more expensive than MinCost.

Fixes #5851
2016-07-06 23:35:06 -07:00
16b0c1d1e1 clientv3: fix sync base
It is not correct to use WithPrefix. Range end will change in every
internal batch.
2016-07-07 12:02:53 +08:00
88a9cf2cea clientv3: add public function to get prefix range end 2016-07-07 10:35:40 +08:00
c4a280e511 Merge pull request #5881 from goby/master
hack: fix etcd execute path in k8s example
2016-07-06 17:04:16 -07:00
244b1d7d20 tcpproxy: add start logging line 2016-07-06 14:21:26 -07:00
1c9e0a0e33 Merge pull request #5886 from heyitsanthony/health-check-str
rafthttp: make health check meaning clearer
2016-07-06 11:32:27 -07:00
4db8f018cb Merge pull request #5885 from xiang90/fix_snap_test
etcdserver: fix TestSnap
2016-07-06 11:21:13 -07:00
3a080143a7 rafthttp: make health check meaning clearer 2016-07-06 10:31:13 -07:00
3451623c71 etcdserver: fix TestSnap 2016-07-06 10:30:15 -07:00
8c4df9a96f hack: fix etcd execute path in k8s example
Change /etcd to /usr/local/bin/etcd
2016-07-06 15:07:00 +08:00
234c30c061 Merge pull request #5880 from xiang90/put_prev
add options to return prev_kv
2016-07-05 21:03:56 -07:00
7ec822107a *: add put prevkv 2016-07-05 20:45:01 -07:00
12bf1a3382 *: rename preserveKVs to prevKv 2016-07-05 20:45:01 -07:00
a78cdeae81 Merge pull request #5877 from heyitsanthony/rsa-fixtures
test: certificate fixes for fedora
2016-07-05 19:34:23 -07:00
929d6ab62c Merge pull request #5850 from xiang90/get_o_kv
*: support get-old-kv in watch
2016-07-05 16:37:24 -07:00
c853704ac9 *: support get-old-kv in watch 2016-07-05 16:17:09 -07:00
c642430fae integration: use RSA certs for testing
Some systems don't support EC due to patent issues, but the tests
should still work.

Fixes #5744
2016-07-05 13:21:21 -07:00
066afd6abd Merge pull request #5876 from gyuho/manual
Dockerfile: use 'ENTRYPOINT' instead of 'CMD'
2016-07-05 11:40:02 -07:00
f19cef960e Dockerfile: use 'ENTRYPOINT' instead of 'CMD'
use entrypoint, so people can specify flags to etcd
without providing the binary.

Signed-off-by: Secret <haichuang221@163.com>
2016-07-05 11:28:19 -07:00
beab76c7a9 Merge pull request #5872 from gyuho/build_doc
Documentation: add instruction on vendoring, build
2016-07-05 10:43:28 -07:00
ff5ddd0909 Documentation: add instruction on vendoring, build
Addressing https://github.com/coreos/etcd/issues/5857#issuecomment-230174840.
2016-07-05 09:55:44 -07:00
660f0fcc3d Merge pull request #5873 from gyuho/raft_updates
raft: fix minor grammar, remove TODO
2016-07-05 09:49:08 -07:00
8c71eb71df Merge pull request #5867 from vmatekole/master
Documentation: Example config amendment
2016-07-05 09:17:22 -07:00
c52bf1ac5d Documentation: Example config amendment 2016-07-05 16:27:47 +02:00
9e0de02fde raft: fix minor grammar, remove TODO
- test 'Term' panic cases (remove TODO)
- fix minor grammar in 'Node' godoc
2016-07-05 07:21:52 -07:00
c7dd74d8d3 Merge pull request #5869 from gyuho/raft_log_test
raft: minor updates and clean up in log.go
2016-07-04 21:51:13 -07:00
881a120453 raft: minor updates and clean up in log.go
- remove redundant test case in log_test.go
- fix test case comment ('equal or larger')
- lastnewi after matching index and term
2016-07-04 16:52:17 -07:00
b566ca225c Merge pull request #5855 from heyitsanthony/fix-windows-wal-init
wal: release wal locks before renaming directory on init
2016-07-03 19:21:23 -07:00
8d99a666f9 Merge pull request #5854 from xiang90/r_f
raft: add features section to readme file
2016-07-03 18:00:31 -07:00
c76dcc5190 raft: add features section to readme file 2016-07-03 17:59:59 -07:00
df61322e5b Merge pull request #5862 from xiang90/fix_sn
etcdserver: commit before sending snapshot
2016-07-03 15:30:20 -07:00
7cb61af245 Merge pull request #5864 from gyuho/raft_cleanup
raft: remove unnecessary reflect.DeepEqual in test
2016-07-03 14:03:08 -07:00
70bf768005 Merge pull request #5861 from xiang90/fix_watch
v3rpc: do not panic on user error for watch
2016-07-03 13:56:33 -07:00
8a8a8253fa etcdserver: commit before sending snapshot 2016-07-03 13:54:05 -07:00
9b5e99efe0 raft: remove unnecessary reflect.DeepEqual in test 2016-07-03 13:42:26 -07:00
13a4056327 v3rpc: do not panic on user error for watch 2016-07-03 08:57:48 -07:00
5991209c2d wal: release wal locks before renaming directory on init
Fixes #5852
2016-07-02 12:14:37 -07:00
7cc4596ebd Merge pull request #5849 from heyitsanthony/fix-compactor-test-races
compactor: make tests deterministic
2016-07-01 23:07:36 -07:00
9405583745 Merge pull request #5830 from heyitsanthony/functest-failpoints
functional-tester: failpoint support
2016-07-01 16:58:36 -07:00
1af7c400d1 compactor: make tests deterministic
Fixes #5847
2016-07-01 16:50:05 -07:00
a5f043c85b etcd-tester: add failpoint cases
Fixes #5754
2016-07-01 15:31:49 -07:00
c6a3048e81 Merge pull request #5848 from gyuho/cluster_version
etcdserver/api: print only major.minor version API
2016-07-01 15:19:08 -07:00
ba023e539a etcdserver/api: print only major.minor version API
Before

2016-07-01 14:57:50.927170 I | api: enabled capabilities for version 3.0.0

After

2016-07-01 14:57:50.927170 I | api: enabled capabilities for version 3.0
2016-07-01 14:58:06 -07:00
c8c5f41a01 Merge pull request #5836 from xiang90/better_d_prev
*: support return prev deleted kv
2016-07-01 14:43:33 -07:00
8d4701bb1d etcd-agent: enable GOFAIL_HTTP endpoint 2016-07-01 14:39:48 -07:00
40c4a7894d *: support return prev deleted kv 2016-07-01 14:01:48 -07:00
ab6f49dc67 Merge pull request #5844 from gyuho/go_version
*: test, docs with go1.6+
2016-07-01 11:27:51 -07:00
a53f538f27 *: test, docs with go1.6+
etcd v3 uses http/2, which doesn't work well with go1.5
2016-07-01 11:16:38 -07:00
d163aefc1a Merge pull request #5823 from davygeek/configcheck
*: fixed some  warning
2016-07-01 10:28:59 -07:00
bf0ab6a2df Merge pull request #5843 from gyuho/manual
Documentation: fix typo in api_grpc_gateway.md
2016-07-01 10:21:45 -07:00
c7a0830a62 Merge pull request #5841 from heyitsanthony/fix-be-semver
etcdserver: exit on missing backend only if semver is >= 3.0.0
2016-07-01 10:14:05 -07:00
b3464a918b Documentation: fix typo in api_grpc_gateway.md 2016-07-01 10:07:14 -07:00
b7f5f8fc99 etcdserver: exit on missing backend only if semver is >= 3.0.0 2016-07-01 09:10:01 -07:00
581f847e06 Merge pull request #5829 from gyuho/ftest
etcd-tester: fix slow leader with injectLatency
2016-06-30 13:46:13 -07:00
0d44947c11 etcd-tester: fix slow leader with injectLatency 2016-06-30 13:41:27 -07:00
78b143b800 Merge pull request #5828 from gyuho/docker
release: fix Dockerfile etcd binary paths
2016-06-30 12:25:51 -07:00
a2f6ec3128 release: fix Dockerfile etcd binary paths
release script uses binary files in 'release/image-docker',
not the ones in "bin/". Tested with v3.0.0 release.
2016-06-30 11:47:33 -07:00
c68d60c99f Merge pull request #5827 from gyuho/version
*: clean up beta in docs, bump to 3.0.0+git
2016-06-30 10:03:28 -07:00
4cd834910e version: bump to v3.0.0+git 2016-06-30 09:43:10 -07:00
cb1a1426b1 *: remove beta from docs 2016-06-30 09:39:52 -07:00
04a9141e45 Merge pull request #5825 from sofuture/jeff/tls-setup-fixes
hack/tls-setup minor fixes
2016-06-30 09:29:41 -07:00
548360b140 Merge pull request #5826 from gyuho/back
Doc: fix typo in dev-guide.md
2016-06-30 09:20:07 -07:00
8ce7481a7f Doc: fix typo in dev-guide.md 2016-06-30 09:14:03 -07:00
74d75a96eb hack: install goreman in tls-setup example 2016-06-30 10:11:47 -06:00
0938c861f0 hack: add tls-setup example generated certs to gitignore 2016-06-30 10:11:28 -06:00
8c96d2573f *: fixed some warning 2016-06-30 23:13:46 +08:00
ad556b7e7d Merge pull request #5821 from davygeek/discovery
discovery: Uniform code style
2016-06-30 07:19:08 -07:00
ea0eab84a4 discovery: Uniform code style 2016-06-30 22:00:01 +08:00
5f4d1c8891 Merge pull request #5819 from gyuho/tester_fix
etcd-tester: handle error in RevHash
2016-06-29 19:36:08 -07:00
dc49016987 etcd-tester: handle error in RevHash 2016-06-29 19:31:45 -07:00
0e137e21bc Merge pull request #5817 from gyuho/ctl_consistent
ctlv3: make flags, commands formats consistent
2016-06-29 16:15:54 -07:00
9b47ca5972 ctlv3: make flags, commands formats consistent
1. Capitalize first letter
2. Remove period at the end

(followed the pattern in linux coreutil man page)
2016-06-29 15:52:06 -07:00
3b80df7f4e Merge pull request #5814 from heyitsanthony/functest-refactor
etcd-tester: refactor cluster and failure code
2016-06-29 15:25:55 -07:00
b7d0497c47 Merge pull request #5807 from xiang90/gproxy
*: initial implementation of grpc-proxy
2016-06-29 13:28:57 -07:00
150321f5ac Merge pull request #5815 from gyuho/raft_test_fix
raft: give correct offset in unstable test
2016-06-29 13:27:14 -07:00
2cc2372165 raft: give correct offset in unstable test
`unstable.entries[i] has raft log position i+unstable.offset`

So, this fixes some test cases by giving them correct
offsets.
2016-06-29 12:29:36 -07:00
6d8c647db8 *: initial implementation of grpc-proxy 2016-06-29 12:06:04 -07:00
5f459a64ce etcd-tester: refactor cluster member handling 2016-06-29 11:25:33 -07:00
402df5bd03 etcd-tester: refactor failure code to reduce code duplication 2016-06-29 11:03:34 -07:00
63f78bf7c8 etcd-tester: refactor round loop 2016-06-29 11:03:34 -07:00
66d195ff75 Merge pull request #5813 from nekto0n/encoder-pointer
rafthttp: use pointers to avoid extra copies upon message encoding
2016-06-29 10:01:27 -07:00
ff908b4ba8 Merge pull request #5812 from heyitsanthony/test-merge-base
test: use merge-base for commit title checking
2016-06-29 09:50:26 -07:00
dc218fb41d test: use merge-base for commit title checking
Otherwise, will compare branch with forked master against upstream master.
2016-06-29 09:28:53 -07:00
fd5bc21522 rafthttp: use pointers to avoid extra copies upon message encoding 2016-06-29 21:17:18 +05:00
7f3b2e23a4 Merge pull request #5811 from davygeek/golintnotice
client: follow golint notice change errors.New to fmt.Errorf
2016-06-29 09:12:49 -07:00
e020b2a228 raft: make leader transferring workable when quorum check is on 2016-06-29 18:24:58 +08:00
8e9097d0c0 Merge pull request #5748 from mitake/auth-disable
disabling auth in v3 API
2016-06-28 22:32:44 -07:00
3b91648070 client: follow golint notice change errors.New to fmt.Errorf and use 'var eps []string' instead 'var make([]string, 0)' 2016-06-29 13:21:49 +08:00
a4667cb863 Merge pull request #5700 from mqliang/proxy-compact
proxy: implement compaction function
2016-06-28 20:49:01 -07:00
2e2f405b1e proxy:replace c with client to improve readability 2016-06-29 11:30:03 +08:00
f28a87d835 proxy: implement compaction 2016-06-29 11:28:10 +08:00
83d9ce3d7c Merge pull request #5803 from gyuho/manual
raft: simplify truncateAndAppend
2016-06-28 20:07:35 -07:00
8f8ff4d519 Merge pull request #5805 from gyuho/ftest
etcd-tester: match ErrTimeout in stresser
2016-06-28 19:51:21 -07:00
745e1e2cf9 e2e: enhance the test case of auth disabling 2016-06-29 11:31:42 +09:00
15f2fd0726 etcd-tester: match ErrTimeout in stresser
Fix https://github.com/coreos/etcd/issues/5804.
2016-06-28 19:20:28 -07:00
df31eab136 raft: simplify truncateAndAppend
truncateAndAppend no need the value of 'after' with subbing one
2016-06-28 18:53:12 -07:00
66107b8653 auth: invalidate every token in disabling auth 2016-06-29 10:31:46 +09:00
8e825de35f Merge pull request #5513 from vikstrous/clustererror
improve error message for ClusterError
2016-06-28 18:15:35 -07:00
8216fdc59f Merge pull request #5799 from xiang90/grpcnaming
clientv3: add grpc naming resolver
2016-06-28 17:51:23 -07:00
4f57bb313f clientv3: add grpc naming resolver 2016-06-28 17:06:58 -07:00
1b2f025414 Merge pull request #5801 from heyitsanthony/fix-watch-closeerr-race
clientv3: only use return closeErr when donec is closed
2016-06-28 17:05:48 -07:00
1db4ee8c61 clientv3: only use closeErr on watch when donec is closed
Fixes #5800
2016-06-28 16:14:09 -07:00
81322b498e Merge pull request #5798 from gyuho/tests_more
Tests other projects to ensure it compiles
2016-06-28 15:22:32 -07:00
ede0b584b8 test: test builds on other projects 2016-06-28 15:03:19 -07:00
da180e0790 Merge pull request #5796 from gyuho/bench
benchmark: fix Compact request
2016-06-28 14:14:07 -07:00
bc6d7659af Merge pull request #5795 from xiang90/filter
*: support watch with filters
2016-06-28 14:07:12 -07:00
ae057ec508 benchmark: fix Compact request 2016-06-28 13:58:28 -07:00
dced92f8bd *: support watch with filters
Now user can filter events with types. The API is also extensible.
It might make sense for the proxy to filter out events based on
more expensive/customized filter.
2016-06-28 13:46:57 -07:00
5f1c763993 Merge pull request #5553 from swingbach/master
raft: implemented read-only query when quorum check is on
2016-06-28 12:47:43 -07:00
ddffdc3e37 Merge pull request #5725 from mitake/auth-not-enabled
auth, etcdserver: let Authenticate() fail if auth isn't enabled
2016-06-28 12:34:54 -07:00
ec232ec9d8 Merge pull request #5787 from heyitsanthony/compact-resp
clientv3, ctl3, clientv3/integration: add compact response to compact
2016-06-28 12:27:42 -07:00
38035c8c13 Merge pull request #5794 from xiang90/fix_c
mvcc: do not hash consistent index
2016-06-28 12:25:32 -07:00
ef9754910e mvcc: do not hash consistent index 2016-06-28 09:36:26 -07:00
1c25aa6c48 clientv3, ctl3, clientv3/integration: add compact response to compact 2016-06-28 09:32:31 -07:00
0cd5c658aa Merge pull request #5788 from gyuho/retry_tester
etcd-tester: match ErrTimeoutDueToLeaderFail
2016-06-27 21:16:07 -07:00
ac68f70843 etcd-tester: match ErrTimeoutDueToLeaderFail
stresser in followers should retry when failure is injected to
their leader.
2016-06-27 20:48:06 -07:00
0faae33ace raft: implemented read-only query when quorum check is on 2016-06-28 10:52:53 +08:00
c00e97ea49 Merge pull request #5785 from gyuho/doc_update
Documentation/upgrades: upgrade 3.0 doc
2016-06-27 15:46:53 -07:00
c8a7d281ee Documentation/upgrades: upgrade 3.0 doc 2016-06-27 15:45:44 -07:00
a5c2cd2708 Merge pull request #5784 from heyitsanthony/doc-todos
Documentation: clear out some TODOs
2016-06-27 15:20:30 -07:00
11fdf2dd18 Documentation: clear out some TODOs 2016-06-27 15:00:18 -07:00
3b300f42e9 Merge pull request #5781 from gyuho/compact_client
*: compact with physical in client side
2016-06-27 14:46:54 -07:00
b4162f8a45 Merge pull request #5782 from heyitsanthony/doc-lint
Documentation: conform to header style
2016-06-27 12:20:31 -07:00
f63e6875bd e2e: test 'physical' flag in compact cmd 2016-06-27 12:07:49 -07:00
76e2bf03b8 etcdctl: v3 compact with physical flag 2016-06-27 12:07:46 -07:00
859e336d68 clientv3: configurable physical in compact 2016-06-27 12:04:04 -07:00
35229eb2d3 Documentation: conform to header style 2016-06-27 12:00:24 -07:00
bbed3ecc8d Merge pull request #5780 from xiang90/check_i
etcdserver: check index of the kv when restarting
2016-06-27 11:44:10 -07:00
9614dc6e71 etcdserver: check index of the kv when restarting 2016-06-27 10:27:27 -07:00
8df37d53d6 auth, etcdserver: let Authenticate() fail if auth isn't enabled
Successful Authenticate() would be confusing and make trouble shooting
harder if auth isn't enabled in a cluster.
2016-06-26 22:49:23 -07:00
aab905f7cc Merge pull request #5776 from mitake/commit-title
test: more accurate checking of commit title
2016-06-27 14:48:10 +09:00
cfc171d5f7 Merge pull request #5777 from xiang90/c_be
etcdserver: refuse to restart if backend file is missing
2016-06-26 22:34:08 -07:00
891ddcba6e etcdserver: refuse to restart if backend file is missing 2016-06-26 21:16:51 -07:00
555028f3d1 test: more accurate checking of commit title 2016-06-26 21:05:47 -07:00
efcf03f0b1 Merge pull request #5773 from heyitsanthony/integration-unixsock
integration: use unix sockets for all connections
2016-06-25 16:17:20 -07:00
ae6e879812 Merge pull request #5774 from gyuho/raft_minor_fix
raft: len(entries) before Lock, use firstIndex
2016-06-25 11:13:16 -07:00
6a48961895 raft: len(entries) before Lock, use firstIndex
- To avoid unnecessary locking in case len(entries) == 0
- use firstIndex method
2016-06-24 23:50:00 -07:00
13d0ea7f54 integration: use unix domain sockets for all connections 2016-06-24 21:18:19 -07:00
bbb84ff709 discovery: use pkg/transport to create http transport 2016-06-24 21:04:39 -07:00
54d56e2531 pkg/types: accept unix and unixs schemes 2016-06-24 21:04:39 -07:00
fc1a226d15 pkg/transport: unix domain socket listener and transport 2016-06-24 21:04:31 -07:00
0c820dc7ba Merge pull request #5769 from xiang90/unstable
doc: add unstable
2016-06-24 13:38:54 -07:00
40f62ab4a5 Merge pull request #5771 from gyuho/docker
*: separate Dockerfile for quay build trigger
2016-06-24 13:26:05 -07:00
0da05a896f doc: add experimental apis 2016-06-24 13:05:53 -07:00
8a71f749d7 *: separate Dockerfile for quay build trigger
Fix https://quay.io/repository/coreos/etcd-git/build/d75d80b1-7d8d-42bd-af07-645b7da3a118.
2016-06-24 12:55:10 -07:00
3424f95b03 Merge pull request #5770 from gyuho/op_guide
*: move 'Project detail' to op-guide
2016-06-24 10:50:03 -07:00
862b3fe2be *: move 'Project detail' to op-guide 2016-06-24 10:47:12 -07:00
aeb5b3c82b Merge pull request #5766 from heyitsanthony/eschew-you
doc: remove you/your from current docs
2016-06-24 09:29:26 -07:00
e1b9ccb1d7 doc: eschew "you" for current docs 2016-06-24 09:28:12 -07:00
d284a45a4b Merge pull request #5765 from heyitsanthony/autotls-security
doc: auto-tls example in security guide
2016-06-24 09:17:38 -07:00
9bde740cf9 doc: auto-tls example in security guide 2016-06-24 09:15:46 -07:00
c1d2149a0f Merge pull request #5767 from mitake/build
build: remove needless output
2016-06-24 09:03:14 -07:00
15b267fbfd Merge pull request #5768 from gyuho/raft_comment
raft: fix comment, method name in progress
2016-06-24 08:38:02 -07:00
33f7e7583b raft: fix comment,method name to needSnapshotAbort
And 'maybeSnapshotAbort' does not 'unset'
the pendingSnapshot. 'resetState', which is called after this
metho, is the one that unsets pendingSnapshot. So this changes
the method name.
2016-06-24 07:54:10 -07:00
abc1cb945b build: remove needless output
Current build script outputs its name to stdout because of its
checking argv[0].

$ ./build
./build

The line is a little bit mysterious so this commit removes it.
2016-06-24 13:54:53 +09:00
a7189ef073 Merge pull request #5762 from gyuho/member_auth
Documentation/demo: add member, auth example
2016-06-23 16:10:57 -07:00
78d9ae1820 Merge pull request #5763 from heyitsanthony/local-tester-fp
local-tester: support failpoints
2016-06-23 13:01:26 -07:00
9b4dc92fdc Merge pull request #5761 from xiang90/proxy_v2
*: make it clear that proxy only supports v2 api now
2016-06-23 12:35:04 -07:00
755d192ff7 *: make it clear that proxy only supports v2 api now 2016-06-23 12:06:42 -07:00
244266708b local-tester: support failpoints 2016-06-23 12:04:11 -07:00
b2a8acdf10 Documentation/demo: add member, auth example 2016-06-23 11:50:37 -07:00
9664df1b5e Merge pull request #5760 from gyuho/peer-urls
*: change ctlv3 flag peerURLs to 'peer-urls'
2016-06-23 10:12:28 -07:00
f9d250ad1b e2e: update flag to 'peer-urls' 2016-06-23 09:53:30 -07:00
fa74a0d3bb etcdctl: change peerURLs flag to 'peer-urls' 2016-06-23 09:52:25 -07:00
c949811752 Merge pull request #5758 from dannysauer/master
index is incremented in Watcher; remove double-increment
2016-06-23 07:57:21 -07:00
5247702d8d Merge pull request #5755 from nekto0n/reuse-timer
Reuse timer in backend.run.
2016-06-23 07:28:09 -07:00
a998fb4af1 etcdctl: index is incremented in Watcher; remove double-increment 2016-06-23 08:54:34 -05:00
dbc7c2cf4e backend: reuse timer in run().
Benchmarks:

```
import (
	"testing"
	"time"
)

func BenchmarkTimeAfter(b *testing.B) {
	b.ReportAllocs()
	for n := 0; n < b.N; n++ {
		select {
		case <- time.After(1 * time.Millisecond):
		}
	}
}

func BenchmarkTimerReset(b *testing.B) {
	b.ReportAllocs()
	t := time.NewTimer(1 * time.Millisecond)
	for n := 0; n < b.N; n++ {
		select {
		case <- t.C:
		}
		t.Reset(1 * time.Millisecond)
	}
}
```

Running reveals that each loop results in 3 allocs:

```
BenchmarkTimeAfter-4 	    2000	   1112134 ns/op	     192 B/op	       3 allocs/op
BenchmarkTimerReset-4	    2000	   1109774 ns/op	       0 B/op	       0 allocs/op
```
2016-06-23 18:49:41 +05:00
b945a3fcc8 Merge pull request #5753 from gyuho/example
clientv3: add auth example
2016-06-22 20:27:30 -07:00
2da5bdd4df clientv3: add auth example 2016-06-22 20:06:13 -07:00
e4ab1540c8 Merge pull request #5752 from gyuho/mkdir
Make mkdir consistent
2016-06-22 16:16:38 -07:00
4a0f922a6c pkg/transport: use TouchDirAll 2016-06-22 15:57:55 -07:00
6cfc03a5f9 wal: use CreateDirAll 2016-06-22 15:57:55 -07:00
c363fd288b etcdserver: use CreateDirAll 2016-06-22 15:57:47 -07:00
5720fe812e etcdctl: use CreateDirAll 2016-06-22 15:55:56 -07:00
187faba3e0 pkg/fileutil: fix TouchDirAll, add CreateDirAll
os.MkdirAll never returns os.ErrExist.
And add another function to ensure deepest
directory is empty.
2016-06-22 15:54:17 -07:00
df9a52e53f Merge pull request #5702 from gyuho/vet
*: go vet, go lint fixes
2016-06-22 14:52:34 -07:00
6fbf8be3ac Merge pull request #5751 from heyitsanthony/fail-bad-commit-msg
test: check commit titles
2016-06-22 14:03:15 -07:00
b7253992d4 test: check commit titles 2016-06-22 13:30:22 -07:00
da85108ca2 client: improve error message for ClusterError 2016-06-22 13:13:12 -07:00
c1e3601776 raftexample: fixes from go vet, go lint 2016-06-22 12:04:15 -07:00
e221699fd8 rafthttp: fix from go vet, go lint 2016-06-22 12:04:15 -07:00
725ded40f7 etcdserver: fix from go vet, go lint 2016-06-22 12:04:15 -07:00
e2138179e3 client: fix from go vet, go lint 2016-06-22 12:04:15 -07:00
6557ef7cd8 *: copy all exported members in tls.Config
Without this, go vet complains

assignment copies lock value to n: crypto/tls.Config contains sync.Once
contains sync.Mutex
2016-06-22 12:04:08 -07:00
84c416491e Merge pull request #5739 from heyitsanthony/serialize-txn
etcdserver: make serialized txns auth-aware
2016-06-22 11:49:56 -07:00
caffcb7fbb *: go vet fix in go tip 2016-06-22 11:10:59 -07:00
30cfa30490 etcdserver: make serialized txns auth-aware 2016-06-22 10:51:42 -07:00
aafb2e9430 etcdserver: add lock to authApplier so serialized requests don't race 2016-06-22 10:51:42 -07:00
27ef4baa9c Merge pull request #5749 from gyuho/manual
*: misc typos and go vet fixes
2016-06-22 10:45:02 -07:00
6480066054 *: misc typos and go vet fixes 2016-06-22 10:32:13 -07:00
8d259d3cf1 Merge pull request #5745 from xiang90/count_client
clientv3: add withCount support
2016-06-22 10:04:06 -07:00
82991074bf Merge pull request #5733 from mitake/user-detail
etcdctl: a flag for getting detailed information of a user
2016-06-22 09:26:00 -07:00
0e7690780f etcdctl: a flag for getting detailed information of a user
This commit adds a new flag --detail to etcdctl user get command. The
flag enables printing the detailed permission information of the user
like below example:

$ ETCDCTL_API=3 bin/etcdctl --user root:p user get u1
User: u1
Roles: r1 r2
$ ETCDCTL_API=3 bin/etcdctl --user root:p user get u1 --detail
User: u1

Role r1
KV Read:
        [k1, k5)
KV Write:
        [k1, k5)

Role r2
KV Read:
        a
        b
        [k8, k9)
KV Write:
        a
        b
        [k8, k9)
2016-06-22 13:29:48 +09:00
6496ae005d clientv3: add withCount support 2016-06-21 21:17:35 -07:00
0b5ea3ec94 Merge pull request #5742 from xiang90/count
*: support count in range query
2016-06-21 19:42:08 -07:00
def21f11a9 *: support count in range query 2016-06-21 16:20:55 -07:00
5a6ad1ea76 Merge pull request #5738 from heyitsanthony/fp
build with failpoints
2016-06-21 15:02:45 -07:00
de68818f03 etcdserver: add some failpoints 2016-06-21 14:43:20 -07:00
7f8ffd7dbe test, build: support failpoints 2016-06-21 14:43:20 -07:00
6009e88077 test, build: make build script source-able without doing a build 2016-06-21 14:35:20 -07:00
99957e9831 Merge pull request #5736 from gyuho/cleanup
etcdctl/ctlv3: minor clean ups
2016-06-21 13:31:20 -07:00
80aa5978ca etcdctl/ctlv3: minor clean ups
- Fix typo
- Improve command ordering (elect should be below lock)
- Update migrate command description
2016-06-21 13:12:01 -07:00
c01c36bcfd Merge pull request #5735 from gyuho/auth_doc
etcdctl/ctlv3: document auth,user,role
2016-06-21 12:49:31 -07:00
e5d9ca5180 etcdctl/ctlv3: document auth,user,role 2016-06-21 12:46:42 -07:00
22bae02fe5 Merge pull request #5734 from xiang90/learning
doc: move docs to learning
2016-06-21 11:02:04 -07:00
7c12949b41 doc: move docs to learning 2016-06-21 10:49:46 -07:00
1b8e83ae60 Merge pull request #5732 from mitake/e2e-user-role-dyn-update
e2e: add test cases for updating user and role during operations
2016-06-21 09:54:18 -07:00
4106e56d91 e2e: check role revoking during operations 2016-06-21 15:52:36 +09:00
68bcbdc84e e2e: check user deletion during operations 2016-06-21 15:03:04 +09:00
d017814eaa Merge pull request #5722 from mitake/auth-v3-check-test
e2e: check runtime permission changing
2016-06-20 22:42:43 -07:00
8920e7c4d5 Merge pull request #5731 from gyuho/grpc_log
*: use capnslog for grpclog
2016-06-20 20:35:28 -07:00
a1c7a7df5e *: use capnslog for grpclog 2016-06-20 20:35:03 -07:00
6fe4d9d30a e2e: check runtime permission changing
This commit adds extends the test for checking runtime permission
grant/revoke.
2016-06-21 11:55:09 +09:00
6d81601df3 vendor: update capnslog 2016-06-20 19:39:15 -07:00
0cc59f3976 Merge pull request #5730 from gyuho/cli_dep
*: codegangsta/cli to urfave/cli
2016-06-20 16:54:15 -07:00
bdca594495 etcdctl/ctlv2: use latest Action interface 2016-06-20 16:34:28 -07:00
1e0ff8555e Merge pull request #5729 from xiang90/fix_bench
benchmark: fix watch bench
2016-06-20 16:02:09 -07:00
0ae9d444f9 ctlv2: use urfave/cli in ctlv2 2016-06-20 15:17:03 -07:00
c4df15ff3e vendor: codegangsta/cli to urfave/cli
For https://github.com/coreos/etcd/issues/3901.
2016-06-20 15:06:20 -07:00
ce180bbaf1 Merge pull request #5685 from heyitsanthony/multictx-watcher
clientv3: watch with arbitrary ctx values
2016-06-20 14:52:40 -07:00
d5696cb6ef Merge pull request #5712 from gyuho/curl_v3
e2e: grpc-gateway cURL tests
2016-06-20 14:48:29 -07:00
b4f0a8853b e2e: grpc-gateway cURL tests 2016-06-20 14:29:10 -07:00
1097d63ff7 clientv3/integration: test WithRequireLeader on Watch 2016-06-20 14:26:16 -07:00
2bd5d66596 benchmark: fix watch bench 2016-06-20 14:00:46 -07:00
a01f5a2786 Merge pull request #5728 from gyuho/log_dir
etcd-agent: set up directory for etcd logs
2016-06-20 13:25:25 -07:00
722f5b2a8c clientv3: watch with arbitrary ctx values
Sets up a new watch stream for every unique set of ctx values.

Fixes #5354
2016-06-20 12:44:51 -07:00
e5583b26eb Merge pull request #5711 from xiang90/client_bytes
*: add client network metrics
2016-06-20 12:03:18 -07:00
50f2f984e4 etcd-agent: set up directory for etcd logs 2016-06-20 11:32:14 -07:00
35fd81e465 *: add client network metrics 2016-06-20 11:18:06 -07:00
fb1f1ce1fd Merge pull request #5727 from xiang90/fix_watch_bench
benchmark: correctly count number of watchers
2016-06-20 11:00:18 -07:00
2a2dd1075f benchmark: correctly count number of watchers 2016-06-20 10:37:17 -07:00
729f5b45fd Merge pull request #5720 from xiang90/report_recv
*: fix pending events metrics
2016-06-20 06:44:16 -07:00
6e717775a8 Merge pull request #5723 from mitake/etcdctl-misc
etcdctl: slightly enhance output of role revoke-permission
2016-06-20 06:14:28 -07:00
0173564122 etcdctl: slightly enhance output of role revoke-permission 2016-06-20 16:57:50 +09:00
6f28b43806 *: fix pending events metrics 2016-06-19 23:00:39 -07:00
8111e0f7dc Merge pull request #5716 from ajityagaty/get_filtering
v3api: Add a flag to RangeRequest to return only the keys.
2016-06-19 14:50:15 -07:00
ad5d55dd4c v3api: Add a flag to RangeRequest to return only the keys.
Currently the user can't list only the keys in a prefix search. In
order to support such operations the filtering will be done on the
server side to reduce the encoding and network transfer costs.
2016-06-19 14:18:39 -07:00
23621387fc Merge pull request #5714 from gyuho/wal_dir
*: use fileutil.TouchDirAll
2016-06-19 12:02:46 -07:00
d37e564eaa etcdserver: use TouchDirAll 2016-06-19 11:26:52 -07:00
ce50ee14d8 Merge pull request #5710 from xiang90/rm_la
*: remove old flag support
2016-06-19 06:57:28 -07:00
eaa72dfa0b Merge pull request #5709 from gyuho/docker
update: Dockerfile, documentation
2016-06-18 19:57:34 -07:00
b03c832bed Merge pull request #5698 from gyuho/documentation
Documentation: grpc-gateway
2016-06-17 15:33:18 -07:00
3ddfa16c46 Documentation: update container.md 2016-06-17 15:22:13 -07:00
eec706b9ae etcdserverpb: generate Swagger API JSON 2016-06-17 15:19:32 -07:00
09e5db5a46 Documentation: add grpc-gateway doc 2016-06-17 15:19:28 -07:00
8ea6be38ba *: remove old flag support
These legacy flags support are here only because we do not want
CoreOS updates to break people.

Now people will be aware of that they switch to etcd3. Do not need
to support 0.x flags any more.
2016-06-17 14:51:45 -07:00
c25ff426af Dockerfile: build image with alpine 2016-06-17 14:42:40 -07:00
6dcd020d7d Merge pull request #5707 from heyitsanthony/test-all
test: don't hardcode packages for testing
2016-06-17 14:08:46 -07:00
3f6619ada9 Merge pull request #5708 from xiang90/pending
*: add pending/failed proposal metrics
2016-06-17 13:48:39 -07:00
9feb3d0e51 etcd-tester: fix goword warnings 2016-06-17 13:37:35 -07:00
f7b84d69a4 etcd-agent/client: fixup godocs 2016-06-17 13:37:35 -07:00
ea21b8ee1f lessor: fix go vet, goword warnings, and unreliable test 2016-06-17 13:37:25 -07:00
016be1ef31 contrib/recipes: fix govet and goword warnings 2016-06-17 13:13:09 -07:00
598fa7a10e *: add pending/failed proposal metrics 2016-06-17 13:09:38 -07:00
aa503f84d5 Merge pull request #5705 from xiang90/metrics_peer
*: add peer prefix for network metrics between peers
2016-06-17 12:38:06 -07:00
bd8627c8ab Merge pull request #5706 from xiang90/app_metrics
etcdserver: add applied metrics
2016-06-17 12:26:23 -07:00
6af0917812 *: add peer prefix for network metrics between peers 2016-06-17 11:59:49 -07:00
57474697af etcdserver: add applied metrics 2016-06-17 11:52:50 -07:00
74b13aab61 grpcproxy: fix go vet warnings 2016-06-17 11:41:49 -07:00
6c0882145a test: don't use hardcoded package lists for testing 2016-06-17 11:41:49 -07:00
e4f56c4eb6 Merge pull request #5701 from xiang90/rm_exp
*: make auto-compaction-retention non-experimental
2016-06-17 11:02:43 -07:00
8bb0ce54e6 Merge pull request #5704 from gyuho/agent_fix
etcd-agent: fix test
2016-06-17 10:58:14 -07:00
61659302db Merge pull request #5703 from gyuho/grpc_proto
Update gRPC, gogo/protobuf
2016-06-17 10:56:38 -07:00
63c13e8b98 etcd-agent: fix test 2016-06-17 10:47:15 -07:00
63901be674 *: regenerate proto 2016-06-17 10:22:28 -07:00
d03a3d141e vendor: update gRPC dependency 2016-06-17 10:22:16 -07:00
b0d7455fb1 scripts: use latest gogo/protobuf for proto files
For https://github.com/coreos/etcd/issues/5671.
2016-06-17 10:21:18 -07:00
d68664841c *: make auto-compaction-retention non-experimental 2016-06-17 10:04:31 -07:00
3488555bc3 Merge pull request #5674 from mitake/auth-v3-get-users-roles
*: support getting all users and roles in auth v3
2016-06-17 06:51:47 -07:00
18253e2723 *: support getting all users and roles in auth v3
This commit expands RPCs for getting user and role and support list up
all users and roles. etcdctl v3 is now support getting all users and
roles with the newly added option --all e.g. etcdctl user get --all
2016-06-17 16:22:41 +09:00
cc4f35887c Merge pull request #5699 from gyuho/readme
README: more demos, links
2016-06-16 22:57:31 -07:00
dde2aea214 Documentation: add 'migrate' command example 2016-06-16 19:47:57 -07:00
1066c9b806 README: add dash, play.etcd.io, animated demo link 2016-06-16 19:47:25 -07:00
2d08e093c1 Merge pull request #5696 from xiang90/fix_panic
etcdserver: fix panic when getting header of raft request
2016-06-16 13:58:50 -07:00
adff458895 etcdserver: fix panic when getting header of raft request 2016-06-16 13:42:10 -07:00
b3558894f2 Merge pull request #5695 from gyuho/proto
*: use latest protodoc, regenerate
2016-06-16 12:35:44 -07:00
c98ca2db43 Merge pull request #5493 from mqliang/cache
proxy: cache range request in proxy
2016-06-16 12:30:13 -07:00
5f5c3c8f82 Merge pull request #5694 from xiang90/comp
etcdserver: only pause compaction when sending snapshot
2016-06-16 12:26:55 -07:00
7f9adfd5b8 Merge pull request #5692 from xiang90/fix_live
raft: make tick unblock and fix potential live lock
2016-06-16 12:26:31 -07:00
0bae7b635c *: regenerate proto, doc 2016-06-16 11:57:46 -07:00
d26d006fd6 scripts: use latest protodoc to skip grpc-gateway
protodoc now skips grpc-gateway options
2016-06-16 11:57:05 -07:00
1c6070ccc7 Merge pull request #5693 from Jiaweizdev/update-port-number-in-proxy-doc
doc: update port number in proxy doc
2016-06-16 08:59:39 -07:00
699e76b631 etcdserver: only pause compaction when sending snapshot 2016-06-16 08:57:02 -07:00
fb165fcc58 doc: update port number 2016-06-16 17:13:52 +02:00
848f539536 raft: make tick unblock and fix potential live lock 2016-06-16 08:01:06 -07:00
49266dca2d Merge pull request #5690 from xiang90/fix_s
etcdserver: save state before save snapshot
2016-06-15 22:36:30 -07:00
9c78cda088 etcdserver: save state before save snapshot 2016-06-15 22:00:33 -07:00
b07fbbf27c Merge pull request #5687 from mitake/auth-v3-txn-2
etcdserver: permission checking of Txn() in authApplierV3
2016-06-16 12:51:10 +09:00
cdf1a2ee2c etcdserver: permission checking of Txn() in authApplierV3 2016-06-15 20:10:16 -07:00
5385ca0a43 Merge pull request #5659 from heyitsanthony/bridge-more-errors
bridge: packet corruption and reordering
2016-06-15 19:23:22 -07:00
11869905ae bridge: packet corruption and reordering
With bonus bridge connection code refactor.
2016-06-15 17:08:19 -07:00
555976ea84 Merge pull request #5684 from gyuho/test
etcd-agent: SIGQUIT when cleanup
2016-06-15 16:13:20 -07:00
bc69142940 Merge pull request #5683 from xiang90/fix_refresh
store: copy old value when refresh + cas
2016-06-15 16:11:26 -07:00
bd604a029e etcd-agent: SIGQUIT when cleanup 2016-06-15 16:03:25 -07:00
df56f9d6f9 store: copy old value when refresh + cas 2016-06-15 15:32:58 -07:00
b607b36a6c Merge pull request #5648 from ingvagabund/doc-nits
docs: Clustering.md: Switch "command line" and "environment variables"
2016-06-15 15:24:20 -07:00
c505f03c62 Merge pull request #5682 from cdancy/patch-2
Documentation: add gradle-etcd-rest-plugin to libraries-and-tools.md
2016-06-15 15:02:51 -07:00
f392370f73 Documentation: add gradle-etcd-rest-plugin to libraries-and-tools.md
Add link to the gradle-etcd-rest-plugin client under the 'Gradle plugins' sub-section.

Fixes #5681
2016-06-15 17:59:50 -04:00
7d666ab8b9 Merge pull request #5677 from gyuho/minor_etcdserver_fix
etcdserver: preallocate slices
2016-06-15 13:20:06 -07:00
32d766d749 etcdserver: preallocate slice 2016-06-15 13:03:10 -07:00
b98fa063c8 Merge pull request #5672 from heyitsanthony/applier-auth-layer
auth, etcdserver: separate auth checking apply from core apply
2016-06-15 10:06:34 -07:00
16db9e68a2 auth, etcdserver: separate auth checking apply from core apply 2016-06-15 09:03:27 -07:00
5676c5cf26 proxy: serve range request from proxy cache if set serializable 2016-06-15 14:12:36 +08:00
eca38c109a vendor:add groupcache lru package 2016-06-15 14:12:36 +08:00
16d86fd4f8 Merge pull request #5669 from xiang90/proto-gw
main: add grpc-gateway support
2016-06-14 17:46:00 -07:00
7f569a163c test: go vet should only test the go code in the dir 2016-06-14 17:09:06 -07:00
252adc0caf *: update dependencies 2016-06-14 17:09:06 -07:00
5a7b7f7595 main: add grpc-gateway support
Now etcd can serve HTTP json request at /v3alpha/
2016-06-14 17:09:06 -07:00
a6fec46c0e Merge pull request #5652 from gyuho/version
etcdctl/*: print API version
2016-06-14 16:04:24 -07:00
1e38ab1706 etcdctl: print API version (v2, v3 separate) 2016-06-14 15:33:39 -07:00
6958334db2 Merge pull request #5662 from xiang90/auth_delete
*: support deleteRange perm checking
2016-06-13 20:13:43 -07:00
c97107cf81 Merge pull request #5660 from heyitsanthony/fix-watch-test
e2e: don't Put() after watchTest finishes
2016-06-13 19:39:30 -07:00
a571bd0271 Merge pull request #5661 from xiang90/fix_subset
auth: fix remove subset when there are equal ranges
2016-06-13 19:03:10 -07:00
c75fa6fdc9 *: support deleteRange perm checking 2016-06-13 17:49:13 -07:00
e67613830e auth: fix remove subset when there are equal ranges 2016-06-13 17:13:55 -07:00
d78ef8bc72 e2e: don't Put() after watchTest finishes
Fixes #5598
2016-06-13 16:55:02 -07:00
a26ebfb675 Merge pull request #5654 from xiang90/auth_key
auth: add key support in merge func
2016-06-13 16:53:36 -07:00
38546a9d24 auth: use bytes equal when possible 2016-06-13 16:37:21 -07:00
390c89b7f9 auth: remove the special checking case for key auth 2016-06-13 16:37:20 -07:00
9be65414eb auth: add key support in merge func 2016-06-13 16:37:20 -07:00
2a018240e7 Merge pull request #5657 from gyuho/cleanup
etcd-tester: cleanup in compact error, log level
2016-06-13 15:15:52 -07:00
84953365a2 etcd-tester: cleanup in compact error, log level 2016-06-13 14:54:53 -07:00
18851e70b6 Merge pull request #5656 from gyuho/auth_bytes
make auth key, rangeEnd typed like mvcc ([]byte)
2016-06-13 14:41:19 -07:00
5d6af0b51f etcdserver: key, rangeEnd in []byte for auth 2016-06-13 14:21:25 -07:00
e9d2eb2b54 auth: key, range in []byte type
Fix https://github.com/coreos/etcd/issues/5655.
2016-06-13 14:21:22 -07:00
70a2add2b0 Merge pull request #5650 from gyuho/wal_update
wal: use bytes.Equal, other minor updates
2016-06-13 09:05:53 -07:00
b4aa4607cb wal: use bytes.Equal, other minor updates
- Replace reflect.Equal with bytes.Equal where possible
- Remove some TODOs
- Some minor simplifications
2016-06-13 01:33:53 -07:00
2e29bea8fe docs: Clustering.md: Switch command line and environment variables to reflect the order of examples right below 2016-06-13 10:23:21 +02:00
f25b3dbfc8 Merge pull request #5640 from xiang90/permcheck
auth: clean permission checking
2016-06-12 18:26:21 -07:00
667093bbd1 Merge pull request #5645 from gyuho/wal_simple
wal: simplify boolean return
2016-06-11 11:10:59 -07:00
3243795522 wal: simplify boolean return 2016-06-11 10:36:52 -07:00
4aaf7f94cf Merge pull request #5643 from hongchaodeng/doc-fix
v3 docs: ErrCompaction -> ErrCompacted
2016-06-11 01:40:58 -07:00
c11418b56c docs: v3 api, ErrCompaction -> ErrCompacted 2016-06-10 21:53:06 -07:00
bdb5a321d1 Merge pull request #5642 from gyuho/client
vendor: update grpc dependency
2016-06-10 21:09:52 -07:00
5225a4e4bc clientv3: fix client for grpc change
Fix https://github.com/coreos/etcd/issues/5638.
2016-06-10 20:40:46 -07:00
b2a531d5a3 vendor: update grpc dependency
For 59486d9c17
2016-06-10 20:40:06 -07:00
1bbe09eb3c auth: clean permission checking 2016-06-10 19:23:20 -07:00
cff5851956 Merge pull request #5639 from mitake/email
MAINTAINERS: updating email address of Hitoshi Mitake
2016-06-10 18:40:41 -07:00
6b80f0ad7e MAINTAINERS: updating email address of Hitoshi Mitake
I'm mainly using the updated email address for working.
2016-06-10 18:12:39 -07:00
ae366ba4f1 Merge pull request #5637 from xiang90/auth_clean
auth: cleanup get perm func
2016-06-10 18:12:07 -07:00
f99ff5d513 auth: cleanup get perm func 2016-06-10 16:36:51 -07:00
3eab6bef6a Merge pull request #5635 from xiang90/cl
auth: clean up range_perm_cache.go
2016-06-10 16:08:54 -07:00
c802c23e6d Merge pull request #5636 from xiang90/mt
MAINTAINERS: add Hitoshi as a maintainer of auth pkg
2016-06-10 16:07:04 -07:00
43db5515e7 MAINTAINERS: add Hitoshi as a maintainer of auth pkg 2016-06-10 15:55:57 -07:00
c6fae5d566 Merge pull request #5631 from raoofm/patch-8
Doc: Fault tolerance table
2016-06-10 15:49:36 -07:00
175c67a552 Merge pull request #5634 from gyuho/wal
wal: PrivateFileMode/DirMode as in pkg/fileutil
2016-06-10 15:41:43 -07:00
65ff76882b Merge pull request #5624 from xiang90/warn_apply
etcdserver: warn heavy apply
2016-06-10 15:28:27 -07:00
47d5257622 pkg/fileutil: expose PrivateFileMode/DirMode 2016-06-10 15:22:14 -07:00
77efe4cda9 auth: clean up range_perm_cache.go 2016-06-10 15:21:04 -07:00
4570eddc2c wal: PrivateFileMode/DirMode as in pkg/fileutil
To make it consistent with pkg/fileutil
2016-06-10 15:20:57 -07:00
3210bb8181 Merge pull request #5632 from xiang90/auth_store_cleanup
auth: cleanup store.go
2016-06-10 14:49:56 -07:00
a92ea417b4 Merge pull request #5534 from gyuho/readme
README: minor fix in README
2016-06-10 14:46:15 -07:00
64eccd519d etcdserver: warn heavy apply 2016-06-10 14:43:34 -07:00
bb6102c00c Merge pull request #5630 from xiang90/del_user
auth: add del functions for user/role
2016-06-10 14:28:36 -07:00
f8c1a50195 auth: cleanup store.go 2016-06-10 14:19:29 -07:00
2781553a9e Merge pull request #5615 from mitake/auth-v3-consistent-token
auth, etcdserver: make auth tokens consistent for all nodes
2016-06-10 14:19:21 -07:00
37ac90c419 Doc: Fault tolerance table 2016-06-10 17:12:36 -04:00
8776962008 auth: add del functions for user/role 2016-06-10 14:11:00 -07:00
ead5096fa9 auth, etcdserver: make auth tokens consistent for all nodes
Currently auth tokens are generated in the replicated state machine
layer randomly. It means one auth token generated in node A cannot be
used for node B. It is problematic for load balancing and fail
over. This commit moves the token generation logic from the state
machine to API layer (before raft) and let all nodes share a single
token.

Log index of Raft is also added to a token for ensuring uniqueness of
the token and detecting activation of the token in the cluster (some
nodes can receive the token before generating and installing the token
in its state machine).

This commit also lets authStore have simple token related things. It
is required because of unit test. The test requires cleaning of the
state of the simple token things after one test (succeeding test can
create duplicated token and it causes panic).
2016-06-10 13:55:37 -07:00
65abcc1a59 Merge pull request #5629 from xiang90/put_role
auth: cleanup
2016-06-10 13:53:34 -07:00
cf99d596f5 auth: cleanup get user and get role usage 2016-06-10 13:34:40 -07:00
0914d65c1f auth: add put role 2016-06-10 13:20:48 -07:00
e854fa1856 Merge pull request #5622 from heyitsanthony/e2e-auth-keys
e2e: auth key put test
2016-06-10 12:17:38 -07:00
cd569d640b Merge pull request #5600 from lucab/to-upstream/armored-sigs
doc: sign release artifacts in armor mode
2016-06-10 12:11:53 -07:00
aa56e47712 Merge pull request #5625 from xiang90/put_user
auth: add put_user
2016-06-10 12:10:21 -07:00
1e22137a9a e2e: test auth is respected for Puts 2016-06-10 11:43:06 -07:00
b3a0b0502c etcdserver: respect auth on serialized Range 2016-06-10 11:43:05 -07:00
ae30ab7897 auth: add put_user 2016-06-10 11:27:42 -07:00
247103c40b Merge pull request #5623 from xiang90/get_role
auth: add getRole
2016-06-10 11:17:59 -07:00
1958598a18 auth: add getRole 2016-06-10 10:59:34 -07:00
c459073c6d Merge pull request #5620 from xiang90/auth_recover
auth: implement recover
2016-06-10 10:35:03 -07:00
05f9d1b716 Merge pull request #5610 from gyuho/handle_timeout_error
etcd-tester: do not exit for compaction timeout
2016-06-10 09:47:54 -07:00
5631acdb8f etcd-tester: do not exit for compact timeout
Temporary fix for https://github.com/coreos/etcd/issues/5606.
2016-06-10 09:44:45 -07:00
ca4e78687e auth: implement recover 2016-06-10 09:37:37 -07:00
bdc7035c10 Merge pull request #5617 from liggitt/preallocation
fileutil: avoid double preallocation
2016-06-09 22:27:17 -07:00
4f7622fb9a fileutil: avoid double preallocation 2016-06-10 00:27:59 -04:00
d4ac09de0f Merge pull request #5612 from gyuho/index_bench
mvcc: add keyIndex, treeIndex Restore benchmark
2016-06-09 16:09:56 -07:00
6e32e8501a Merge pull request #5613 from xiang90/rootrole
*: add admin permission checking
2016-06-09 16:00:37 -07:00
7da1940dce Merge pull request #5607 from xiang90/raft_user
raft: add docker/swarmkit as notable raft users
2016-06-09 15:39:09 -07:00
f1c6fa48f5 *: add admin permission checking 2016-06-09 15:25:09 -07:00
6bbd8b7efb mvcc: add keyIndex benchmark test
Useful later when trying to optimize our restore operations.
2016-06-09 14:13:18 -07:00
a7c5058953 Merge pull request #5608 from heyitsanthony/clientv3-auth-opts
clientv3: use separate dialopts for auth dial
2016-06-09 12:56:59 -07:00
349eaf117a clientv3: use separate dialopts for auth dial
Needs to use a different balancer from the main client connection
because of the way grpc uses the Notify channel.
2016-06-09 10:38:57 -07:00
ab65d2b848 raft: add docker/swarmkit as notable raft users 2016-06-09 10:10:44 -07:00
78c957df41 Merge pull request #5603 from heyitsanthony/clientv3-close-keepalive
clientv3: close keepalive channel if TTL locally exceeded
2016-06-09 09:44:32 -07:00
0554ef9c39 clientv3/integration: tests for closing lease channel 2016-06-09 09:12:59 -07:00
e534532523 clientv3: close keep alive channel if no response within TTL 2016-06-09 09:12:59 -07:00
fb0df211f0 Merge pull request #5586 from xiang90/root
auth: add root user and root role
2016-06-09 00:23:45 -07:00
da2f2a5189 auth: add root user and root role 2016-06-08 19:55:08 -07:00
a548cab828 Merge pull request #5602 from gyuho/get_leader
clientv3/integration: WaitLeader to follower
2016-06-08 17:03:25 -07:00
753073198f clientv3/integration: WaitLeader to follower
Fix https://github.com/coreos/etcd/issues/5601.
2016-06-08 16:45:32 -07:00
77dee97c2f Merge pull request #5578 from mitake/auth-v3-range
auth, etcdserver: permission of range requests
2016-06-08 16:33:25 -07:00
253e313c09 *: support granting and revoking range
This commit adds a feature for granting and revoking range of keys,
not a single key.

Example:
$ ETCDCTL_API=3 bin/etcdctl role grant r1 readwrite k1 k3
Role r1 updated
$ ETCDCTL_API=3 bin/etcdctl role get r1
Role r1
KV Read:
        [a, b)
        [k1, k3)
        [k2, k4)
KV Write:
        [a, b)
        [k1, k3)
        [k2, k4)
$ ETCDCTL_API=3 bin/etcdctl --user u1:p get k1 k4
k1
v1
$ ETCDCTL_API=3 bin/etcdctl --user u1:p get k1 k5
Error:  etcdserver: permission denied
2016-06-08 14:58:25 -07:00
9dad78c68f Merge pull request #5599 from gyuho/e2e_fix
e2e: fix race in ranging test tables
2016-06-08 14:46:02 -07:00
bd5e1ea1c0 e2e: fix race in ranging test tables
Fix https://github.com/coreos/etcd/issues/5598.

race conditions were detected in iterating the test table
because the go func closure doesn't receive the 'puts' index
in the argument. This can cause the test to run wrong put
operations.
2016-06-08 13:44:05 -07:00
87d105c036 Merge pull request #5596 from heyitsanthony/wal-warn-slow-fsync
wal: warn if sync exceeds a second
2016-06-08 13:07:13 -07:00
6bb96074da auth, etcdserver: permission of range requests
Currently the auth mechanism doesn't support permissions of range
request. It just checks exact matching of key names even for range
queries. This commit adds a mechanism for setting permission to range
queries. Range queries are allowed if a range of the query is [begin1,
end1) and the user has a permission of reading [begin2, range2) and
[begin1, end2) is a subset of [begin2, range2). Range delete requests
will follow the same rule.
2016-06-08 11:57:32 -07:00
35329a1674 Merge pull request #5597 from gyuho/btree_dep
*: update google/btree dependency
2016-06-08 11:39:29 -07:00
0b7e5c70a5 *: update google/btree dependency 2016-06-08 11:23:49 -07:00
39eaa37dcf wal: warn if sync exceeds a second 2016-06-08 11:03:18 -07:00
ff2b24a8ac Merge pull request #5583 from heyitsanthony/grpc-nuke-waitstate
clientv3: use grpc balancer
2016-06-08 09:45:44 -07:00
4a13c9f9b3 clientv3: use grpc balancer 2016-06-08 09:24:13 -07:00
e551aec339 doc: sign release artifacts in armor mode
Release guide steps to artifacts signing defaults to binary
signatures, while producing .asc files.
This commit changes to armored signatures, also matching appc
requirements.

Fixes #5594
2016-06-08 17:51:54 +02:00
66a6ed63cb Merge pull request #5585 from xiang90/token_cleanup
etcdserver: make usernameFromCtx more go style
2016-06-08 08:08:58 -07:00
4d56f54898 Merge pull request #5590 from xiang90/user
auth: add getuser
2016-06-08 08:08:36 -07:00
7abc8f21eb integration: update tests for new grpc reconnection interface 2016-06-08 01:04:59 -07:00
62f8ec25c0 clientv3: use grpc reconnection logic 2016-06-08 01:04:59 -07:00
1823702cc6 integration: bridge connections to grpc server
Tests need to disconnect the network connection for the client to check
reconnection paths but closing a grpc connection closes the logical connection.
To disconnect the client, instead have a bridge between the server and
the client which can monitor and reset connections.
2016-06-08 00:34:53 -07:00
b382c2c86f vendor: update grpc 2016-06-07 22:46:43 -07:00
c6496dcff6 auth: add getuser 2016-06-07 22:43:04 -07:00
3e057129e2 Merge pull request #5588 from purpleidea/fix/test-typo
e2e: tests: fix small typo
2016-06-07 22:25:57 -07:00
0048782d97 e2e: tests: fix small typo
Found when trying to get the e2e tests to run on Fedora which they
don't because of https://github.com/kr/pty/issues/21
2016-06-08 01:14:11 -04:00
2da6fb6616 Merge pull request #5587 from gyuho/function
etcd-tester: retry for 'etcdserver: not capable'
2016-06-07 22:01:07 -07:00
350673f1f8 etcd-tester: retry for 'etcdserver: not capable'
Fix https://github.com/coreos/etcd/issues/5573.

Currently stresser starts at the same time as cluster start.
If the stresser got launched too fast/early, all stressers
exit from the error 'etcdserver: not capable', which
means the cluster is not ready yet. This adds additional
error checking, so stresser can retry.
2016-06-07 21:56:04 -07:00
cc1155c93b etcdserver: make usernameFromCtx more go style 2016-06-07 21:17:32 -07:00
9a14b796e0 Merge pull request #5582 from gyuho/watch_range_end
etcdctl: support watch with range_end
2016-06-07 17:08:49 -07:00
7eaf73d273 e2e: test watch command with 2 args 2016-06-07 16:52:19 -07:00
624d5eb0cb etcdctl: support range_end for watch command
Fix https://github.com/coreos/etcd/issues/5575.
2016-06-07 16:52:15 -07:00
50ef8f148c Merge pull request #5579 from gyuho/request_union
RequestOp, ResponseOp
2016-06-07 13:54:59 -07:00
1610391449 *: following changes for proto update 2016-06-07 13:33:03 -07:00
1e4d3603db clientv3,ctlv3: following changes for proto change 2016-06-07 13:32:36 -07:00
6e149e3485 etcdserver: following updates for proto change 2016-06-07 13:32:07 -07:00
ca630a0803 etcdserverpb: RequestOp, ResponseOp
Fix https://github.com/coreos/etcd/issues/5504.
2016-06-07 13:31:10 -07:00
0d1133178f Merge pull request #5574 from xiang90/auth
auth: make naming consistent
2016-06-07 11:24:29 -07:00
83ce1051ff auth: make naming consistent 2016-06-07 10:54:50 -07:00
4984d82d27 Merge pull request #5570 from heyitsanthony/rafthttp-snapshot-tests
rafthttp: snapshot testing
2016-06-06 16:02:22 -07:00
7f461b2df9 Merge pull request #5572 from heyitsanthony/fallocate-eintr-fallback
pkg/fileutil: fall back to truncate() if fallocate is interrupted
2016-06-06 15:24:42 -07:00
dc91da50b5 rafthttp: snapshot tests 2016-06-06 11:38:11 -07:00
93f114c76c snap: return errors if Message's snapshot is not entirely read 2016-06-06 11:38:11 -07:00
3aadb25c31 pkg/ioutil: exact readcloser
NewExactReadCloser wraps a ReadCloser so it returns errors if exact number
of bytes are not read.
2016-06-06 11:38:10 -07:00
5be39d2c84 wal: don't preallocate on old tail file
Code is only there to handle an edge case where the tail wasn't preallocated
already (e.g., via old etcd version or a crash). It also triggers tmpfs
corruption, so remove it.
2016-06-06 11:31:25 -07:00
9022137d2b Merge pull request #5567 from gyuho/wal_type
wal: minor fixes
2016-06-06 10:31:03 -07:00
54aac4ab7e pkg/fileutil: fall back to truncate() if fallocate is interrupted
Fixes #5558
2016-06-06 09:52:34 -07:00
008081ffb5 wal: minor fixes
- remove unnecessary type cast
- simply modulo operations
2016-06-06 09:43:19 -07:00
c63eaf45f9 Merge pull request #5566 from ktateish/fix-single-dash
*: replace '-' with '--' for long options
2016-06-05 21:38:29 -07:00
8b75a33398 *: replace '-' with '--' for long options
A long option should have double dashes (cf. #4595),
so are error messages.
2016-06-06 12:25:45 +09:00
3c2a47ea64 Merge pull request #5565 from gyuho/raft_doc
raft: small fix in doc
2016-06-05 19:16:08 -07:00
843c53192a raft: small fix in doc
'MsgBeat' is an internal type to signal the leader, not the message type
that gets sent to its followers. 'MsgHeartbeat' is the type sent to followers.
2016-06-05 17:47:46 -07:00
2baca91ee2 Merge pull request #5564 from mitake/auth-v3-cleaning
cleaning auth v3
2016-06-05 08:40:06 -07:00
94f22e8a07 *: rename RPCs and structs related to revoking
This commit renames RPCs and structs related to revoking.
1. UserRevoke -> UserRevokeRole
2. RoleRevoke -> RoleRevokePermission
2016-06-05 16:57:23 +09:00
60fc1e4d4e auth, etcdserver: error codes for revoking non existing role and permission
This commit adds error codes for representing revoking non existing
role (from user) and permission (from role).
2016-06-05 16:41:10 +09:00
8bebd8caa9 Merge pull request #5559 from gyuho/docker_guide
Documentation: add docker guide for v3
2016-06-04 19:14:48 -07:00
2f00b1e071 Documentation: add docker guide for v3 2016-06-04 16:43:44 -07:00
429b2eee58 Merge pull request #5548 from mitake/auth-v3-revoke-delete
revoke user, revoke role, and delete role in auth v3
2016-06-03 21:44:37 -07:00
c7a1423d45 *: support deleting a role in auth v3
This commit implements RoleDelete() RPC for supporting deleting a role
in auth v3. It also adds a new subcommand "role delete" to etcdctl.
2016-06-04 13:42:45 +09:00
0cb1343109 *: support revoking a key from a role in auth v3
This commit implements RoleRevoke() RPC for supporting revoking a key
from a role in auth v3. It also adds a new subcommand "role revoke" to
etcdctl.
2016-06-04 13:42:45 +09:00
957b07c408 *: support revoking a role from a user in auth v3
This commit implements UserRevoke() RPC for supporting revoking a role
from a user in auth v3. It also adds a new subcommand "user revoke" to
etcdctl.
2016-06-04 13:39:26 +09:00
3f1af453b9 Merge pull request #5560 from gyuho/lease_test
clientv3/integration: test lease closed connection
2016-06-03 18:23:03 -07:00
0cb4dd4331 clientv3/integration: test lease closed connection
Tests if lease operations return ErrConnClosed when
the client is closed.
2016-06-03 16:41:32 -07:00
6a35833fc3 Merge pull request #5450 from luxas/more_arches
travis: Catch compilation errors in CI for arm and ppc64le
2016-06-03 16:12:28 -07:00
c093234e3a Merge pull request #5557 from heyitsanthony/fix-watcher-cancel
mvcc: don't cancel watcher if stream is already closed
2016-06-03 11:28:54 -07:00
88afb0b0a6 Merge pull request #5543 from heyitsanthony/clientv3-unblock-reconnect
clientv3: don't hold client lock while dialing
2016-06-03 11:28:44 -07:00
6187d812da Merge pull request #5556 from xiang90/r_test
raft: fix TestNodeStepUnblock
2016-06-03 11:13:43 -07:00
f57b4eb46d mvcc: don't cancel watcher if stream is already closed
Close() already cancels all the watchers but doesn't bother to clear out
the bookkeeping maps so Cancel() may try to cancel twice.

Fixes #5533
2016-06-03 11:12:46 -07:00
7dfe7db243 clientv3: panic if ActiveConnection tries to return non-nil connection 2016-06-03 10:25:20 -07:00
267d1cb16f clientv3: fix watch to reconnect on failure
It was spinning before.
2016-06-03 10:25:20 -07:00
5f5a203e27 clientv3: don't hold client lock while dialing
Causes async reconnect to block while the client is dialing.

This was also causing problems with the Close error message, so
now Close() will return the last dial error (if any) instead of
clearing it out with a cancel().

Fixes #5416
2016-06-03 10:25:20 -07:00
500296d0fb raft: fix TestNodeStepUnblock
The test cases have side-effect. We need to stop testing if one of the test
fails. Also timeout should be much longer to avoid false-positive.
2016-06-03 10:22:11 -07:00
948dc5e425 Merge pull request #5552 from ktateish/fix-wrong-link
Fix wrong links
2016-06-03 10:06:13 -07:00
634b9584ef Merge pull request #5555 from xiang90/fix_rm
rafthttp: report error to correct chan
2016-06-03 09:48:43 -07:00
5183631f17 rafthttp: report error to correct chan 2016-06-03 09:18:02 -07:00
95fc21e38b travis: Catch compilation errors in CI for arm and ppc64le 2016-06-03 18:46:36 +03:00
5bff4d85d6 Doc: fix links using url for internal doc 2016-06-03 22:26:01 +09:00
9585daf0a9 Doc: fix wrong links and remove unused or duplicate ones 2016-06-03 22:23:57 +09:00
b3fee0abff Merge pull request #5539 from mitake/auth-v3-get-role
*: support getting role in auth v3
2016-06-02 21:48:45 -07:00
10ee69b44c *: support getting role in auth v3
This commit implements RoleGet() RPC of etcdserver and adds a new
subcommand "role get" to etcdctl v3. It will list up permissions that
are granted to a given role.

$ ETCDCTL_API=3 bin/etcdctl role get r1
Role r1
KV Read:
        b
        d
KV Write:
        a
        c
        d
2016-06-03 13:03:54 +09:00
755567cb3d Merge pull request #5547 from xiang90/int
integration: always return active client
2016-06-02 15:52:38 -07:00
bbfe7f401f integration: always return active client
In the integration test, we sometimes stop/restart an etcd server.
Now our client has internal connection monitoring logic that might
set conn to nil when there is a connection failure and the redial
also fails.

Chaning randClient to always return a client with active connection
to make integration test reliable.
2016-06-02 14:49:32 -07:00
85691dbbe5 Merge pull request #5546 from raoofm/patch-6
Doc: fix link for migrate command in v2-migration
2016-06-02 14:21:36 -07:00
6ac67ecd5c Doc: fix link for migrate command in v2-migration
Doc: fix link for migrate command in v2-migration
2016-06-02 17:19:43 -04:00
6d96dd581a Merge pull request #5545 from heyitsanthony/revert-more-i64
Revert "etcdserverpb: make RangeResponse.More an int64"
2016-06-02 14:09:31 -07:00
84a487f723 Revert "etcdserverpb: make RangeResponse.More an int64"
This reverts commit 84e1ab8765.
2016-06-02 13:43:40 -07:00
3005f2717f Merge pull request #5541 from xiang90/tls
transport: require tls12
2016-06-02 10:11:57 -07:00
8b28c647ea transport: require tls12 2016-06-02 09:38:56 -07:00
51a048e6b3 Merge pull request #5540 from xiang90/fix_snap
snap: fix write snap
2016-06-02 09:12:50 -07:00
2b77e9a086 Merge pull request #5538 from rustyrobot/fix-header-formatting
doc: fix header formatting
2016-06-02 07:58:27 -07:00
ab0ccdc4df snap: fix write snap
Do not use writeFile since it does not sync file before closing.
This can lead to slient file corruption when disk is full.
2016-06-02 07:38:48 -07:00
9098f27745 doc: fix header formatting 2016-06-02 16:15:08 +03:00
ab3398f7fd README: minor fix in README 2016-06-01 23:33:59 -07:00
29d2caf14a Merge pull request #5532 from xiang90/rh
rafthttp: simplify initialization funcs
2016-06-01 22:31:19 -07:00
a047aa4a81 rafthttp: rename to to peerID 2016-06-01 22:12:47 -07:00
c25c00fcf9 rafthttp: simplify initialization funcs 2016-06-01 21:47:46 -07:00
2fcac66605 Merge pull request #5530 from gyuho/build_script
scripts: include v2 README in the release
2016-06-01 20:59:33 -07:00
140e2a18fb Merge pull request #5492 from mitake/auth-v3-user-get
*: support getting user in etcdctl v3
2016-06-01 20:27:18 -07:00
5609fdb9a8 *: support getting user in etcdctl v3
This commit adds a new subcommand "user get" to etcdctl v3. It will
list up roles that are granted to a given user.

Example:
$ ETCDCTL_API=3 bin/etcdctl user get u1
User: u1
Roles: r1 r2 r3

This commit also modifies the layout of InternalRaftRequest for
frequent update of auth related members.
2016-06-02 12:10:19 +09:00
b95c5b7da9 Merge pull request #5526 from heyitsanthony/more-to-int64
etcdserverpb: make RangeResponse.More an int64
2016-06-01 20:03:15 -07:00
232c1914d2 scripts: include v2 README in the release 2016-06-01 19:12:34 -07:00
84e1ab8765 etcdserverpb: make RangeResponse.More an int64 2016-06-01 17:10:23 -07:00
9fee7732f6 Merge pull request #5468 from swingbach/master
implemented leader lease when quorum check is on.
2016-06-01 16:10:41 -07:00
337ef64ed5 raft: implemented leader lease when quorum check is on 2016-06-02 06:17:27 +08:00
fb64c8ccfe Merge pull request #5521 from heyitsanthony/clientv3-hide-retrydial
clientv3: hide retry dial api
2016-06-01 13:00:02 -07:00
bea4268a0b Merge pull request #5520 from gyuho/grpc_dep
vendor: update grpc dependency
2016-06-01 11:43:23 -07:00
c451a1b350 Merge pull request #5519 from gyuho/etcdctlv3_README
etcdctl: v3 as default README
2016-06-01 11:41:17 -07:00
240757729c etcdctl: make v3 as default README 2016-06-01 11:36:21 -07:00
22744566f4 clientv3: hide retry dial api 2016-06-01 11:36:16 -07:00
542b7dff64 vendor: update grpc dependency 2016-06-01 11:24:03 -07:00
a6144bdf3e Merge pull request #5507 from xiang90/failure
doc: add failures guide
2016-06-01 11:07:22 -07:00
fc33fd1aa6 doc: add failures guide 2016-06-01 11:06:44 -07:00
47ef5f7ca5 Merge pull request #5510 from gyuho/clientv3_fix
clientv3: watch resp with error when client close
2016-06-01 11:01:30 -07:00
75dc10574a clientv3: watch resp with error when client close 2016-06-01 10:39:48 -07:00
9ed3b446ca Merge pull request #5509 from heyitsanthony/clientv3-fix-concurrent-close
clientv3: fix deadlock on Get with concurrent Close
2016-06-01 07:37:28 -07:00
36fcc9e9d4 Merge pull request #5515 from xiang90/logging
*: more logging on critical state change
2016-06-01 07:04:36 -07:00
a83051d0fc clientv3: don't panic on Get if NewKV is created with a closed client 2016-06-01 05:53:21 -07:00
1d88130522 clientv3: fix deadlock on Get with concurrent Close 2016-06-01 05:53:21 -07:00
5cb7400cee Merge pull request #5508 from heyitsanthony/bench-stm-lock
concurrency, benchmark: additional stm support
2016-06-01 05:48:50 -07:00
8528c8c599 *: more logging on critical state change
Add more logging for better debugging purpose.
2016-05-31 23:31:03 -07:00
fc06dd1452 Merge pull request #5480 from heyitsanthony/fix-migrate-nov2
etcdctl: improve error message on migration without v2 keys
2016-05-31 15:18:56 -07:00
2d4c7d6886 Merge pull request #5506 from xiang90/r_rafthttp
rafthttp: simplify streamReader initilization
2016-05-31 15:00:52 -07:00
51551abef5 concurrency, benchmark: read-committed STM isolation policy 2016-05-31 14:35:27 -07:00
f34a9350c3 benchmark: benchmark stm workload with distributed mutex 2016-05-31 14:35:27 -07:00
bb2a3ea8d8 benchmark: respect stm isolation mode flag 2016-05-31 14:35:27 -07:00
7709cd84bb Merge pull request #5505 from heyitsanthony/v3rpc-watcher-close
v3rpc: fix race on ctrl channel when watcher stream closes
2016-05-31 14:24:10 -07:00
cc837dfc6d Merge pull request #5503 from gyuho/fix_clientv3
clientv3: handle nil connection after *Client.Close (KV)
2016-05-31 12:38:20 -07:00
86269ab5bf rafthttp: simplify streamReader initilization 2016-05-31 12:13:37 -07:00
7b5657cf1a clientv3: check if KV.Client is closed
For https://github.com/coreos/etcd/issues/5495.
2016-05-31 12:00:19 -07:00
d116c116fe clientv3: getRemote comment about release 2016-05-31 12:00:19 -07:00
b0d4a0a9bd integration: skip closed client in Terminate 2016-05-31 12:00:15 -07:00
283318d547 v3rpc: add ErrConnClosed for closed client
For https://github.com/coreos/etcd/issues/5495.
2016-05-31 11:15:01 -07:00
09e8f5782e v3rpc: fix race on closing watcher stream ctrl channel
Sometimes close would race with the recvLoop, leading the
recvLoop to write to a close channel.
2016-05-31 11:07:31 -07:00
41d3cea9b3 integration: test closing stream while creating watchers 2016-05-31 11:02:15 -07:00
310ebdd3e1 Merge pull request #5498 from heyitsanthony/wal-tmpfile-fixes
wal: improve tmp file handling
2016-05-31 11:01:29 -07:00
e39f436728 Merge pull request #5494 from xiang90/refactor_rafthttp
rafthttp: remove the newPipeline func
2016-05-31 09:35:47 -07:00
eb9b281741 Merge pull request #5502 from jonboulle/master
MAINTAINERS: remove extraneous space
2016-05-31 07:07:10 -07:00
05cc3c3dbb wal: limit number of tmp file names
This fixes a space leak if the etcd server is restarted in shorter and shorter
intervals causing the tmp files to stack up.
2016-05-31 06:25:23 -07:00
71a9d6fc8b wal: don't warn when opening wal directory with stale tmp files 2016-05-31 06:25:23 -07:00
6686833e51 e2e: check for empty string as etcdctl backup result
Was checking for an ignored wal file warning. Added support for
TMPDIR since repeated runs were failing on left over test data.
2016-05-31 06:25:23 -07:00
ad95ceea2f MAINTAINERS: remove extraneous space 2016-05-31 12:11:53 +02:00
6f8cc58214 Merge pull request #5490 from mitake/errcode
etcdserver, auth: not return grpc error code directly in the apply phase
2016-05-30 22:00:54 -07:00
cc2e0fad3e Merge pull request #5497 from purpleidea/feat/doc-clarify
docs: fix ordering of sentence so it's logical and more clear
2016-05-30 21:52:04 -07:00
2cd3a3bd59 etcdctl: improve error message on migration without v2 keys
Fixes #5478
2016-05-30 19:14:04 -07:00
9c767cbf98 Merge pull request #5464 from heyitsanthony/fix-victim-watchers
mvcc: tighten up watcher cancelation and revision handling
2016-05-30 20:09:39 -06:00
4aab13ac06 docs: fix ordering of sentence so it's logical and more clear 2016-05-30 22:07:31 -04:00
5144318af0 etcdserver, auth: not return grpc error code directly in the apply phase
Current permission checking mechanism doesn't return its error code
well. The internal error (code = 13) is returned to client and the
retry mechanism doesn't work well. This commit fixes the problem.
2016-05-31 11:04:34 +09:00
ba68d7bbe6 rafthttp: make newRemote simpler 2016-05-30 16:24:26 -07:00
efe0ee7e59 rafthttp: remove the newPipeline func
Using struct to initialize pipeline is better when we have many
fields to file in.
2016-05-30 16:19:50 -07:00
815bc5307f Merge pull request #5489 from linuxcer/master
etcdserver: fix typo in server.go
2016-05-30 15:20:02 -07:00
29cc568659 etcdserver: fix typo in server.go 2016-05-31 05:54:30 +08:00
4e5c24fcf9 Merge pull request #5487 from gyuho/mvcc_proto
mvcc: delete EXPIRE event type
2016-05-29 18:22:15 -07:00
c43e59338f etcdctl/ctlv3: remove mvccpb.EXPIRE in mirror cmd 2016-05-29 15:11:29 -07:00
3266c809e4 mvcc: delete EXPIRE event type
Addressing https://github.com/coreos/etcd/pull/5484#discussion_r65005236.
etcd v3 doesn't expire keys. It's either PUT of DELETE.
2016-05-29 14:54:38 -07:00
84e7fa149e Merge pull request #5439 from mitake/auth-v3-permcheck
do permission check in raft log apply phase
2016-05-28 19:05:31 -07:00
0184288479 Merge pull request #5419 from xiang90/raft_doc
raft: initial readme
2016-05-28 18:38:10 -07:00
5b2e130f09 raft: initial readme 2016-05-28 18:37:21 -07:00
a86ae1d969 Merge pull request #5483 from gyuho/client_typo
clientv3: fix panic message in OpPut
2016-05-28 12:11:56 -07:00
9a0fe2620e clientv3: fix panic message in OpPut 2016-05-28 11:55:28 -07:00
8e821cdc70 *: do permission check in raft log apply phase
This commit lets etcdserver check permission during its log applying
phase. With this change, permission checking of operations is
supported.

Currently, put and range are supported. In addition, multi key
permission check of range isn't supported yet.
2016-05-29 00:05:48 +09:00
90e9652f70 etcdserver: return error of apply result without touching response
Current etcdserver tries to return result.resp even if result.err is
not nil. A situation of result.resp == nil and result.err != nil can
happen and it results an error like below:

18:49:57 etcd1 | interface conversion: proto.Message is nil, not *etcdserverpb.PutResponse

This commit lets the functions return result.err if it is not nil.
2016-05-29 00:05:48 +09:00
cfb3f96c2b mvcc: tighten up watcher cancelation and revision handling
Makes w.cur into w.minrev, the minimum revision for the next update, and
retries cancelation if the watcher isn't found (because it's being processed
by moveVictims).

Fixes: #5459
2016-05-27 17:19:32 -07:00
c438310634 v3rpc: make watcher wait for its send goroutine to finish 2016-05-27 16:54:26 -07:00
20fc3e968f Merge pull request #5465 from gyuho/compact1
etcd-tester: log more for compact errors
2016-05-27 16:16:04 -07:00
099dd1d1fb Merge pull request #5477 from gyuho/readme
README: fix write/sec number
2016-05-27 15:52:27 -07:00
c13bf42ac6 README: fix write/sec number 2016-05-27 15:50:04 -07:00
0313484f17 Merge pull request #5476 from gyuho/latency_dodc
Documentation: add average latency numbers
2016-05-27 15:47:26 -07:00
79fac9ee6f Documentation: add average latency numbers 2016-05-27 15:46:35 -07:00
f7fbcf8209 Merge pull request #5475 from heyitsanthony/doc-pkgs
*: add missing godoc package descriptions
2016-05-27 16:37:49 -06:00
fc7da09d67 *: add missing godoc package descriptions
Fixes #4074
2016-05-27 15:15:26 -07:00
0df5bb0002 Merge pull request #5445 from gyuho/performance_doc
Documentation: add benchmark to performance.md
2016-05-27 15:09:03 -07:00
33daeb7464 Documentation: add benchmark to performance.md
Fix https://github.com/coreos/etcd/issues/5433.
2016-05-27 15:05:54 -07:00
d8f325dabf Merge pull request #5472 from xiang90/fix_cap
integration: move cap enabling to init
2016-05-27 11:42:07 -07:00
ac2859057a integration: move cap enabling to init 2016-05-27 11:12:07 -07:00
2d47211589 Merge pull request #5471 from xiang90/proxy_rand
httpproxy: init the rand that we use to randomize endpoints
2016-05-27 10:46:42 -07:00
c73e8fd946 httpproxy: init the rand that we use to randomize endpoints
This is actually does not change anything. The endpoints are already
randomized before feeding into proxy. But it makes the proxy more safe.
2016-05-27 10:28:03 -07:00
45b872fe5d Merge pull request #5470 from dnaeon/gru
docs: add Gru to the list of projects using etcd
2016-05-27 10:18:55 -07:00
6e4fa5e773 docs: add Gru to the list of projects using etcd 2016-05-27 20:17:57 +03:00
04039eb006 etcd-tester: more logs for compact operations 2016-05-27 09:55:13 -07:00
3ed5d28e2e etcd-tester: fix, clean up multiple things (#5462)
* etcd-tester: more logging, fix typo

* etcd-tester: fix prevCompactRev scope

Fix https://github.com/coreos/etcd/issues/5440.

* etcd-tester: move utils to bottom, clean up logs

And remove stresser operation inside defrag

* etcd-tester: separate update revision call

* etcd-tester: fix cleanup when case is -1
2016-05-26 11:37:49 -07:00
6acb3d67fb Merge pull request #5448 from xiang90/fix_refrsh
etcd: fix refresh feature
2016-05-26 09:53:13 -07:00
44b59e24eb Merge pull request #5455 from heyitsanthony/clientv3-url-endpoints
clientv3: handle URL scheme when given in endpoint
2016-05-26 10:25:27 -06:00
d117684086 Merge pull request #5453 from gyuho/protobuf_etcdctlv3
etcdctl/ctlv3: protobuf write-out for member list
2016-05-25 22:39:54 -07:00
5cba7080bc etcdctl/ctlv3: protobuf write-out for member list
Fix https://github.com/coreos/etcd/issues/5297.
2016-05-25 22:23:57 -07:00
86591d64c5 etcdctl: doc member list, others protobuf output 2016-05-25 22:17:45 -07:00
d7fa07cffa Merge pull request #5456 from gyuho/tester_fix
etcd-tester: fix compact timeout
2016-05-25 18:53:07 -07:00
4c7af825c7 etcd-tester: timeout per number of compact entries
Fix https://github.com/coreos/etcd/issues/5440.
2016-05-25 18:37:13 -07:00
5ab27e99f2 Merge pull request #5454 from gyuho/document_issue_5401
etcdserverpb: document how to prefix, range query
2016-05-25 17:07:53 -07:00
9dc0782f45 clientv3: handle URL scheme when given in endpoint
Fixes #5427
2016-05-25 18:01:36 -06:00
8a718f3e56 etcdserverpb: document prefix, range query
Fix https://github.com/coreos/etcd/issues/5401.
2016-05-25 16:53:36 -07:00
53084ebead etcd: fix refresh feature
When using refresh, etcd store v2 watch is broken. Although with refresh
store should not trigger current watchers, it should still add events into
the watchhub to make a complete history. Current store fails to add the event
into the watchhub, which causes issues.
2016-05-25 13:33:31 -07:00
9ea1705563 Merge pull request #5441 from mqliang/Rlock-GET
store: use Rlock when GET
2016-05-25 11:29:36 -07:00
84ded59f08 Merge pull request #5443 from raoofm/patch-5
Doc: fix typo in v2-migration.md
2016-05-24 09:35:42 -07:00
5002114127 Doc: fix typo in v2-migration.md 2016-05-24 11:44:40 -04:00
ffd3cb78d4 store: use Rlock when GET 2016-05-24 17:13:29 +08:00
f86dc5c7f7 Merge pull request #5438 from gyuho/proxy_log
proxy/httpproxy: fix v2 proxy log header
2016-05-23 16:49:26 -07:00
340df26883 Merge pull request #5435 from xiang90/cap
api: add v3rpc capability
2016-05-23 15:50:08 -07:00
dd8a36820e proxy/httpproxy: fix v2 proxy log header
Replace all with capnslog
2016-05-23 15:45:49 -07:00
1c544c3ba5 api: add v3rpc capability 2016-05-23 14:45:08 -07:00
663db2bbf8 Merge pull request #5410 from gyuho/e2e_migrate
e2e: test migrate command
2016-05-23 14:42:51 -07:00
23b14a8c8d e2e: add migrate cmd test 2016-05-23 14:27:51 -07:00
96d06d4f2c e2e: add Restart, Start, grpcEndpoints methods 2016-05-23 14:27:48 -07:00
6a8c65cba9 Merge pull request #5436 from gyuho/v3_doc
Documentation: updates for v3 release
2016-05-23 12:29:39 -07:00
fd7685f3a1 Documentation: add clientv3 links to libraries 2016-05-23 12:01:38 -07:00
d57164d0c8 README: throughput number in v3, add Doorman
Our v3 benchmark shows etcd v3 can do 40k writes per second.
1k throughput number is for etcd v2. Also adds YouTube's doorman
to example project lists.
2016-05-23 12:00:03 -07:00
3351ea1ae2 Procfile: v3 as default 2016-05-23 11:59:23 -07:00
ad9d18faa9 Merge pull request #5411 from xiang90/m_doc
doc: add app migration doc
2016-05-23 11:56:34 -07:00
a62e4e1e3a doc: add app migration doc 2016-05-23 11:53:44 -07:00
a3a4f51d90 Merge pull request #5434 from gyuho/log_integration
integration: add logs for debugging
2016-05-23 11:52:08 -07:00
4df91ae755 Merge pull request #5424 from gyuho/slice_pre_alloc
rafthttp: replace append with pre-allocated slice
2016-05-23 11:30:07 -07:00
ddbe46543d integration: add logs for debugging 2016-05-23 11:23:41 -07:00
f20573b576 Merge pull request #5426 from gyuho/log_compaction_done
mvcc: log when compaction is done
2016-05-21 09:33:50 -07:00
bf8cf39daf mvcc: use capnslog 2016-05-20 22:31:22 -07:00
4882330fd7 Merge pull request #5417 from heyitsanthony/watcher-victims
mvcc: reuse watcher batch from notify on blocked watch channel
2016-05-20 19:59:38 -07:00
394ce5f3b8 mvcc: move blocked unsynced watchers to victim list 2016-05-20 15:56:02 -07:00
5984e46364 mvcc: move blocked sync watcher work to victim list
Instead of holding the store lock while doing a lot of work like when syncung
unsynced watchers, the work from a blocked synced notify can be reused and
dispatched without holding the store lock for long.
2016-05-20 15:56:02 -07:00
c9264c5e65 rafthttp: replace append with pre-allocated slice 2016-05-20 15:20:55 -07:00
1226946e2d Merge pull request #5423 from purpleidea/feat/typos3
clientv3: fix typo
2016-05-20 14:45:20 -07:00
374b3ee40b clientv3: fix typo 2016-05-20 17:18:52 -04:00
4c36054610 Merge pull request #5420 from purpleidea/feat/typos2
Fix typos
2016-05-20 11:30:38 -07:00
edca3cbe44 clientv3: Fix typos
Found randomly when going through docs. HTH
2016-05-20 14:06:29 -04:00
0b34b236d6 mvcc: benchmark for synced watchers 2016-05-19 23:31:27 -07:00
751d5fa486 Merge pull request #5414 from swingbach/master
raft: fix tiny mistake of message type
2016-05-19 23:15:15 -07:00
ff9d16a2e0 raft: fix tiny mistake of message type 2016-05-20 14:04:08 +08:00
4ee60d6671 Merge pull request #5413 from mitake/test
test: remove a directory correctly
2016-05-19 21:58:14 -07:00
1727f278f2 test: remove a directory correctly
Current rm in the test script cannot the gopath/src correctly and
results test failure.
2016-05-20 13:42:36 +09:00
e9f3e809a6 Merge pull request #5409 from xiang90/doc
etcdctl: add migrate command into readme
2016-05-19 16:54:10 -07:00
628a38d906 etcdctl: add migrate command into readme 2016-05-19 16:53:47 -07:00
82c6408f38 Merge pull request #5406 from gyuho/clientv3_slice
clientv3/concurrency: preallocate slice in stm
2016-05-19 14:57:19 -07:00
fa1e40c120 clientv3/concurrency: preallocate slice in stm 2016-05-19 14:42:19 -07:00
8c17674cda Merge pull request #5404 from gyuho/watch_optimize
mvcc: remove defer in watchable store
2016-05-19 14:08:37 -07:00
be4fb634a1 Merge pull request #5279 from gyuho/demo
Documentation: add animated quick demo
2016-05-19 14:03:27 -07:00
aa85cf037f mvcc: remove defer in watchable store 2016-05-19 13:51:51 -07:00
54536af135 Merge pull request #5405 from gyuho/watch_client
clientv3: preallocate watch streams slice
2016-05-19 13:21:44 -07:00
f9306fb817 clientv3: preallocate watch streams slice
To avoid slice growth when appending
2016-05-19 12:55:55 -07:00
edb11881f8 Merge pull request #5391 from xiang90/migrate
etcdctl: add migrate command
2016-05-19 12:33:11 -07:00
6f2e7875aa etcdctl: add migrate command
Migrate command accepts a datadir and an optional user-provided
transformer function that transform v2 keys to v2 keys.

Migrate command then builds a v3 backend state based on the existing
v2 keys and the output of the transformer function.
2016-05-19 12:17:15 -07:00
61a7d3efb3 Merge pull request #5392 from gyuho/watch_bench
benchmark: fix watch command
2016-05-19 10:12:24 -07:00
9ca84e814f benchmark: fix watch command
Fix https://github.com/coreos/etcd/issues/5099.
2016-05-19 09:57:35 -07:00
8e4a83c830 Merge pull request #5400 from rkrambovitis/patch-2
doc: fix https omission in documentation.
2016-05-19 08:07:27 -07:00
38ebb6b475 doc: fix https omission in documentation.
doc: added missing (http)s to tls setup guide

This fixes a minor documentation omission, where the 1st initial-advertise-peer-url for tls setup appears to be http.

fixes documentation
2016-05-19 18:04:52 +03:00
9ea181e561 Merge pull request #5388 from swingbach/master
raft: add more assertions on dueling candidates test case
2016-05-19 06:59:35 -07:00
1e54117580 raft: add more comments for dueling candidates test case 2016-05-19 13:51:20 +08:00
c703ccab63 raft: add more assertions for dueling candidates test case 2016-05-19 13:50:14 +08:00
62b4d1cef7 Merge pull request #5394 from heyitsanthony/clientv3-no-close-conn
clientv3: don't reuse closed connection and ignore "transport is closing"
2016-05-18 15:52:21 -07:00
e4a2dcad9e clientv3/integration: ignore closing transport in TestKVPutStoppedServerAndClose
The grpc "transport is closing" error is rasied when the host is unreachable;
there's no good way to avoid it for a Put.

Fixes #5343
2016-05-18 14:49:39 -07:00
782a8802c0 clientv3: avoid reusing closed connection in KV 2016-05-18 14:46:17 -07:00
26783f51b1 Documentation: add animated quick demo 2016-05-18 11:28:27 -07:00
dc073e1aa7 Merge pull request #5383 from gyuho/kvstore_byte_pool
mvcc: use buffer bytes to encode consistent index
2016-05-18 10:32:33 -07:00
77775e8e92 mvcc: preallocate bytes buffer for saveIndex 2016-05-18 10:01:57 -07:00
90498b3756 Merge pull request #5385 from gyuho/fix_backup_test
e2e: wait for member publishing after backup
2016-05-17 21:57:52 -07:00
f2b2e0761a e2e: wait for member publishing after backup 2016-05-17 21:39:04 -07:00
81b4e6d332 Merge pull request #5384 from mitake/genproto
scripts: pass -u to go get in genproto.sh
2016-05-17 20:49:36 -07:00
db9ccb75bf scripts: pass -u to go get in genproto.sh
Current genproto.sh doesn't pass -u option to go get. It is
problematic because the script depends on a specific version of
gogoproto. Actually it causes build error if a repository already have
an old version of gogoproto that doesn't have a specified commit
($SHA). This commit lets the script pass -u to go get for avoid the
error.
2016-05-18 11:38:51 +09:00
7678fc153a Merge pull request #5382 from gyuho/rafthttp_timeout
rafthttp: fix TestSendMessageWhenStreamIsBroken
2016-05-17 16:22:02 -07:00
d20cb40f4f rafthttp: fix TestSendMessageWhenStreamIsBroken
Fix https://github.com/coreos/etcd/issues/5381.

In case CI being slow that taking more than 10ms.
2016-05-17 16:03:54 -07:00
ecf192556e Merge pull request #5380 from gyuho/backup_e2e_test
e2e: v2 backup test
2016-05-17 15:56:24 -07:00
06950e41b4 e2e: v2 backup test
Fix https://github.com/coreos/etcd/issues/5367.
2016-05-17 15:35:39 -07:00
fb8d12a9cd Merge pull request #5379 from heyitsanthony/fix-snapshot-close-wal
etcdserver: wait for snapshots before closing raft
2016-05-17 15:19:41 -07:00
73204e9637 etcdserver: wait for snapshots before closing raft
Fixes #5374
2016-05-17 15:04:25 -07:00
1a06f5dab5 Merge pull request #5359 from mischief/bolt-openbsd
mvcc: set bolt options to nil for non-linux systems
2016-05-17 13:32:37 -07:00
f65331b456 Merge pull request #5376 from gyuho/e2e_typo
e2e: add 'force-new-cluster' flag, fix typo
2016-05-17 13:29:58 -07:00
00a2dca619 Merge pull request #5378 from gyuho/boltdb_update
vendor: update boltdb to v1.2.1
2016-05-17 13:26:29 -07:00
86c85b88ad Merge pull request #5377 from purpleidea/bug/typos
clientv3: fix typos
2016-05-17 12:51:13 -07:00
dd8e81070a e2e: add force-new-cluster flag 2016-05-17 12:48:26 -07:00
63e6228a0b e2e: fix typo(isClientAuthTLS to isClientAutoTLS) 2016-05-17 12:47:21 -07:00
e4e4c9dc2c mvcc: set bolt options to nil for non-linux systems 2016-05-17 12:46:44 -07:00
bc5f626e56 vendor: update boltdb to v1.2.1 2016-05-17 12:42:38 -07:00
42f3b4964f clientv3: fix typos 2016-05-17 15:39:56 -04:00
0269afd643 Merge pull request #5375 from gyuho/admin_guide_typo
Documentation/v2: fix typo for updating a member
2016-05-17 11:47:09 -07:00
e2fe80393e Documentation/v2: fix typo for updating a member
Fix https://github.com/coreos/etcd/issues/5358.
2016-05-17 11:44:39 -07:00
3c78523643 Merge pull request #5373 from gyuho/table-write-out
Documentation: write-out=table for v3 commands
2016-05-17 10:46:50 -07:00
6a0148e214 Documentation: write-out=table for v3 commands 2016-05-17 10:45:18 -07:00
3c8301358c Merge pull request #5371 from gyuho/auth_doc
Documentation/v2: fix auth_api.md bug
2016-05-17 10:22:12 -07:00
21c9da1ed4 Documentation/v2: fix auth_api.md bug
role guest read and write is "/*", not "*", same with other roles.
2016-05-17 09:42:38 -07:00
7014f6861d Merge pull request #5361 from mitake/auth-v3-token-credential
RFC: *: attach auth token as a gRPC credential
2016-05-16 21:45:44 -07:00
6259318521 *: attach auth token as a gRPC credential
This commit adds a functionality of attaching an auth token to gRPC
connection as a per RPC credential.

For doing this, this commit lets clientv3.Client.Dial() create a
dedicated gRPC connection for doing authentication. With the dedicated
connection, the client calls Authenticate() RPC and obtain its
token. The token is attached to the main gRPC connection with
grpc.WithPerRPCCredentials().

This commit also adds a new option --username to etcdctl (v3). With
this option, etcdctl attaches its auth token to the main gRPC
connection (currently it is not used at all).
2016-05-17 13:26:12 +09:00
327b01169c Merge pull request #5353 from heyitsanthony/clientv3-throttle-reconn
clientv3: throttle reconnection rate
2016-05-16 13:41:28 -07:00
f6e5fe6877 Merge pull request #5368 from heyitsanthony/sshot-hash
v3rpc, etcdctl: snapshot integrity hash
2016-05-16 13:09:02 -07:00
798718c49b etcdctl: verify snapshot hash on restore
Fixes #4097
2016-05-16 12:08:08 -07:00
ac2e3e43bf v3rpc: add sha trailer to snapshot 2016-05-16 11:15:03 -07:00
e8101ddf09 clientv3: throttle reconnection rate
Client was reconnecting after establishing connections because the lease
and watch APIs were thrashing. Instead, wait a little before accepting
new reconnect requests.
2016-05-16 11:14:45 -07:00
3c3bb3f97c godep: add golang.org/x/time/rate 2016-05-16 11:14:45 -07:00
a663828a32 Merge pull request #5366 from xiang90/fix_restore
raft: do not panic when removing all the nodes from cluster
2016-05-16 10:45:48 -07:00
29c77dee74 Merge pull request #5298 from purpleidea/feat/newurlsmap
pkg/types: Build a urls map from a string map
2016-05-16 10:39:14 -07:00
8ffbaef502 Merge pull request #5364 from heyitsanthony/fix-election-wait
integration: fix TestElectionWait
2016-05-16 10:30:17 -07:00
e52fc2d07e Merge pull request #5363 from heyitsanthony/fix-test-wait
test: fix wait on integration tests
2016-05-16 10:28:45 -07:00
910781ef5b raft: do not panic when removing all the nodes from cluster 2016-05-16 10:04:17 -07:00
c21b885dd5 integration: fix TestElectionWait
elections are now per-session so waiting on the same election with the
same client will not block like before

Fixes #5362
2016-05-16 07:32:42 -07:00
e312bb675c test: fix wait on integration tests
Typo was causing failed tests to look like they passed on CI.
2016-05-16 06:32:38 -07:00
46481b17fc Merge pull request #5356 from xiang90/grpc-proxy
proxy: initial grpc kv service proxy
2016-05-14 12:31:06 -07:00
2d3a8541d0 Merge pull request #5355 from heyitsanthony/cluster-security-doc
doc: add TLS examples to clustering guide
2016-05-14 10:44:06 -07:00
d41ce0a97c pkg/types: Add tests for NewURLsMapFromStringMap 2016-05-14 10:48:56 -04:00
17e23769d9 pkg/types: gofmt existing code 2016-05-14 09:33:58 -04:00
029fe6bf47 pkg/types: Build a urls map from a string map
This adds a simple transformation function which is helpful when
manipulating the different etcd internal data representations.
2016-05-14 09:33:58 -04:00
ec2ac72585 proxy: initial grpc kv service proxy 2016-05-13 23:00:29 -07:00
25850e0070 doc: add TLS examples to clustering guide
Fixes #3595
2016-05-13 17:10:41 -07:00
deb21d3da5 Merge pull request #5352 from xiang90/p
integration: remove parallel testing
2016-05-13 13:24:36 -07:00
410c5cd828 Merge pull request #5351 from gyuho/allow_null_key
etcdctl/ctlv3: allow empty key
2016-05-13 12:26:59 -07:00
c7c0e1eb7a integration: remove parallel testing
We cannot do testing in parallel since leak testing will detect the goroutines
in other tests running in parallel.
2016-05-13 12:01:25 -07:00
002090daec e2e: test empty key for get command 2016-05-13 11:30:36 -07:00
3ec627d1a8 etcdctl/ctlv3: allow empty key
Fix https://github.com/coreos/etcd/issues/5323.
2016-05-13 11:29:58 -07:00
8c953499fa Merge pull request #5349 from heyitsanthony/clientv3-conc-fixups
clientv3/concurrency: ctx-izations and session leader ids
2016-05-13 10:33:55 -07:00
120020fa9c clientv3/concurrency: use session id for election keys to avoid deadlock 2016-05-13 10:07:35 -07:00
393725fe5f clientv3/concurrency: ctx-ize Leader(), Resign(), and Unlock() 2016-05-13 10:07:35 -07:00
2e93c65c96 bridge: fix command line flag handling
flag package expects flags in Argv[1:] and stops on non-flag arguments
but bridge was expecting the forwarding address in os.Argv[1]
2016-05-13 10:07:35 -07:00
4d2424210f Merge pull request #5313 from xiang90/fix_raft_abort
raft: simplify leadership transfer
2016-05-13 09:26:01 -07:00
4612e2d59a Merge pull request #5340 from heyitsanthony/etcd-runner-election
etcd-runner: election mode
2016-05-12 22:53:35 -07:00
4fe91ed1e2 etcd-runner: election mode 2016-05-12 22:32:33 -07:00
215afb9b1d etcd-runner: refactor round code 2016-05-12 22:32:33 -07:00
66e5e4f298 Merge pull request #5344 from gyuho/license_authors
*: update LICENSE header
2016-05-12 21:18:35 -07:00
71e6c4b06a .header: update to 'etcd Authors' 2016-05-12 20:56:50 -07:00
ef44f71da9 *: update LICENSE header 2016-05-12 20:51:48 -07:00
c538e0f9a9 etcdctl: update LICENSE header 2016-05-12 20:51:39 -07:00
2a44b9636a auth: update LICENSE header 2016-05-12 20:51:14 -07:00
fd9e07a529 clientv3: update LICENSE header 2016-05-12 20:50:58 -07:00
9d9f02c1ee mvcc: update LICENSE header 2016-05-12 20:50:33 -07:00
3d523e34b1 tools: update LICENSE header 2016-05-12 20:50:17 -07:00
4a5befc2de wal: update LICENSE header 2016-05-12 20:50:04 -07:00
abb4cd5646 etcdserver: update LICENSE header 2016-05-12 20:49:40 -07:00
bd71a60875 rafthttp: update LICENSE header 2016-05-12 20:49:28 -07:00
fe884f8209 raft: update LICENSE header 2016-05-12 20:49:15 -07:00
8b77de4e99 pkg: update LICENSE header 2016-05-12 20:48:53 -07:00
a880e9c7cb Merge pull request #5332 from xiang90/sl
*: cancel required leader streams when memeber lost its leader
2016-05-12 20:24:34 -07:00
15c5259e2d Merge pull request #5328 from gyuho/require_leader
requireHasLeader client side
2016-05-12 19:53:43 -07:00
9c103dd0de *: cancel required leader streams when memeber lost its leader 2016-05-12 19:42:21 -07:00
68eaf4083a clientv3: WithRequireLeader 2016-05-12 19:25:42 -07:00
431c4e7b3b Merge pull request #5342 from gyuho/grpc_dep
cmd/vendor: update grpc (upstream)
2016-05-12 19:23:31 -07:00
711be0a567 cmd/vendor: update grpc (upstream) 2016-05-12 19:02:30 -07:00
f4d1501198 Merge pull request #5337 from gyuho/configurable_monitor_interval
etcdmain: gateway monitor-interval flag
2016-05-12 18:58:52 -07:00
a32aabc377 proxy/tcpproxy: add more logs 2016-05-12 17:48:36 -07:00
750273afd9 Merge pull request #5339 from gyuho/protodoc_fix
*: fix protodoc, consistent casing in api doc
2016-05-12 17:39:06 -07:00
78d46b71fa Merge pull request #5336 from heyitsanthony/fix-clientv3-failput-close-crash
clientv3: fix Close after failed Put
2016-05-12 17:32:49 -07:00
9a6daefb3e etcdmain: add retry-delay flag 2016-05-12 17:03:00 -07:00
62e5ffac13 Merge pull request #5338 from gyuho/proxy_log
httpproxy: fix capnslog log path
2016-05-12 16:58:32 -07:00
b1f95c314b *: fix protodoc, consistent casing in api doc
There was a bug in protodoc.
This changes git SHA to use the latest protodoc.
And make the letter casing consistent with original
Protocol Buffer. Go capitalizes the member variables,
but the protocol buffer documentation should be same as
original proto files.
2016-05-12 16:23:29 -07:00
527aa1a499 clientv3: fix Close after failed Put
Was crashing on a nil connection. Reworked the shutdown path a little so
there's only one connection close site.
2016-05-12 16:16:27 -07:00
25d9169e9a httpproxy: fix capnslog log path
We changed the package path, so log paths needs to be updated as well.
2016-05-12 15:56:40 -07:00
fb65d04291 Merge pull request #5329 from gyuho/typo_integration
integration: fix NewClientV3 error messages
2016-05-12 10:49:14 -07:00
78ae4b92a6 integration: fix NewClientV3 error messages 2016-05-12 10:26:27 -07:00
2e011053b1 Merge pull request #5326 from mortonfox/patch-1
README: Update link to configuration.md
2016-05-11 22:33:54 -07:00
9c05f92f2e README: Update link to configuration.md
The file, along with all other documentation files, has moved into the Documentation folder.
2016-05-12 00:57:30 -04:00
9acb7ab41c Merge pull request #5325 from heyitsanthony/fix-partial-wal-init
wal: atomically initialize wal directory
2016-05-11 18:01:04 -07:00
6fc3106e68 Merge pull request #5324 from xiang90/partitioned
*: etcd member rejects unary call with leader requirement when it does not have leader
2016-05-11 17:48:06 -07:00
17391336af wal: atomically initialize wal directory
Fixes #5270
2016-05-11 16:50:17 -07:00
19221b33cc *: etcd member rejects unary call with leader requirement when it does not have leader 2016-05-11 16:34:34 -07:00
be0c38ec2b Merge pull request #5322 from heyitsanthony/port-docs
scrub legacy ports and update tls information
2016-05-11 16:32:45 -07:00
dcb3b7aecf *: scrub legacy ports from code and scripts 2016-05-11 13:46:30 -07:00
db8f5771f1 doc: scrub legacy ports and TLS information for v3 2016-05-11 13:46:29 -07:00
b03a2f0323 Merge pull request #5318 from heyitsanthony/watcher-latency
batch watcher sync to reduce request latency
2016-05-11 12:53:20 -07:00
080272be17 mvcc: limit total watchers synced per sync
Fixes #4567
2016-05-11 11:16:43 -07:00
f5165a0149 benchmark: make number of watcher streams configurable in watch-get
Each stream uses a client goroutine and a grpc stream; the setup causes
considerable client-side latency on the first get requests.
2016-05-11 11:16:43 -07:00
2aa4dd52cc benchmark: use separate connection for get in watch-get
The watcher traffic interferes with the get latency when sharing connections.
2016-05-11 11:16:43 -07:00
ca105a1c89 Merge pull request #5319 from xiang90/fix_rafthttp_test
*: fix TestTransportErrorc
2016-05-11 11:01:43 -07:00
e90313c9c2 Merge pull request #5321 from gyuho/doc_fix
*: fix minor typos
2016-05-11 10:58:36 -07:00
3104507eb2 *: fix minor typos 2016-05-11 10:55:38 -07:00
b2eb90024f Merge pull request #5320 from gyuho/issue518
v2/README: add known bugs
2016-05-11 10:45:40 -07:00
aaefd52afa Merge pull request #5092 from xiang90/etcdlet
*: gateway initial commit
2016-05-11 10:36:02 -07:00
5023996d02 v2/README: add known bugs
For https://github.com/coreos/etcd/issues/518.
2016-05-11 10:35:41 -07:00
00b660cc53 Merge pull request #5309 from xiang90/d_metrics
*: add disk operation metrics for monitoring
2016-05-11 10:18:39 -07:00
4d0f474034 *: fix TestTransportErrorc
CI can be slow. We should just wait longer.
2016-05-11 10:09:40 -07:00
a300be92dc *: initial support for gatway
etcd gatway is a simple l4 gateway that forwards tcp connections to
the given endpoints.
2016-05-11 09:44:50 -07:00
0fb7cb8b00 *: add disk operation metrics for monitoring 2016-05-11 09:36:45 -07:00
34b0736f2c mvcc: Reduce number of allocs when watchableStore if no watchers.
When there are no watchers the number of allocations made while handling
a PUT operation can be reduced by exiting early.
2016-05-11 00:51:00 -07:00
5ddb532072 Merge pull request #5314 from gyuho/test-script
test: fix typo, clean-up print statements
2016-05-10 23:51:05 -07:00
fd7e2b20b0 test: fix typo, clean-up print statements 2016-05-10 23:05:58 -07:00
82a6de8b69 raft: simplify leadership transfer 2016-05-10 20:03:42 -07:00
62d4c6d357 Merge pull request #5312 from ajityagaty/backup
etcdctl: Add --wal-dir and --backup-wal-dir options to backup command.
2016-05-10 19:51:30 -07:00
23f9d72870 etcdctl: Add --wal-dir and --backup-wal-dir options to backup command.
If the WAL is stored in a separate directory then the backup command
would need a --wal-dir option to pick the path to the WAL directory.
The user might also want to store the backup of data and wal separately
for which --backup-wal-dir option is provided.
2016-05-10 18:38:56 -07:00
d8215c8892 Merge pull request #5310 from gyuho/timeout_v2
etcdctl/ctlv2: total-timeout for Sync
2016-05-10 15:02:33 -07:00
62a9209088 etcdctl/ctlv2: total-timeout for Sync
Fix https://github.com/coreos/etcd/issues/4897.
2016-05-10 14:20:05 -07:00
6b2d7f9412 Merge pull request #5308 from heyitsanthony/fix-init-notify
etcdmain: notify systemd when etcd is ready to accept requests
2016-05-10 13:55:06 -07:00
8c4958dd60 etcdmain: notify systemd when etcd is ready to accept requests
Fixes #5151
2016-05-10 13:36:46 -07:00
5cbd8cefc9 Merge pull request #5291 from xiang90/c_i
*: add proposalsCommitted metrics
2016-05-10 12:51:28 -07:00
ab11415d25 *: add proposalsCommitted metrics 2016-05-10 10:56:25 -07:00
dad1197c89 Merge pull request #5303 from heyitsanthony/bench-watch-unsync
benchmark: watch-get for testing unsynced watcher/get contention
2016-05-10 10:31:45 -07:00
467de8cb4f benchmark: watch-get for testing unsynced watcher/get contention 2016-05-10 10:24:40 -07:00
efcba23d21 Merge pull request #5301 from gyuho/simple_member
etcdctl/ctlv3: make 'table' printer configurable
2016-05-10 10:12:54 -07:00
3e088b3b40 etcdctl/ctlv3: make 'table' printer configurable
Fix https://github.com/coreos/etcd/issues/5296.
2016-05-10 10:02:02 -07:00
8daad8e06e Merge pull request #5305 from ajityagaty/conf_file
Doc: Add the new '--config-file' detail to configuration.md file
2016-05-10 07:58:55 -07:00
97a2ebe3a2 Doc: Add the new '--config-file' detail to configuration.md file
Add a description about the --config-file option into the
configuration.md file.
2016-05-10 07:50:37 -07:00
fa6670488d Merge pull request #5302 from xiang90/conf-file
*: move sample config file to root directory
2016-05-10 07:46:38 -07:00
4ae47ad934 Merge pull request #5294 from xiang90/r_metrics
*: simplify network metrics
2016-05-09 22:50:45 -07:00
98dbdd5fbb *: simplify network metrics 2016-05-09 22:37:12 -07:00
00398ec98d *: move sample config file to root directory 2016-05-09 21:36:09 -07:00
07c04c7c75 Merge pull request #5280 from ajityagaty/server_config_file
etcd: Configuration file for etcd server.
2016-05-09 19:52:09 -07:00
8bc5ab9f8d etcd: Configuration file for etcd server.
Added a new command line option to etcd server to read in a YAML
based configuration file. I've also added an example configuration
file with comments and a set of test cases.
2016-05-09 18:17:27 -07:00
0d43a2b7e7 Merge pull request #5295 from ajityagaty/auth_disable
auth: Adding support for "auth disable" command.
2016-05-07 23:09:37 -07:00
adc981c53d auth: Adding support for "auth disable" command.
Added support for the auth disable command in the server, added the
etcdctl command and a respective testcase.
2016-05-07 19:21:49 -07:00
53491aac0a Merge pull request #5250 from heyitsanthony/fix-wal-write-tear
wal: repair torn writes
2016-05-06 17:14:56 -07:00
cd9e6a1d4f wal: lock WAL file while repairing 2016-05-06 16:57:55 -07:00
774030e1b2 wal: repair torn writes
Fixes #5230
2016-05-06 16:54:08 -07:00
c9c2cdfeaf Merge pull request #5293 from heyitsanthony/fix-compact-cancel-crash
etcdserver: fix nil dereference in physical Compact on proposal timeout
2016-05-06 16:25:03 -07:00
824ffded12 etcdserver: fix nil dereference in physical Compact on proposal timeout
Fixes #5292
2016-05-06 15:38:18 -07:00
34fbec118a Merge pull request #5289 from xiang90/has_leader_metrics
*: add has leader metrics
2016-05-06 14:45:49 -07:00
4481016953 Merge pull request #5290 from coreos/vv
*: bump to v3.0.0-beta.0+git
2016-05-06 14:10:52 -07:00
ebaa54bf6e *: bump to v3.0.0-beta.0+git 2016-05-06 14:04:01 -07:00
824478be5f *: add has leader metrics 2016-05-06 13:59:19 -07:00
ffd1fa6f52 Merge pull request #5288 from gyuho/version_bump
*: bump to 3.0.0-beta.0
2016-05-06 13:29:19 -07:00
faca29fc3b Merge pull request #5287 from xiang90/l_metrics
*: add leader changes to metrics
2016-05-06 13:27:08 -07:00
76d073a2b5 *: add leader changes to metrics 2016-05-06 13:12:20 -07:00
74ea9ea5cd *: bump to 3.0.0-beta.0 2016-05-06 13:09:50 -07:00
d17aaae714 Merge pull request #5265 from gyuho/fix_5246
v2http: allow empty role for GET '/users'
2016-05-06 11:58:21 -07:00
3c2d0a229c v2http: allow empty role for GET /users
Fix https://github.com/coreos/etcd/issues/5246.
2016-05-06 11:39:38 -07:00
879cfe7666 Merge pull request #5278 from heyitsanthony/fix-clientv3-disconnects
clientv3: fix disconnect breakage
2016-05-05 19:53:08 -07:00
712090fc09 clientv3: keep watcher client active if reconnect has network error
Otherwise watchers created after a long disconnect period will always
close immediately.
2016-05-05 19:30:11 -07:00
22c3a439bc clientv3: do not stop lease client on lost receive stream
Fixes #5242
2016-05-05 19:30:11 -07:00
cdc8f99658 clientv3: rework reconnection logic
Avoids go routine flood for tight loops with a dead connection.
Now uses request ctx when reconnecting for immediate retry.
2016-05-05 19:30:11 -07:00
cc37632003 Merge pull request #5285 from heyitsanthony/fix-windows-sha
build: set git sha on windows builds
2016-05-05 18:39:36 -07:00
5d86525230 build: set git sha on windows builds 2016-05-05 18:18:07 -07:00
93d84b9076 Merge pull request #5284 from xiang90/perf_doc
doc: add performance.md
2016-05-05 16:02:39 -07:00
b033167094 doc: add performance.md 2016-05-05 14:58:34 -07:00
98031a3b6e Merge pull request #5249 from xiang90/metrics
*: add metrics for grpc api
2016-05-05 14:19:46 -07:00
063307ec0a *: add metrics for grpc api 2016-05-05 13:45:52 -07:00
61add11b05 Merge pull request #5259 from gyuho/functional-test
etcd-tester: refactor
2016-05-05 11:15:18 -07:00
cc7dd9b729 etcd-tester: refactor 2016-05-05 10:55:42 -07:00
3bcd2b5b9f Merge pull request #5271 from heyitsanthony/fix-rafthttp-active-race
rafthttp: fix race on peer status activeSince
2016-05-04 13:49:58 -07:00
c5af1d7a88 rafthttp: fix race on peer status activeSince 2016-05-04 11:48:16 -07:00
b24d0032d2 Merge pull request #5269 from heyitsanthony/fix-httpproxy-race
httpproxy: fix race on getting close notifier channel
2016-05-04 09:49:19 -07:00
a76f5f5ed2 httpproxy: fix race on getting close notifier channel
Fixes #5267
2016-05-04 09:32:26 -07:00
53ed8750ce Merge pull request #5266 from maciej/scala_etcd_client
librarites-and-tools.md: add Scala-based maciej/etcd-client
2016-05-04 09:15:18 -07:00
aeff5507e6 librarites-and-tools.md: add Scala-based maciej/etcd-client 2016-05-04 02:56:17 +02:00
b7761530e1 Merge pull request #5251 from heyitsanthony/fix-watch-panic
clientv3: gracefully handle watcher resume on compacted revision
2016-05-03 15:00:39 -07:00
b53aaf4c82 Merge pull request #5262 from gyuho/more_logging
*: more detailed timeout logging
2016-05-03 14:13:46 -07:00
9bf601a921 etcdserver: log timeout 2016-05-03 13:39:31 -07:00
0f5b8c39b4 Merge pull request #5263 from gyuho/autotls-flag
etcdmain: add auto-tls flag to help.go
2016-05-03 13:14:23 -07:00
56dd991b4e etcdmain: add auto-tls flag to help.go 2016-05-03 12:40:02 -07:00
864cbd36bf Merge pull request #5261 from gyuho/typo
*: typo, remove string type assertions
2016-05-03 11:29:13 -07:00
1a0d1ab4ab Merge pull request #5260 from glevand/for-merge-build
build: Simplify host detection
2016-05-03 11:28:46 -07:00
a288188001 *: typo, remove string type assertions 2016-05-03 10:59:57 -07:00
5d8d684a91 Merge pull request #5257 from gyuho/proto_fix
*: fix protodoc, re-run genproto script, typos in proto files
2016-05-03 10:46:46 -07:00
fd27f9cd28 Merge pull request #5256 from gyuho/fix_build
build: set GitSHA version in cmd directory
2016-05-03 10:13:07 -07:00
4ecb560604 build: Simplify host detection
Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-05-03 09:54:44 -07:00
8b52fd0d2d clientv3: gracefully handle watcher resume on compacted revision
Fixes #5239
2016-05-03 09:30:53 -07:00
b7639b00e0 Merge pull request #5252 from xiang90/client-tls
*: support auto tls on client side
2016-05-03 09:22:11 -07:00
c5bf6a9d9e e2e: add test for auto client tls 2016-05-03 08:35:02 -07:00
015acabdbb *: rerun genproto -g 2016-05-02 23:02:31 -07:00
6222d46233 scripts/genproto.sh: update protodoc git SHA
To use protodoc with the fix
58fed2ed06.

This correctly parses the order of values in 'directories' flag.
2016-05-02 23:00:40 -07:00
36acde620e build: set GitSHA version in cmd directory
Fix https://github.com/coreos/etcd/issues/5255.
2016-05-02 22:16:40 -07:00
1f5c5abe6d Merge pull request #5253 from xiang90/fix_raft_test
raft: fix flaky test
2016-05-02 21:33:51 -07:00
2fa5b913fe raft: fix flaky test
We recently changed the randomized election timeout from (et, 2*et-1] tp
[et, 2*et-2], where et is user set election timeout.

So 2*et might trigger two elections instead of one. We need to fix the test
code accordingly.

Thanks for Tikv guys for finding this issue. We probably need to randomize
etcd/raft test more.
2016-05-02 21:08:19 -07:00
973ad5aa7c *: support auto tls on client side 2016-05-02 16:17:49 -07:00
fee71b18a3 Merge pull request #5248 from gyuho/hash_with_revision
functional-tester: use revision from hash method
2016-05-02 15:30:26 -07:00
064c1ff0f3 etcdserver/api/v3rpc: use Revision from Hash API 2016-05-02 15:06:39 -07:00
7a6d9ea01a mvcc: Hash to return Revision 2016-05-02 15:04:24 -07:00
a8139e2b0e Merge pull request #5247 from joshix/faqhead
Documentation/v2: Add newline before heading in faq.md
2016-05-02 11:43:58 -07:00
92d673ea59 Documentation/v2: Add newline before heading in faq.md
Minor rewrite to the heading text for clarity.

Matches downstream coreos-inc/coreos-pages#648 and
coreos-inc/coreos-pages#649.
2016-05-02 11:15:18 -07:00
b9ea5f6d90 Merge pull request #5241 from claws/avoid_differences_in_gnu_and_bsd_cut
use sed instead of cut to accomodate GNU and BSD differences
2016-04-30 20:58:57 -07:00
c071104fc4 script: fix build script regression to work on OSX
Use sed instead of cut to accomodate GNU and BSD differences

Fixes: #5240
2016-05-01 13:06:07 +09:30
28f3cb0f14 Merge pull request #5171 from xiang90/runner
etcd-runner: initial commit
2016-04-30 19:39:53 -07:00
73ecb61ff4 etcd-runner: initial commit 2016-04-30 17:24:03 -07:00
262de75a7e Merge pull request #5238 from xiang90/bench_watch_put
mvcc: add benchmark for watch put and improve it
2016-04-30 10:46:38 -07:00
ad327e01d0 mvcc: add benchmark for watch put and improve it 2016-04-29 19:58:37 -07:00
b58f8dd64b Merge pull request #5237 from brian-brazil/master
Improve some debug metrics.
2016-04-29 17:53:54 -07:00
ea1d0f3e0d etcdserver: Improve some debug metrics.
The _total suffix is by convention for counters,
don't use it on a gauge. Clarify help string.
Tweak metric name so it'll sort with related metrics,
and be a little more understandable.

Remove open file descriptor metric, as Prometheus client_golang
provides that out of the box as process_open_fds which is also
more up to date. Both only support Linux, so there's no loss of
platform support.

Fixes #5229
2016-04-30 01:29:13 +01:00
c89e348fbc Merge pull request #5232 from glevand/master
Add arm64 travis builds
2016-04-29 16:41:09 -07:00
552a5af10f Merge pull request #5236 from gyuho/wait_purge
pkg/fileutil: wait up to 300ms for purge test
2016-04-29 16:37:09 -07:00
b79bb6f164 travis: Enable arm64 builds
Setup a travis test matrix on a new variable 'TARGET', which specifies the CI
target.  Update the script section with a conditional that runs the needed
commands for each target.

Also, set go_import_path to make cloned repos work, enable the trusty VM, and
enable verbose builds when testing.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-04-29 15:31:30 -07:00
4ab1500a6d pkg/fileutil: wait up to 300ms for purge test
Fix https://github.com/coreos/etcd/issues/5231.

The issue shows that slow CI can take more than 200ms
for purging. This increase the loop iteration to wait
up to 300ms in case the disk is being slow.
2016-04-29 15:24:44 -07:00
00d6f104b5 Merge pull request #5235 from ronabop/get_put_typo
simple typo in README docs for getting started
2016-04-29 14:24:21 -07:00
c97b74a72f doc: fix etcdctl example in README
repeated put rather than put followed by get
2016-04-29 21:20:14 +00:00
634a9e833e Merge pull request #5233 from gyuho/client-doc
clientv3: fix README, add error handling example
2016-04-29 13:56:37 -07:00
0c5bcd5d80 clientv3: fix README, add error handling example 2016-04-29 13:34:16 -07:00
33968059e9 Merge pull request #5222 from gyuho/error_interface
rpctypes: error interface
2016-04-29 13:01:54 -07:00
ec1fdd3938 integration: test with new server errors 2016-04-29 12:00:26 -07:00
b3ebe66c97 clientv3/integration: tests with new errors 2016-04-29 12:00:26 -07:00
6049c95dc9 clientv3: auth with rpctypes.Error 2016-04-29 12:00:26 -07:00
506cf1f03f etcdserver/api/v3rpc: use new errors 2016-04-29 12:00:26 -07:00
2b361cf06b rpctypes: define a new error interface 2016-04-29 12:00:22 -07:00
d893a78c38 test: add v3rpc, rpctypes 2016-04-29 11:00:02 -07:00
8e099ab713 Merge pull request #5225 from heyitsanthony/local-tester
local-tester: procfile, faults, and network bridge
2016-04-29 10:27:56 -07:00
b8850cec93 Merge pull request #5228 from xiang90/fix_d
mvcc: fix watch deleteRange
2016-04-29 10:23:46 -07:00
29eca4eb88 Merge pull request #5223 from heyitsanthony/kv-less-reconnect
clientv3: better serialization for kv and txn connection retry
2016-04-29 10:02:17 -07:00
c0ff77e809 local-tester: procfile, faults, and network bridge
Creates a local fault injected cluster and stresser for etcd.

Usage: goreman -f tools/local-tester/Procfile start
2016-04-29 09:57:02 -07:00
3ddcc21179 mvcc: fix watch deleteRange 2016-04-29 09:40:28 -07:00
c26eb3f241 clientv3: better serialization for kv and txn connection retry
If the grpc connection is restored between an rpc network failure
and trying to reestablish the connection, the connection retry would
end up resetting good connections if many operations were
in-flight at the time of network failure.
2016-04-29 09:26:32 -07:00
60425de0ff Merge pull request #5227 from raoofm/patch-3
Doc: Update production-users.md
2016-04-29 08:25:07 -07:00
db8588ab93 Doc: Update production-users.md
Update the Backups policy
2016-04-29 11:23:51 -04:00
51ad5f00bf Merge pull request #5226 from raoofm/patch-2
Doc: Update production-users.md
2016-04-29 08:01:07 -07:00
419ae757d2 Update production-users.md 2016-04-29 10:58:24 -04:00
4480eb6d49 Merge pull request #5217 from gyuho/rpc_types
*: return rpctypes.Err in clientv3
2016-04-28 15:58:47 -07:00
f148f4b2b9 clientv3/integration: tests error types (rpctypes) 2016-04-28 15:42:27 -07:00
2e3d79a7bf clientv3: convert errors to rpctypes on returning
For https://github.com/coreos/etcd/issues/5211.
2016-04-28 15:39:37 -07:00
f613052435 rpctypes: Error function to convert clientv3 error 2016-04-28 12:16:13 -07:00
bef5be42b5 integration: add quota backend bytes option 2016-04-28 12:15:31 -07:00
11ec94b7e8 Merge pull request #5218 from heyitsanthony/fix-issue-3699
integration: wait for ReadyNotify in Issue3699 test
2016-04-28 10:48:08 -07:00
7c666b533a Merge pull request #5221 from heyitsanthony/parallel-e2e-integration
test: run e2e and integration tests in parallel
2016-04-28 10:30:40 -07:00
85edd66c65 test: run e2e and integration tests in parallel 2016-04-28 10:17:40 -07:00
8291110049 rafthttp: do not create new connections after stopping transport 2016-04-28 10:10:52 -07:00
d1e11842df Merge pull request #5219 from xiang90/req_timeout
etcdserver: add timeout for processing v3 request
2016-04-28 09:25:08 -07:00
6ee5f9c677 etcdserver: add timeout for processing v3 request 2016-04-28 08:52:17 -07:00
d814e9dc35 integration: wait for ReadyNotify in Issue3699 test
Fixes #5147
2016-04-27 22:04:07 -07:00
8df52dc6fa Merge pull request #5216 from heyitsanthony/lease-header-err
v3rpc: only fill lease grant header if no error
2016-04-27 16:51:16 -07:00
06ea8aee11 v3rpc: only fill lease grant header if no error
Was panicking under cluster fault injection.
2016-04-27 16:28:40 -07:00
ca83793876 Merge pull request #5169 from xiang90/ready
etcdserver: do not serve requests before finish the first internal proposal
2016-04-27 16:05:12 -07:00
434f2c356d etcdserver: do not serve requests before finish the first internal proposal 2016-04-27 15:46:31 -07:00
e50df7c19b Merge pull request #5215 from gyuho/finish_doc
Finish v2 documentation cleaning
2016-04-27 14:07:59 -07:00
c697aa7c60 Documentation: remove the rest
Remove:
1. auth_api.md
2. docker_guide.md
3. faq.md
4. implementation-faq.md
5. internal-protocol-versioning.md
2016-04-27 13:48:11 -07:00
8b3d1562f9 Documentation: remove admin_guide out of v2 2016-04-27 13:48:07 -07:00
c25c8573ac Merge pull request #5212 from gyuho/doc_fix
v2 documentation link fix
2016-04-27 13:18:39 -07:00
954535c2b4 Documentation: move members_api.md 2016-04-27 11:49:41 -07:00
42c09a95a0 Documentation: remove other_apis from v3 2016-04-27 11:40:48 -07:00
a2ab18fce5 Documentation: move api.md to v2 2016-04-27 11:40:48 -07:00
5464665107 Documentation: del backward_compatibility from v3 2016-04-27 11:40:48 -07:00
04fda9d25f Documentation: fix proxy link and delete from v3 2016-04-27 11:40:44 -07:00
95bac2dc3c Documentation: remove v2 snapshot migration doc 2016-04-27 11:31:44 -07:00
01927cc26a *: remove v2 specific authentication doc 2016-04-27 11:30:51 -07:00
f4b8e878ed Documentation: delete upgrade_2_* from v3 doc dir 2016-04-27 11:29:36 -07:00
63c5725fef Documentation: fix errorcode link to v2 2016-04-27 11:28:48 -07:00
afd2cc7373 Merge pull request #5206 from xiang90/lease_header
v3rpc: fill lease header
2016-04-27 11:18:00 -07:00
08f6c0775a Merge pull request #5199 from heyitsanthony/safe-lock-retry
clientv3/concurrency: use session lease id for mutex keys
2016-04-27 11:10:46 -07:00
07daa9fdc0 Merge pull request #5201 from gyuho/auth_test
auth: add basic tests
2016-04-27 10:57:20 -07:00
c3de53c23c v3rpc: fill lease header 2016-04-27 10:30:23 -07:00
14415c2187 auth: add tests 2016-04-27 10:13:36 -07:00
81ac766bb4 Merge pull request #5174 from gyuho/restart
etcd-tester: match more grpc errors
2016-04-27 09:47:55 -07:00
de7c18909f etcd-tester: match more grpc errors
To prevent stressers from returning from failure injections
2016-04-27 09:34:05 -07:00
8a4c9c9da1 Merge pull request #5205 from clearbit/rh-error-newline
etcdctl: Add a newline so that errors don't bleed into each other.
2016-04-27 07:31:08 -07:00
a00be40db2 etcdctl: Add a newline so that errors don't bleed into each other. 2016-04-27 14:25:57 +01:00
ecb0e2bd38 Merge pull request #5203 from heyitsanthony/fix-lease-leak
clientv3: check stream context in lease keep alive send loop
2016-04-26 20:42:31 -07:00
30a9229f38 clientv3: check stream context in lease keep alive send loop
If no leases are being kept alive, a connection reset would leak
the send routine since it would only test the stream when sending
keep alives.

Fixes #5200
2016-04-26 20:10:09 -07:00
22797c7185 clientv3/concurrency: use session lease id for mutex keys
With randomized keys, if the connection goes down, but the session remains,
the client would need complicated recovery logic to avoid deadlock.
Instead, bind the session's lease id to the lock entry; if a session tries
to reacquire the lock it will reassume its old place in the wait list.
2016-04-26 17:37:26 -07:00
c8ab6c348a Merge pull request #5196 from gyuho/password_check
etcdserver/auth: check empty password
2016-04-26 15:56:17 -07:00
bba08f6f79 e2e: add tests for issue 5182
For https://github.com/coreos/etcd/issues/5182.
2016-04-26 15:37:19 -07:00
07685bcf97 etcdserver/auth: check empty password in merge
Fix https://github.com/coreos/etcd/issues/5182.
2016-04-26 15:37:15 -07:00
78c96e893e Merge pull request #5198 from heyitsanthony/readme-3.0
doc: focus on v3 in README
2016-04-26 14:47:22 -07:00
dc55c312b0 doc: focus on v3 in README and clone old v2 docs
Fixes #5192
2016-04-26 14:41:59 -07:00
ce76c28805 Merge pull request #5197 from heyitsanthony/fix-lease-revoke-keepalive
etcdserver: respond with ttl=0 for revoked lease keep alive
2016-04-26 14:13:54 -07:00
af1a0b60e2 etcdserver: respond with ttl=0 for revoked lease keep alive
Fixes #5172
2016-04-26 13:53:20 -07:00
26e52d2bce Merge pull request #5190 from xiang90/deb_metrics
*: add debugging metrics
2016-04-26 10:27:05 -07:00
67645095e9 *: add debugging metrics 2016-04-26 09:52:56 -07:00
7161eeed8b Merge pull request #5191 from xiang90/github-folder
.github: add pull request and issue template
2016-04-25 16:22:48 -07:00
cc27c3a1e6 .github: add pull request and issue template 2016-04-25 16:22:13 -07:00
d923b59190 Merge pull request #5189 from heyitsanthony/storage-to-mvcc
*: rename storage package to mvcc
2016-04-25 15:52:08 -07:00
b7ac758969 *: rename storage package to mvcc 2016-04-25 15:25:51 -07:00
1440007608 Merge pull request #5187 from xiang90/doc_security
doc: add link to security
2016-04-25 14:32:12 -07:00
1d5bfd95dc Merge pull request #5188 from gyuho/gogoproto-dependency
Update gogo/proto, grpc dependency
2016-04-25 14:29:42 -07:00
12d01bb1eb vendor: update grpc, gogo/protobuf 2016-04-25 14:10:58 -07:00
4b31acf0e0 *: update generated Proto 2016-04-25 14:08:33 -07:00
82ef33a8d3 scripts: update genproto with new gogoproto hash 2016-04-25 14:07:40 -07:00
4b296bf51c doc: add link to security 2016-04-25 13:54:38 -07:00
9ec176a9b0 Merge pull request #5176 from xiang90/lease_client
clientv3: keepaliveonce should have a per call ctx
2016-04-25 11:45:58 -07:00
6de5b45b2f Merge pull request #5185 from joshix/dochds
Documentation/doc.md: Make headings boring :)
2016-04-25 11:45:20 -07:00
2a38cb5ad8 Documentation/doc.md: Make headings boring :)
Make the heading sentences that introduce each list of documents
a little more standard language, remove implied 2nd person, reduce
exclamations.
2016-04-25 10:58:25 -07:00
8a82ddadb9 Merge pull request #5181 from xiang90/cluster_doc
docs: move clustering doc
2016-04-25 10:50:29 -07:00
cbd79c666e clientv3: keepaliveonce should have a per call ctx
KeepAliveOnce should have a per call ctx. Now we have a per
API ctx, but we might do rpc calls mutiple times in a for loop.

To avoid unnecessary routine leak, use per call ctx.
2016-04-25 10:46:47 -07:00
1b98074897 docs: move clustering doc 2016-04-25 10:35:29 -07:00
1378e72bc2 Merge pull request #5184 from gyuho/typo
*: fix flag location, minor typo
2016-04-25 09:59:24 -07:00
3ae956eb89 Merge pull request #5179 from xiang90/doc_di
doc: link to recovery.md
2016-04-25 09:47:30 -07:00
3ad8e91e00 *: fix flag location, minor typo 2016-04-25 09:41:11 -07:00
663aca701d Merge pull request #5177 from xiang90/lease_client_2
clientv3: retry on switchRemoteAndStream
2016-04-25 09:36:06 -07:00
736e1d6c33 doc: link to recovery.md 2016-04-23 22:40:35 -07:00
844208d7dd clientv3: retry on switchRemoteAndStream
If switchRemoteAndStream fails, the whole lease API fails since
the internal routine exits. We should only fail the whole API when
there is a fatal error. For example, we should fail if we fail to
connection to all the endpoints user provided.

If we connect to an endpoint, but fail to create a stream, we should
retry instead of returning error to fail the entire API.
2016-04-23 21:55:34 -07:00
f8673b5f60 Merge pull request #5170 from gyuho/tester
etcd-tester: flag consistency-check
2016-04-22 22:26:17 -07:00
151d0d3831 etcd-tester: flag consistency-check 2016-04-22 22:22:12 -07:00
90f91ac8ac Merge pull request #5162 from heyitsanthony/disaster-doc
doc: v3 disaster recovery doc
2016-04-22 19:48:45 -07:00
579c1342e6 doc: v3 disaster recovery doc 2016-04-22 19:49:39 -07:00
50471d0c5c Merge pull request #5168 from heyitsanthony/fix-pipeline-leak
etcdserver: stop raft after stopping apply scheduler
2016-04-22 19:11:34 -07:00
08d879341d etcdserver: stop raft after stopping apply scheduler
Was causing a pipeline leak.
2016-04-22 17:15:13 -07:00
e51e146a19 Merge pull request #5167 from xiang90/doc_reorg
docs: update docs.md and create subdirs
2016-04-22 17:03:16 -07:00
bfd6465ea3 docs: update docs.md and create subdirs 2016-04-22 16:58:03 -07:00
45bf7fb960 Merge pull request #5165 from xiang90/race
raft: fix detected race in node.go
2016-04-22 16:12:33 -07:00
59c5110b73 raft: fix detected race in node.go 2016-04-22 15:45:33 -07:00
0dd9c2520b Merge pull request #5164 from gyuho/sleep_for_slow_network
etcd-tester: wait more for slow network recovery
2016-04-22 15:36:50 -07:00
6a0664d701 etcd-tester: wait more for slow network recovery
For https://github.com/coreos/etcd/issues/5121.
2016-04-22 15:24:47 -07:00
da1138f8de Merge pull request #5160 from gyuho/close_db
etcdctl/ctlv3: close bolt.DB in snapshot status
2016-04-22 12:10:28 -07:00
d49c044666 Merge pull request #5135 from heyitsanthony/maintenance-doc
doc: v3 maintenance
2016-04-22 12:02:39 -07:00
53abaf86c6 etcdctl/ctlv3: close bolt.DB in snapshot status 2016-04-22 11:43:52 -07:00
3ffbc4c8dd Merge pull request #5158 from gyuho/functional-test-check
etcd-tester: reset success var for every case
2016-04-22 09:37:27 -07:00
0feb88cee1 etcd-tester: change var success->failed
Previous success overwrites the later failure.
Make it simpler by changing the variable to 'failed'.
2016-04-22 09:27:37 -07:00
af30795752 Merge pull request #5157 from mitake/5155
etcdserver: remove a data race of ServerStat
2016-04-22 09:19:47 -07:00
24077fb3f6 etcdserver: remove a data race of ServerStat
It seems that ServerStats.BecomeLeader() is missing a lock.

Fix https://github.com/coreos/etcd/issues/5155
2016-04-22 23:41:38 +09:00
69bc0f76bc Merge pull request #5152 from heyitsanthony/fix-quota-test
integration: wait for alarm in TestV3StorageQuotaApply
2016-04-21 21:26:46 -07:00
2927c90fae integration: wait for alarm in TestV3StorageQuotaApply
Fixes #4974
2016-04-21 20:53:43 -07:00
f73cdf4035 Merge pull request #5153 from gyuho/api_doc
*: change Protocol Buffer documentation title
2016-04-21 20:03:37 -07:00
2751a10db6 *: change Protocol Buffer documentation title 2016-04-21 19:58:41 -07:00
fdf6335416 Merge pull request #5117 from gyuho/proto_gen
*: Protocol Buffer docs auto-generate script
2016-04-21 19:33:41 -07:00
753630dc37 *: Protocol Buffer docs auto-generate script 2016-04-21 19:14:21 -07:00
b8c35e3af8 doc: v3 maintenance 2016-04-21 17:02:46 -07:00
d32113a0e5 Merge pull request #5150 from xiang90/doc_f
doc: front page of etcd3 doc
2016-04-21 16:49:18 -07:00
e38710b5f9 doc: front page of etcd3 doc 2016-04-21 16:42:16 -07:00
0c191b71ec Merge pull request #5146 from gyuho/help
etcdmain: quota-backend-bytes in help.go
2016-04-21 13:24:20 -07:00
fa61bf86d7 etcdmain: add quota-backend-bytes to help.go 2016-04-21 13:05:54 -07:00
79a91b3450 Merge pull request #5145 from gyuho/skip_compact
etcd-tester: skip compaction after different hash
2016-04-21 11:09:19 -07:00
4e175a98c3 Merge pull request #5144 from xiang90/l
*: fix invalid access to backend struct
2016-04-21 10:14:39 -07:00
c0cf44f134 backedn: protect backend access with lock 2016-04-21 09:34:31 -07:00
4991cda202 etcdsever: fix the leaky snashot routine issue 2016-04-21 08:48:11 -07:00
8684d96914 Merge pull request #5124 from mitake/auth-v3-authenticate
*: support authenticate in v3 auth
2016-04-20 21:07:09 -07:00
131e3806bb *: support authenticate in v3 auth
This commit implements Authenticate() API of the auth package. It does
authentication based on its authUsers bucket and generate a token for
succeeding RPCs.
2016-04-21 12:32:19 +09:00
e835d24bea etcd-tester: skip compaction after different hash
When hashes don't match, there could be some nodes
falling behind and the compact request can then error
with 'future revision compact'.
2016-04-20 17:13:51 -07:00
05d5459b1d Merge pull request #5143 from gyuho/mirror-make-e2e
e2e: make-mirror
2016-04-20 15:33:41 -07:00
6eb25751ec e2e: make-mirror 2016-04-20 15:13:45 -07:00
29dfca883f Merge pull request #5141 from gyuho/alarm_test
e2e: test alarm
2016-04-20 12:09:43 -07:00
d976121e35 e2e: test alarm 2016-04-20 11:38:53 -07:00
20db51bfb2 Merge pull request #5138 from heyitsanthony/v2api-refactor
etcdserver: v2api refactor
2016-04-20 11:07:37 -07:00
b37a0ad9e7 Merge pull request #5137 from gyuho/member_add_test
e2e: add member add/update test
2016-04-20 10:38:43 -07:00
f1440f1d63 Merge pull request #5140 from xiang90/fix_d
backend: update db.size after defrag
2016-04-20 10:31:37 -07:00
0fe24e7ffc etcdserver: rename v3demo_server to v3_server
Not much of a demo any more.
2016-04-20 10:29:22 -07:00
ebace2eb1b etcdserver: split out v2 Do() API from core server code 2016-04-20 10:29:22 -07:00
41382bc3f0 etcdserver: split out v2 raft apply interface 2016-04-20 10:29:22 -07:00
1fe4c34398 Merge pull request #5131 from heyitsanthony/etcdctl-get-json
etcdctl: print full json response for Get
2016-04-20 10:21:48 -07:00
0893dbf7c1 e2e: add member add/update test 2016-04-20 10:05:55 -07:00
bfc6309222 Merge pull request #5129 from xiang90/pipe_test
make TestPipelineKeepSendingWhenPostError reliable
2016-04-20 10:02:17 -07:00
74d50884bb backend: update db.size after defrag 2016-04-20 10:01:38 -07:00
d2a58cbb0a etcdctl: print full json response for Get
Otherwise parsing get/txn output with json is somewhat complicated
because in some cases there's a json message and sometimes not.
Likewise, a get on an absent key has to return the current revision for
some algorithms to work.
2016-04-20 09:56:32 -07:00
fb137f11c5 rafthttp: make TestPipelineKeepSendingWhenPostError reliable 2016-04-20 09:38:47 -07:00
0c40f4a7e3 Merge pull request #5136 from heyitsanthony/test-display-gosimple
test: display failure output for gosimple
2016-04-19 23:25:12 -07:00
46dfa682e7 test: display failure output for gosimple 2016-04-19 22:58:37 -07:00
32a486b462 Merge pull request #5127 from xiang90/down_build
doc: build
2016-04-19 13:38:04 -07:00
d1067d39c7 doc: build 2016-04-19 13:37:50 -07:00
8af9c88377 Merge pull request #5122 from xiang90/lease_doc
doc: add lease section to interacting doc
2016-04-19 13:31:16 -07:00
16630529f7 Merge pull request #5125 from xiang90/dev_cluster
doc: add local_cluster doc
2016-04-19 10:51:16 -07:00
531ee93878 doc: add local_cluster doc 2016-04-19 10:50:54 -07:00
6d06c060b4 doc: add lease section to interacting doc 2016-04-19 08:18:59 -07:00
668ea89980 Merge pull request #5126 from judwhite/patch-2
raft/doc.go: add missing }
2016-04-19 07:25:31 -07:00
a9cfbd5414 raft/doc.go: add missing } 2016-04-19 04:21:33 -05:00
bf9cccfc34 Merge pull request #5118 from ajityagaty/fsync_osx
fileutil: Sync on HFS/OSX needs to be handled differently.
2016-04-18 22:22:53 -07:00
8b6de5f85d fileutil: Sync on HFS/OSX needs to be handled differently.
A call file.Sync on OSX doesn't guarantee actual persistence on
physical drive media as the data can be cached in physical drive's
buffers. Hence calls to file.Sync need to be replaced with
fcntl(F_FULLFSYNC).
2016-04-18 21:49:04 -07:00
d16628bf50 Merge pull request #5120 from magicwang-cn/master
etcdserver: close response body when getting cluster information
2016-04-18 19:44:19 -07:00
97c71f44fd etcdserver: close response body when getting cluster information 2016-04-19 10:03:40 +08:00
c4892c7f51 Merge pull request #5105 from xiang90/get_started
doc: add write/read example for interact doc
2016-04-18 14:27:53 -07:00
a2ac639176 doc: add write/read example for interact doc 2016-04-18 13:42:12 -07:00
8a0fa5622e Merge pull request #5114 from gyuho/snapshot_test
*: add Snapshot e2e test
2016-04-18 09:27:07 -07:00
b494ad3a0d Merge pull request #5112 from heyitsanthony/protobuf-comments
storagepb, etcdserverpb: improve documentation for RPC message fields
2016-04-17 23:53:53 -07:00
42245a5518 storagepb, etcdserverpb: improve documentation for RPC message fields 2016-04-17 23:33:00 -07:00
ea6a747fc1 Merge pull request #5116 from ajityagaty/typo_fix
etcdctlv3: Fix for typo in alarm command handling.
2016-04-17 20:30:22 -07:00
68dd22d93d etcdctlv3: Fix for typo in alarm command handling. 2016-04-17 19:31:39 -07:00
9504df2917 Merge pull request #5115 from gyuho/gc
v3rpc: bytes-key map look-up gc optimization
2016-04-17 13:21:47 -07:00
86f580fa8f v3rpc: bytes-key map look-up gc optimization
This change
f5f5a8b620
just got merged to go1.6.1 where Go does special optimization for x =
m[string(k)] where k is []byte.
2016-04-17 10:52:19 -07:00
a2afb513dd *: add snapshot e2e test 2016-04-16 13:27:10 -07:00
d4ff9364d4 Merge pull request #4861 from heyitsanthony/nfs-lock
pkg/fileutil: fix linux file locks over NFS
2016-04-16 08:59:10 -07:00
11e8d01035 Merge pull request #5113 from ajityagaty/remove_lease_id_casts
clientv3: Remove superfluous LeaseID casts in integration tests.
2016-04-16 07:22:06 -07:00
f15b5aa4e6 Merge pull request #5034 from ZhuPeng/proxy-http2
Enable http2 support between proxy and member
2016-04-16 07:04:41 -07:00
da5bd04a1a clientv3: Remove superflous LeaseID casts in integration tests.
The integration tests under clientv3 have superflous LeaseID casts
that are not needed as the ID field of the lease responses are of
type LeaseID now.
2016-04-15 17:48:20 -07:00
73b48dd8eb Merge pull request #5111 from Amit-PivotalLabs/fix-etcdctl-unset-env
etcdctl: unset ETCDCTL_API env var properly
2016-04-15 16:32:42 -07:00
c629a30f1f etcdctl: unset ETCDCTL_API env var properly 2016-04-15 15:43:00 -07:00
4ed5f66a7a Merge pull request #5109 from gyuho/member_remove_test
e2e: add member remove test
2016-04-15 15:04:00 -07:00
caf0e9b9b1 Merge pull request #5110 from gyuho/error_when_db_not_exist
etcdctl: snapshot status error for non-existent file
2016-04-15 14:44:25 -07:00
59a88d1cf6 e2e: add member remove test 2016-04-15 14:43:32 -07:00
a78ece4ac2 etcdctl: snapshot status error for non-existent file 2016-04-15 14:15:16 -07:00
3ee99a496f Merge pull request #5096 from heyitsanthony/clientv3-run-examples
test, clientv3: run examples as integration tests
2016-04-15 12:42:44 -07:00
9bfa0172f5 test, clientv3: run examples as integration tests 2016-04-15 11:51:30 -07:00
d4dae7e9e9 Merge pull request #5101 from gyuho/watch_bench_fix
benchmark: ensure all watcher receivers to finish
2016-04-15 11:49:24 -07:00
ad226f2020 benchmark: ensure all watcher receivers to finish
Fix https://github.com/coreos/etcd/issues/5099.
2016-04-15 11:11:14 -07:00
c1455a4f10 Merge pull request #5090 from ajityagaty/lease_id
clientv3: Use LeaseID in all the client APIs.
2016-04-15 10:48:29 -07:00
da153d3f3c Merge pull request #5091 from xiang90/r_h
doc: add response header doc into api
2016-04-15 09:57:48 -07:00
3b72c3da53 doc: add response header doc into api 2016-04-15 09:54:30 -07:00
81a5fc16ef Merge pull request #5095 from gyuho/govet_fix
*: fix govet -shadow in go tip
2016-04-15 09:41:24 -07:00
376234f196 Merge pull request #5094 from gyuho/watch_range_example
*: add more examples to clientv3, pkg/adt
2016-04-15 09:10:25 -07:00
641a1a66e1 *: fix govet -shadow in go tip 2016-04-15 07:39:52 -07:00
ae27b991b1 *: add more examples to clientv3, pkg/adt 2016-04-14 23:46:50 -07:00
06a4086bf9 clientv3: Use LeaseID in all the client APIs.
In order to use LeaseID type instead of int64 we have to convert
the protobuf lease responses into client lease reponses.
2016-04-14 23:09:46 -07:00
4ee7cad116 Merge pull request #5093 from gyuho/fix_test
functional-tester/etcd-tester: fix error check
2016-04-14 21:45:44 -07:00
8515ae30fb functional-tester/etcd-tester: fix error check 2016-04-14 21:31:12 -07:00
67db28f979 proxy: enable http2 for connecting to members
enable http2 when transport specified a custom TLS config, which was
not automatically enable.

Issue 5033
2016-04-15 10:16:26 +08:00
6c1cc1d4ea Merge pull request #5089 from heyitsanthony/fix-func-tester-timeout
etcd-tester: return error if first compaction times out
2016-04-14 17:24:22 -07:00
21233416e8 etcd-tester: return error if first compaction times out
Fixes #5081
2016-04-14 17:11:53 -07:00
74153ffa45 Merge pull request #5082 from xiang90/kv_d
doc: add doc for kv message
2016-04-14 15:17:04 -07:00
df37c75bb9 doc: add doc for kv message 2016-04-14 15:16:23 -07:00
f2e915f56e Merge pull request #5086 from heyitsanthony/test-race-rafthttp
test: check races on rafthttp
2016-04-14 14:21:20 -07:00
57448622d9 Merge pull request #5085 from heyitsanthony/hide-yaml
clientv3: make YamlConfig struct private
2016-04-14 14:10:20 -07:00
01be6933c6 test: check races on rafthttp
The data race in net/http has been fixed for a while.
2016-04-14 13:45:31 -07:00
cfbb8a71db Merge pull request #5084 from gyuho/typo
clientv3: fix example code format, more examples
2016-04-14 12:30:44 -07:00
04ef861c3d clientv3: make YamlConfig struct private 2016-04-14 12:26:01 -07:00
81e344bef9 clientv3: fix example code format, more examples 2016-04-14 12:13:07 -07:00
6bbdebb281 Merge pull request #5076 from gyuho/more_e2e
*: add, clean up e2e tests
2016-04-14 11:59:13 -07:00
6a3b5fe70c Merge pull request #5083 from ajityagaty/role_grant_test
e2e: Test case for the etcdctlv3 'role grant' command.
2016-04-14 11:53:21 -07:00
fefb58dc90 e2e: clean up, add more tests 2016-04-14 11:42:57 -07:00
4495559ad6 e2e: Test case for the etcdctlv3 'role grant' command.
Adding a test case to test the 'role grant' sub-command.
2016-04-14 11:31:07 -07:00
ba1c0a2b12 Merge pull request #5080 from xiang90/up
proxy: initial userspace tcp proxy
2016-04-14 10:41:46 -07:00
4a913ae60a proxy: initial userspace tcp proxy 2016-04-14 10:14:30 -07:00
da1132662a Merge pull request #5078 from ajityagaty/role_cmd_tests
e2e: Test case for the etcdctlv3 role command.
2016-04-14 09:44:07 -07:00
27844a6aef Merge pull request #5079 from mitake/auth-fix
auth: remove index out of range in role grant
2016-04-14 08:07:18 -07:00
a016220648 auth: remove index out of range in role grant
Fixes https://github.com/coreos/etcd/issues/5077
2016-04-14 22:02:10 +09:00
3b7c8d752c e2e: Test case for the etcdctlv3 role command.
New test cases have been added to test the 'role' and 'user'
sub-commands of etcdctlv3 utility.
2016-04-14 01:54:22 -07:00
ac95cc32ef Merge pull request #5075 from xiang90/p
proxy: move http related thing to httpproxy
2016-04-13 22:44:29 -07:00
e913792d0f Merge pull request #5073 from heyitsanthony/etcdctl-docs
doc: document many etcdctl commands
2016-04-13 22:08:22 -07:00
cd05ac4217 doc: document many etcdctl commands
documents defrag, compaction, lease, snapshot status, member, endpoint
2016-04-13 21:50:59 -07:00
b20d171ee1 Merge pull request #5074 from heyitsanthony/fix-compact-current-rev
storage: have Range on rev=0 work even if compacted to current revision
2016-04-13 21:15:55 -07:00
66d2ae7a39 proxy: move http related thing to httpproxy 2016-04-13 21:09:26 -07:00
d72bcdc156 storage: have Range on rev=0 work even if compacted to current revision 2016-04-13 21:00:35 -07:00
e6ff5a38e1 Merge pull request #5072 from heyitsanthony/fix-ep-json
etcdctl: respect --write-out=json for endpoint status command
2016-04-13 19:12:26 -07:00
793fb2cf64 Merge pull request #4673 from gyuho/slow
functional-tester: add latency test (simulate slow network)
2016-04-13 17:07:30 -07:00
f07350735d etcdctl: respect --write-out=json for endpoint status command 2016-04-13 17:04:31 -07:00
6af40ea1e1 functional-tester: add latency test (simulate slow network)
Fix https://github.com/coreos/etcd/issues/4666.
2016-04-13 17:00:09 -07:00
e9aa8ff235 Merge pull request #5071 from gyuho/member_api_change
*: Member api change
2016-04-13 16:45:10 -07:00
3dcfe79cc0 Merge pull request #5070 from heyitsanthony/member-doc
etcdctl: display required arguments for member commands in usage
2016-04-13 16:40:16 -07:00
7a2ef3eb00 *: regenerate proto buffers 2016-04-13 16:24:07 -07:00
2c6176b5f2 *: remove MemberLeader API in client side (fix examples) 2016-04-13 16:23:57 -07:00
b78886239e *: remove IsLeader field in Member API server side 2016-04-13 16:23:33 -07:00
90df7fd738 etcdctl: display required arguments for member commands in usage 2016-04-13 16:18:00 -07:00
22812badc2 Merge pull request #5069 from heyitsanthony/fix-snapshot-status-json
etcdctl: respect -write-out=json for snapshot status
2016-04-13 15:57:39 -07:00
b90e30b28e etcdctl: respect -write-out=json for snapshot status 2016-04-13 13:37:32 -07:00
a553ea8ba7 Merge pull request #5068 from heyitsanthony/lease-fixups
etcdctl: improve lease command documentation and exit codes
2016-04-13 13:20:06 -07:00
993f25f055 Merge pull request #5065 from heyitsanthony/errexit-defrag
etcdctl: return non-zero exit code if defrag fails on any endpoint
2016-04-13 13:19:43 -07:00
721ed6ba2b etcdctl: return non-zero exit code if defrag fails on any endpoint 2016-04-13 12:39:43 -07:00
855a5116a2 etcdctl: improve lease command documentation and exit codes 2016-04-13 12:38:21 -07:00
c0971a6ebc Merge pull request #5066 from gyuho/compaction_test
e2e: compaction test
2016-04-13 12:35:20 -07:00
3f0863a1e9 e2e: compact test 2016-04-13 12:07:48 -07:00
c8e860c4fa Merge pull request #5055 from gyuho/get_rev
*: add rev flag to get command
2016-04-13 12:05:48 -07:00
3fef0eb0d8 Merge pull request #5061 from xiang90/grpc_d
*:update dependencies
2016-04-13 11:40:14 -07:00
5157b713ed Merge pull request #5064 from raoofm/patch-1
Documentation: v3 mem benchmark total watch value
2016-04-13 11:35:23 -07:00
60548b85c4 *: add rev flag to get command 2016-04-13 11:32:29 -07:00
15e865e024 Merge pull request #5062 from gyuho/govet-mutex
etcd-tester: fix govet
2016-04-13 11:19:20 -07:00
cb280bae91 etcd-tester: fix govet 2016-04-13 11:12:31 -07:00
61cfe68247 Documentation: v3 mem benchmark total watch value
Updating Documentation/benchmarks/etcd-3-watch-memory-benchmark.md with the correct 'total watching' value
2016-04-13 14:12:10 -04:00
52c4595899 Merge pull request #5060 from gyuho/ineffassign
*: fixes based on ineffassign
2016-04-13 10:59:58 -07:00
7c5ec417c3 *:update dependencies 2016-04-13 10:47:24 -07:00
89f8e66682 *: fixes based on ineffassign 2016-04-13 10:41:58 -07:00
35d2d7b23e Merge pull request #5059 from gyuho/elect_e2e_test
e2e: add elect command test
2016-04-13 10:25:28 -07:00
1224044553 e2e: add elect command test 2016-04-13 10:00:56 -07:00
228e772b3a Merge pull request #5056 from heyitsanthony/expect-signal
pkg/expect, e2e: support sending Signals to expect process, test etcdctl lock
2016-04-13 09:42:41 -07:00
8763bd1e97 e2e: etcdctlv3 lock test 2016-04-13 09:26:16 -07:00
604a73c833 e2e: remove sh in spawnCmd
certain shells claim the ppid for expect processes which interferes with
signals
2016-04-13 09:12:40 -07:00
fcb5ba98d0 pkg/expect: support sending Signals to expect process 2016-04-13 09:11:57 -07:00
18992bac4f Merge pull request #5057 from heyitsanthony/e2e-v3-cleanup
e2e: cleanup error and prefix arg handling for ctlv3 tests
2016-04-13 09:09:13 -07:00
209f573083 e2e: cleanup error and prefix arg handling for ctlv3 tests 2016-04-12 23:48:13 -07:00
2985396768 Merge pull request #5053 from xiang90/ctl_i
etcdctl: move endpoint-heath and status into endpoint command
2016-04-12 16:50:03 -07:00
ae9b251d99 etcdctl: move endpoint-heath and status into endpoint command 2016-04-12 16:30:26 -07:00
0ca949ce90 Merge pull request #5051 from heyitsanthony/fix-user-list
etcdctl: don't panic on ListUser with roles
2016-04-12 14:24:08 -07:00
c9ce92f635 client: accept roles in response for ListUser
Fixes #5046
2016-04-12 12:48:43 -07:00
a8b7d0b63c Merge pull request #5050 from xiang90/b_v
etcdserver: save cluster version into backend
2016-04-12 12:05:02 -07:00
e9735b7bd0 etcdserver: save cluster version into backend 2016-04-12 11:37:22 -07:00
f13e558ab4 e2e: test etcdtl user list on root user 2016-04-12 11:15:06 -07:00
095a755e4d Merge pull request #5049 from heyitsanthony/fix-grant-roles-existing
etcdctl: don't crash on duplicate role in user grant
2016-04-12 11:05:08 -07:00
a12fd9cc92 etcdctl: print grant/revoke error instead of scanning roles for changes
Fixes #5045
2016-04-12 10:49:05 -07:00
a0d653b630 e2e: test etcdctl v2 double user grant
Crashes in 2.3.1
2016-04-12 10:49:05 -07:00
040f7b90c7 Merge pull request #5048 from xiang90/fix_c
rafthttp: fix comment in msgappv2
2016-04-12 10:20:04 -07:00
f2d558644d rafthttp: fix comment in msgappv2 2016-04-12 10:14:06 -07:00
ef0d5c3d7d Merge pull request #4957 from mqliang/memberStatus
etcdctlv3: expose store size and raft status in 'etcdctl status' command
2016-04-12 08:46:45 -07:00
ff311ba0a7 etcdctlv3: print db size and raft status in 'etcdctl status' command 2016-04-12 22:58:22 +08:00
a9a06438f9 etcdctlv3: expose db size and raft status in server side 2016-04-12 22:49:15 +08:00
1044fbce2c etcdctlv3: update aunto generated files 2016-04-12 22:48:47 +08:00
c3da2631bf etcdctlv3: add db size and raft status in protobuffer 2016-04-12 22:47:27 +08:00
17e32b6aa9 Merge pull request #5041 from xiang90/snap_info
snapshot status
2016-04-11 23:13:08 -07:00
50219d4def Merge pull request #5042 from gyuho/ts
benchmark: return time series with missing periods filled in
2016-04-11 23:09:36 -07:00
8e3d99cd3e Merge pull request #5043 from mitake/auth-trivial
little cleaning of v3 auth
2016-04-11 23:09:22 -07:00
2aab6ff2eb benchmark: return time series with missing periods filled in 2016-04-11 23:07:45 -07:00
94d436c5d1 vendor: add go-humanize 2016-04-11 22:55:47 -07:00
b5292f6fce etcdctl: add snapshot status support 2016-04-11 22:55:47 -07:00
0b4749ea65 auth: remove needless logging during creating a new user 2016-04-12 14:52:31 +09:00
bfd49023a1 auth: sort key permissions of role struct for effective searching 2016-04-12 14:52:31 +09:00
b1c3e7edbf Merge pull request #4982 from heyitsanthony/godep-update-script
scripts: updatedep.sh to update vendored dependencies
2016-04-11 19:47:18 -07:00
4481e54017 Merge pull request #5040 from heyitsanthony/fix-txn-rev
etcdserver: set txn header revision to store revision following txn
2016-04-11 19:41:54 -07:00
c5b8e8dc88 etcdserver: set txn header revision to store revision following txn 2016-04-11 17:03:05 -07:00
8c2225f251 Merge pull request #5038 from heyitsanthony/sshot-docs
doc: document etcdctl snapshot command
2016-04-11 16:21:09 -07:00
195100a769 Merge pull request #5039 from heyitsanthony/fix-write-out
etcdctl: respect --write-out
2016-04-11 16:19:43 -07:00
3a695a82a3 Merge pull request #5036 from xiang90/r_t
raft: add a test case for Test Slice
2016-04-11 16:02:13 -07:00
e5a2bd58ec etcdctl: respect --write-out
Support got clobbered about a month ago.
2016-04-11 16:01:38 -07:00
6e8d01f956 doc: document etcdctl snapshot command 2016-04-11 15:58:20 -07:00
0a684c10ad Merge pull request #5025 from xiang90/no_dup_resp
etcdserver: do not send out out of date appResp
2016-04-11 14:41:52 -07:00
3bad47d691 Merge pull request #5018 from xiang90/b
etcdserver: set backend to cluster
2016-04-11 13:02:57 -07:00
be822b05d2 Merge pull request #5012 from heyitsanthony/snap-api
*: snapshot RPC
2016-04-11 13:00:18 -07:00
e838c26f8a etcdctl: use snapshot RPC in snapshot command 2016-04-11 12:32:53 -07:00
b97b5843a3 Merge pull request #5035 from heyitsanthony/fix-unused-output
test: display unused output if unused source found
2016-04-11 11:36:23 -07:00
174a996c37 Merge pull request #5032 from mitake/auth-user-grant
*: support granting a role to a user in v3 auth
2016-04-11 11:10:10 -07:00
9423125ce1 raft: add a test case for Test Slice 2016-04-11 10:04:03 -07:00
2113b77635 test: display unused output if unused source found
unused will non-zero exit if it finds unused source which causes test's
set -e to close out of the test script
2016-04-11 09:55:22 -07:00
d5766eab3e clientv3: add Snapshot to Maintenance 2016-04-11 09:51:17 -07:00
a6b6fcf1c4 etcdserverpb, v3rpc: add Snapshot to Maintenance RPC service 2016-04-11 09:51:16 -07:00
7ba2646d37 *: support granting a role to a user in v3 auth 2016-04-11 15:53:30 +09:00
af1b3f061a Merge pull request #5024 from ajityagaty/user_cmd_tests
e2e: Test cases for the etcdctlv3 user commands.
2016-04-10 23:50:12 -07:00
6c8428c393 Merge pull request #5031 from gyuho/cleanup
*: clean up from go vet, misspell
2016-04-10 23:32:46 -07:00
9108af9046 *: clean up from go vet, misspell 2016-04-10 23:16:56 -07:00
1f4f3667a4 Merge pull request #5021 from gyuho/vendor_doc
*: client vendoring README
2016-04-10 22:15:36 -07:00
935999a80e Merge pull request #5030 from mitake/auth-trivial
trivial updates for v3 auth
2016-04-10 21:47:08 -07:00
53bb79f240 auth: remove needless field from protobuf define
The field tombstone won't be used in the future because of the design
change.
2016-04-11 13:02:34 +09:00
097cec8194 etcdctl: let some v3 auth related functions be private
They don't need to be public.
2016-04-11 13:01:19 +09:00
27480f9ea4 Merge pull request #4966 from mitake/auth-role-grant
*: support granting key permission to role in v3 auth
2016-04-10 20:31:05 -07:00
02033b4c47 *: support granting key permission to role in v3 auth 2016-04-11 12:23:19 +09:00
f5f0280a63 Merge pull request #5028 from heyitsanthony/etcdmain-unsupported-envvar
etcdmain: start on unsupported arch when ETCD_UNSUPPORTED_ARCH is set
2016-04-10 19:55:34 -07:00
c4caa65c51 etcdmain: start on unsupported arch when ETCD_UNSUPPORTED_ARCH is set 2016-04-10 19:36:04 -07:00
130567832f Merge pull request #4734 from luxas/32bit_alignments
etcdserver: align 64-bit atomics on 8-byte boundary
2016-04-10 19:18:15 -07:00
603c14db9d e2e: Test cases for the etcdctlv3 user commands.
New test cases have been added to test the "user" sub-commands of
the etcdctlv3 utility.
2016-04-10 17:46:04 -07:00
0d9039f192 Merge pull request #5026 from lodevil/master
KeepAliveOnce error fix (when the lease not found)
2016-04-10 17:35:52 -07:00
e3fd246414 clientv3: fix KeepAliveOnce return error message 2016-04-11 08:13:36 +08:00
de7692b2b2 etcdserver: do not send out out of date appResp 2016-04-09 23:30:00 -07:00
3c0ac9d600 etcdserver: set backend to cluster 2016-04-08 21:46:45 -07:00
78554c6de6 *: client vendoring README 2016-04-08 19:48:17 -07:00
345bdc3db6 Merge pull request #5017 from xiang90/member
membership: save/update the whole member information into backend
2016-04-08 13:30:35 -07:00
a406c9fa3d membership: save/update the whole member information into backend 2016-04-08 13:14:37 -07:00
fe810e7b43 Merge pull request #5015 from gyuho/semaphore-ci-badge
README: change semaphore CI status badge
2016-04-08 12:10:05 -07:00
9bb99b5f72 Merge pull request #5016 from gyuho/lease_simple
*: clean up from gosimple
2016-04-08 12:09:56 -07:00
953a08d841 *: clean up from gosimple 2016-04-08 11:55:03 -07:00
4997ed36b4 Merge pull request #5011 from xiang90/r_c
raft: fix issues reported by golint
2016-04-08 11:46:12 -07:00
97730778e5 README: change semaphore CI status badge
We just reset Semaphore CI, and badge URL is changed.
2016-04-08 11:24:30 -07:00
b70e6a6bf1 Merge pull request #4916 from es-chow/transfer-leader
raft: transfer leader feature
2016-04-08 08:01:24 -07:00
ac059eb8cb raft: transfer leader feature 2016-04-08 16:56:32 +08:00
4041bbe571 Merge pull request #5008 from gyuho/gosimple_unused
clean up with gosimple and unused
2016-04-07 23:31:21 -07:00
fb85da92e8 *: fix based on gosimple and unused 2016-04-07 23:16:37 -07:00
9aec045fce test, travis: integrate gosimple and unused 2016-04-07 23:16:33 -07:00
1b41ee9c99 raft: fix issues reported by golint 2016-04-07 22:14:56 -07:00
49f9b5470e Merge pull request #5009 from xiang90/sp
*: fix misspell
2016-04-07 22:09:41 -07:00
9c7fb9c360 *: fix misspell 2016-04-07 21:57:06 -07:00
71a492e59e Merge pull request #5005 from xiang90/clu_storage
membership: update attr in membership pkg
2016-04-07 21:40:32 -07:00
b13b77f362 membership: update attr in membership pkg 2016-04-07 21:25:32 -07:00
2fe3e1e850 Merge pull request #5007 from heyitsanthony/hush-caps
v2http: only report capabilities on update
2016-04-07 20:31:37 -07:00
2b7ad35fa0 v2http: only report capabilities on update 2016-04-07 20:14:30 -07:00
1f5794c117 Merge pull request #4997 from heyitsanthony/fix-race-consistent
etcdserver: fix race on consistent index
2016-04-07 20:12:22 -07:00
4d2d2cabb9 etcdserver: fix race on consistent index 2016-04-07 19:53:08 -07:00
004ff3d4f0 Merge pull request #5006 from gyuho/watch_type
clientv3/integration: use clientv3.Event type
2016-04-07 19:48:18 -07:00
a9f1d5dfa6 clientv3/integration: use clientv3 event types
Fix https://github.com/coreos/etcd/issues/5001.
2016-04-07 19:29:32 -07:00
8b320e7c55 Merge pull request #4999 from gyuho/test
*: log, expect by capability check
2016-04-07 19:06:15 -07:00
1c12b66e35 Merge pull request #5000 from xiang90/clu_storage
membership: save/update/delete member when backend is provided
2016-04-07 18:00:11 -07:00
868a3e279d Merge pull request #5002 from gyuho/agent_test
etcd-agent: fix etcd agent tests, remove unused listener
2016-04-07 17:19:44 -07:00
d78345244b *: log, expect by capability check 2016-04-07 17:18:51 -07:00
139f23fd13 etcd-agent: fix etcd agent tests, remove unused listener 2016-04-07 17:04:24 -07:00
29623cccb2 membership: save/update/delete member when backend is provided 2016-04-07 16:34:43 -07:00
c91c7ca3bf Merge pull request #4961 from heyitsanthony/rename-lease-create
*: rename lease Create to Grant
2016-04-07 14:51:22 -07:00
f31105bc08 Merge pull request #4994 from xiang90/clu
etcdserver: move membership related code to membership pkg
2016-04-07 14:39:18 -07:00
bf2289ae00 etcdserver: move membership related code to membership pkg 2016-04-07 14:21:37 -07:00
5d4ee7ac5f Merge pull request #4995 from gyuho/proxy-clean
proxy: simplify channel receive, add missing function call
2016-04-07 12:32:24 -07:00
dc17eaace7 *: rename Lease Create to Grant
Creating a lease through the client API interface union looked like
"c.Create(...)"-- the method name wasn't very descriptive.
2016-04-07 12:28:14 -07:00
6abbdcdc06 proxy: simplify channel receive, add missing function call 2016-04-07 12:24:17 -07:00
ee4ff1e448 Merge pull request #4976 from gyuho/lease_testing
e2e: lease tests, fix minor format string
2016-04-07 11:25:51 -07:00
84bf6e7462 e2e: lease tests, fix minor format string 2016-04-07 11:18:49 -07:00
a38617d93a Merge pull request #4992 from gyuho/e2e_clean
e2e: clean up, return all lines in error
2016-04-07 10:59:08 -07:00
2779341250 e2e: clean up, return all lines in error
1. change file names
2. now if sub-command errors, the test will receive all
lines from stdout and stderr.

Expected output:

```
read /dev/ptmx: input/output error (expected key2, got ["key1\r\n" "val1\r\n" ""])
```

3. change how we check GRPC timeout (only bypass timeout error when we give 0
timeout)
2016-04-07 10:41:56 -07:00
ac232ac9a7 scripts: updatedep.sh to update vendored dependencies
Running godep in the vendored cmd directory will try to pull etcd in
as a dependency. As a fix, this script safely vendors into cmd.
2016-04-07 10:28:33 -07:00
2e5ee26300 Merge pull request #4987 from hongchaodeng/ev
expose APIs to recognize event type
2016-04-07 10:18:25 -07:00
21eda79451 Merge pull request #4991 from endocode/kayrus/faq_doc
docs: fixed markdown formatting in faq.md
2016-04-07 09:59:35 -07:00
5c782a2086 docs: fixed markdown formatting in faq.md 2016-04-07 18:51:33 +02:00
aa11dafaf8 clientv3: expose event type in user API
- add another layer of abstraction in clientv3 for user, not expose internal storagepb ones
- provide commonly used routines IsCreate(), IsModify() on event
2016-04-07 09:47:04 -07:00
a5f341e886 Merge pull request #4989 from xiang90/clu
*: move Cluster interface to api
2016-04-07 08:33:52 -07:00
030865abe3 *: move Cluster interface to api 2016-04-07 08:05:47 -07:00
b137df77f1 Merge pull request #4985 from gyuho/unused
*: clean up unused vars, functions
2016-04-06 21:49:58 -07:00
6e6d64fb9b *: clean up unused vars, functions
With help from https://github.com/dominikh/go-unused.
IsNetTimeoutError seems useful, so moved to pkg/netutil.
2016-04-06 21:33:55 -07:00
79a09e6857 Merge pull request #4984 from gyuho/watch-range
clientv3/integration: fix watch range test typo
2016-04-06 21:32:30 -07:00
e72591b4a2 clientv3/integration: fix watch range test typo 2016-04-06 21:12:07 -07:00
7408bc2504 Merge pull request #4948 from heyitsanthony/update-grpc
vendor: update grpc
2016-04-06 17:55:53 -07:00
82e58e602d Merge pull request #4983 from gyuho/expect_line
pkg/expect: ExpectFunc, LineCount
2016-04-06 16:10:02 -07:00
679e5e379b pkg/expect: ExpectFunc, LineCount
ExpectFunc to make expect more extensible. LineCount to be
able to check 'no output' command.
2016-04-06 15:56:00 -07:00
62990fb5fa Merge pull request #4970 from tamird/fix-raft-past-election
raft: correct regression in `pastElectionTimeout`
2016-04-06 08:03:38 -07:00
68db18667a raft: correct doc comment 2016-04-06 08:43:42 -04:00
5250784b09 raft: use rand.Intn instead of rand.Int and mod
This provides a better random distribution and is easier to read.
2016-04-06 08:43:42 -04:00
6b0eb9c3c0 godeps: update grpc dependency 2016-04-06 01:30:06 -07:00
34375ef851 Merge pull request #4950 from heyitsanthony/revendor
vendor: only vendor on emitted binaries
2016-04-05 21:36:51 -07:00
b1d41016b2 vendor: only vendor on emitted binaries
Moves the vendor/ directory to cmd/vendor. Vendored binaries are built
from cmd/, which is backed by symlinks pointing back to repo root.
2016-04-05 21:01:16 -07:00
b9e933b850 Merge pull request #4971 from gyuho/e2e_more
e2e: clean up to test tables, endpoint-health test
2016-04-05 14:34:35 -07:00
e3599e4145 e2e: clean up to test tables, endpoint-health test 2016-04-05 13:33:37 -07:00
01c303113d Merge pull request #4964 from gyuho/get_sort_e2e
e2e: get with sort order, target
2016-04-04 23:22:04 -07:00
3e39f36b34 e2e: get with sort order, target 2016-04-04 23:10:03 -07:00
c3bca3739f Merge pull request #4926 from mitake/auth-role-add
*: support adding role in auth v3
2016-04-04 18:44:16 -07:00
21096bf27f Merge pull request #4963 from xiang90/ht
*: mv etcdhttp into api pkg
2016-04-04 18:40:29 -07:00
8662aaada4 Merge pull request #4958 from mitake/progrep-race
etcdserver, clientv3: let progressReportIntervalMilliseconds be private
2016-04-04 18:04:57 -07:00
2b17a3919c *: support adding role in auth v3 2016-04-05 09:28:17 +09:00
88306c9fa7 etcdserver, clientv3: let progressReportIntervalMilliseconds be private
progressReportIntervalMilliseconds (old
ProgressReportIntervalMilliseconds) is accessed by multiple goroutines
and it is reported as race.

For avoiding this report, this commit wraps the variable with
functions. They access the variable with atomic operations so the race
won't be reported.
2016-04-05 09:12:17 +09:00
2c50eb240e *: mv etcdhttp into api pkg 2016-04-04 16:31:35 -07:00
bfbe0fac8c Merge pull request #4951 from gyuho/watch_prefix
e2e: watch by prefix
2016-04-04 15:11:32 -07:00
9de5b8db80 e2e: watch by prefix 2016-04-04 14:52:54 -07:00
b3247356c1 Merge pull request #4956 from heyitsanthony/txn-serialize
etcdserver: serializable transactions
2016-04-04 09:51:09 -07:00
98504fe863 Merge pull request #4959 from gyuho/ctl_doc
etcdctl: READMEv3 doc about prefix
2016-04-04 08:28:41 -07:00
1543e7bd95 etcdctl: READMEv3 doc about prefix 2016-04-04 07:00:49 -07:00
fab3c8e705 etcdserver: serializable transactions
Support case where txn doesn't have to go through quorum.
2016-04-04 04:21:42 -07:00
46e877b8bb Merge pull request #4955 from mitake/e2e-test
e2e: import fmt in etcdctlv3_test.go
2016-04-04 01:37:21 -07:00
4ff81678ac e2e: import fmt in etcdctlv3_test.go 2016-04-04 17:00:33 +09:00
b6ac21374e Merge pull request #4952 from ajityagaty/snap_db_file_fix
snap: Do not complain about db file.
2016-04-03 17:54:03 -07:00
c12f263577 snap: Do not complain about db file.
Currently the snapshotter throws a warning if a file without the
.snap suffix is found. Fix it to allow known files to exist in
the snap folder.
2016-04-03 17:28:04 -07:00
e8a4ed01e2 Merge pull request #4949 from gyuho/delete
*: add del by prefix with e2e tests
2016-04-03 12:09:16 -07:00
3abd137dc5 Merge pull request #4945 from heyitsanthony/fix-exit-status
e2e, pkg/expect: distinguish between Stop and Close
2016-04-03 12:02:59 -07:00
dc420d660e e2e, pkg/expect: distinguish between Stop and Close
Fixes #4928
2016-04-03 11:45:02 -07:00
9afae9e2c1 *: add del by prefix with e2e tests 2016-04-03 11:41:49 -07:00
bb69dd324e Merge pull request #4939 from gyuho/e2e_txn_version
e2e: etcdctlv3 version, txn basic tests
2016-04-03 11:09:57 -07:00
73b0d398e4 Merge pull request #4946 from xiang90/b
vendor: update boltdb to 1.2.0
2016-04-03 10:59:51 -07:00
f4eaa3f8fb pkg/expect: replace SendLine with Send method 2016-04-03 10:57:35 -07:00
c280871714 e2e: etcdctlv3 version, txn basic tests 2016-04-03 10:57:31 -07:00
37c1edc952 vendor: update boltdb to 1.2.0 2016-04-03 10:47:07 -07:00
19136afc2b Merge pull request #4798 from mqliang/memberStatus
etcdctlv3: initial implementaton of 'etcdctl member status' command
2016-04-03 08:48:23 -07:00
d80af00785 etcdctlv3: implement the 'etcdctl status' command 2016-04-03 13:55:58 +08:00
f3ca17ea03 etcdctlv3: implement the client side functionality 2016-04-03 13:46:34 +08:00
1d5d2494ed etcdctlv3: implement status rpc in server side 2016-04-03 13:46:01 +08:00
bbca61252f etcdctlv3: update aunto generated files 2016-04-03 13:45:17 +08:00
3c62bfb7a3 etcdctlv3: add status rpc in protbuffer file 2016-04-03 13:44:45 +08:00
6770b9c67a Merge pull request #4944 from gyuho/delete_num
etcdctl: print number of deleted keys
2016-04-02 21:13:46 -07:00
e8877ab180 etcdctl: print number of deleted keys 2016-04-02 20:54:37 -07:00
584d90cd5d Merge pull request #4912 from gyuho/defrag
functional-tester: defrag every 500 round
2016-04-02 18:58:41 -07:00
b866337f25 functional-tester: defrag every 500 round
Fix https://github.com/coreos/etcd/issues/4665.
2016-04-02 18:51:26 -07:00
d2ce6836af Merge pull request #4942 from xiang90/def
backend: reset count in defrg
2016-04-02 18:43:03 -07:00
c09f23c46d *: clean up bool comparison 2016-04-02 18:27:54 -07:00
2b54b73b90 backend: reset count in defrg 2016-04-02 17:25:05 -07:00
b0cc0e443c *: clean up if, bool comparison 2016-04-02 12:55:11 -07:00
dc0061e4db e2e: add Get tests 2016-04-01 22:45:27 -07:00
ff01a4de65 Merge pull request #4936 from heyitsanthony/compact-barrier-restore
etcdserver, storage: don't ack physical compaction on error or snap restore
2016-04-01 20:18:12 -07:00
6f707b857a etcdserver, storage: don't ack physical compaction on error or snap restore
Snapshot recovery will reset the FIFO; reschedule the physical acknowledgment
instead of acknowledging on scheduler teardown.
2016-04-01 16:32:05 -07:00
eea56d037e etcdserver: fix govet error 2016-04-01 16:01:47 -07:00
3083b6d11e Merge pull request #4933 from xiang90/m
MAINTAINERS: update maintainers list
2016-04-01 15:34:57 -07:00
623c7b4df4 Merge pull request #4930 from heyitsanthony/fix-wal-corrupt
wal: fix tail corruption
2016-04-01 15:23:52 -07:00
c0e614b0bd MAINTAINERS: update maintainers list 2016-04-01 15:12:08 -07:00
bfe3a3d08e wal: fix tail corruption
On ReadAll, WAL seeks to the end of the last record in the tail. If the tail did not
end with preallocated space, the decoder would report 0 as the last offset and begin
writing at offset 0 of the tail.

Fixes #4903
2016-04-01 15:05:52 -07:00
e1b561cb7c Merge pull request #4929 from xiang90/rand
raft: lower split vote rate
2016-04-01 12:35:59 -07:00
5d431b4782 raft: lower split vote rate 2016-04-01 12:11:03 -07:00
bf6d905a5a Merge pull request #4923 from xiang90/conf
clientv3: support read conf from file
2016-04-01 10:09:51 -07:00
f05f7b475e vendor: add yaml dependencies 2016-04-01 09:36:11 -07:00
802de5f9f8 clientv3: support read conf from file 2016-04-01 09:36:11 -07:00
307cb5167c Merge pull request #4925 from heyitsanthony/wal-dump-lock
etcd-dump-logs: don't try to acquire wal file locks
2016-03-31 22:24:54 -07:00
7fffd6ffd2 etcd-dump-logs: don't try to acquire wal file locks
can now dump logs from a running etcd instance
2016-03-31 21:51:20 -07:00
c43910f835 Merge pull request #4910 from gyuho/compact_test
etcd-tester: no error for compact double-send
2016-03-31 21:43:26 -07:00
bdaba136a9 Merge pull request #4915 from heyitsanthony/hash-barrier
etcdserver: force backend commit before acking physical compaction
2016-03-31 21:36:57 -07:00
f9b90e13ac etcd-tester: no error for compact double-send
When compactKV request is halted before final acknowledgement,
it used to just continue on the next endpoint. But there could be
a case than compactKV is requested twice, and the first one is already
replicated and applied by the time the second request was to be
applied (returning compact revision error). This skips the case
by parsing the error message.
2016-03-31 21:29:02 -07:00
81de5648d9 etcdserver: force backend commit before acking physical compaction 2016-03-31 21:25:40 -07:00
2f785015a5 Merge pull request #4922 from gyuho/ctl_test
e2e: basic v3 watch test
2016-03-31 18:18:29 -07:00
b98f67095e e2e: add basic v3 watch test 2016-03-31 18:04:14 -07:00
d898c68f2c pkg/expect: add SendLine for interactive mode 2016-03-31 15:34:30 -07:00
1d698f093f Merge pull request #4921 from xiang90/tls
*: move baisc tls util funcs to tlsutil pkg
2016-03-31 09:59:25 -07:00
eb3919e8cf *: move baisc tls util funcs to tlsutil pkg 2016-03-31 09:45:45 -07:00
de801b500b Merge pull request #4920 from mitake/auth-user-password
*: support changing password in v3 auth
2016-03-30 23:45:50 -07:00
73166b41e9 *: support changing password in v3 auth
This commit adds a functionality for updating password of existing
users.
2016-03-31 15:28:15 +09:00
f328c75ba7 Merge pull request #4919 from gyuho/expects
*: ctl v3 tests with multi expects
2016-03-30 22:23:21 -07:00
a6c6bbd81c e2e: ctl tests with multi expects 2016-03-30 22:09:23 -07:00
324afd7fde Merge pull request #4918 from mitake/auth-user-messages
etcdctl: print messages for successful auth operations
2016-03-30 22:03:14 -07:00
2ad9b5692f etcdctl: print messages for successful auth operations
This commit lets etcdctl v3 follow the manner of etcdctl v2.
2016-03-31 13:56:01 +09:00
59bb65182a Merge pull request #4917 from mitake/auth-user-delete
*: support deleting user in v3 auth
2016-03-30 21:36:17 -07:00
d8888ded12 *: support deleting user in v3 auth
This commit adds a functionality of user deletion. It can be invoked
with the new user delete command.

Example usage:
$ ETCDCTL_API=3 etcdctl user delete usr1
2016-03-31 13:18:51 +09:00
93c3f920ca Merge pull request #4909 from heyitsanthony/pkg-expect
e2e: replace gexpect with simpler expect
2016-03-30 15:36:41 -07:00
eb3351533a godep: remove gexpect 2016-03-30 15:14:24 -07:00
5022dce31a e2e: use pkg/expect 2016-03-30 15:14:24 -07:00
5707f6b997 pkg/expect: add expect package 2016-03-30 15:14:24 -07:00
b539d3a411 test: check formatting for all relevant packages in pkg/ 2016-03-30 15:14:24 -07:00
6cf198d1b1 Merge pull request #4911 from heyitsanthony/physical-already
etcdserver, storage: wait for physical compaction if already compacted
2016-03-30 14:27:21 -07:00
7b37bd332c etcdserver, storage: wait for physical compaction if already compacted 2016-03-30 13:59:52 -07:00
7ce5c2b9ff Merge pull request #4902 from heyitsanthony/alarm-ctl
etcdctl: alarm command
2016-03-30 13:55:29 -07:00
14f146b9f7 Merge pull request #4908 from xiang90/c
*: simplify consistent index handling
2016-03-30 13:53:21 -07:00
eddc741b5e *: simplify consistent index handling 2016-03-30 13:38:28 -07:00
2aca3252e8 etcdctl: alarm command 2016-03-30 13:33:52 -07:00
c91b2d098d clientv3: AlarmList and AlarmDisarm 2016-03-30 13:33:52 -07:00
dd5b73cfee alarms: support Get of all alarms 2016-03-30 13:33:52 -07:00
cd02cef5e9 etcdserver: only warn on new and disarmed alarms
listing alarms was generating warning output
2016-03-30 13:33:52 -07:00
0f64e01f6b Merge pull request #4864 from cdancy/patch-1
Update libraries-and-tools.md
2016-03-30 13:02:09 -07:00
4e2a4b17b5 Documentation: add etcd-rest to libraries-and-tools.md
Add link to the etcd-rest client under the 'Java libraries' sub-section.

Fixes #4906
2016-03-30 15:56:20 -04:00
a5172974da Merge pull request #4863 from heyitsanthony/ft-check-compact
etcd-tester: check compaction revision
2016-03-30 10:08:05 -07:00
1eb375d296 Merge pull request #4880 from gyuho/drain
*: drain http.Response.Body before closing
2016-03-30 10:02:52 -07:00
1bee31a3bb Merge pull request #4905 from gyuho/vendor_doc
*: document client package vendoring guide
2016-03-30 10:02:32 -07:00
4c65f3fe7a etcd-tester: check compaction revision
Faster than waiting 30 seconds between rounds.
2016-03-30 09:45:30 -07:00
4b35cb9462 etcdserver, storage: optionally wait for Compaction completion in RPC 2016-03-30 09:45:30 -07:00
a42d1dc1fe *: drain http.Response.Body before closing 2016-03-30 09:35:47 -07:00
b8d3b15206 *: document client package vendoring guide 2016-03-30 09:34:41 -07:00
12d8d33a1c Merge pull request #4879 from mitake/auth-user-error
etcdserver: return internal error in a case of not auth specific errors
2016-03-30 08:04:41 -07:00
8ee8d755bb etcdserver: return internal error in a case of not auth specific errors 2016-03-30 23:44:22 +09:00
443c677357 etcdserver: extract togRPCError() to a separated file
It is used from multiple files in v3rpc package.
2016-03-30 22:53:20 +09:00
96ee00a322 etcdserverpb: make alarm memberId uint64
To be consistent with Cluster API
2016-03-29 20:15:39 -07:00
2deed74494 Merge pull request #4901 from heyitsanthony/config-dbsize
etcdserver: configurable backend size quota
2016-03-29 18:55:12 -07:00
9b2c963179 etcdserver: configurable backend size quota
Configurable with the flag --experimental-quota-backend-bytes and
through ServerConfig.QuotaBackendBytes.

Fixes #4894
2016-03-29 18:39:25 -07:00
b0956d5dbf Merge pull request #4891 from mitake/auth-prefix
*: add Auth prefix to auth related requests and responses
2016-03-29 17:24:12 -07:00
d00811428d Merge pull request #4898 from gyuho/context_err
client: return context error
2016-03-29 17:22:40 -07:00
8d0d10cce5 client: return original ctx error
Fix https://github.com/coreos/etcd/issues/3209.
2016-03-29 16:57:48 -07:00
00f222ecad Merge pull request #4892 from gyuho/help
etcdmain: add missing flag doc
2016-03-29 10:30:33 -07:00
870b5c5ea7 Merge pull request #4219 from endocode/kayrus/username_environment
Handle ETCDCTL_USERNAME environment
2016-03-29 10:24:43 -07:00
720502b25f etcdctl: Handle ETCDCTL_USERNAME environment 2016-03-29 19:06:31 +02:00
92f4aced25 etcdmain: add peer-auto-tls doc 2016-03-29 09:40:57 -07:00
bb8619f4f7 Merge pull request #4895 from xiang90/client_doc
client: doc that client is thread-safe
2016-03-29 09:36:01 -07:00
9d49d35090 client: doc that client is thread-safe 2016-03-29 09:28:53 -07:00
d533c14881 Merge pull request #4876 from heyitsanthony/integration-races
*: fix races from clientv3/integration tests
2016-03-29 09:10:53 -07:00
75babb82b6 Merge pull request #4888 from xiang90/fix_raft
rafthttp: do not block on proposal
2016-03-29 07:37:18 -07:00
161bc5e19c clientv3: fix race when setting grpc Logger
grpc only permits SetLogger on init()
2016-03-28 23:30:03 -07:00
987568c65c *: add Auth prefix to auth related requests and responses 2016-03-29 14:32:19 +09:00
1637b37132 Merge pull request #4890 from heyitsanthony/fix-4889
clientv3/integration: get quorum before watching in TestKVCompact
2016-03-28 22:30:58 -07:00
096abb3f37 clientv3/integration: get quorum before watching in TestKVCompact
Fixes #4889
2016-03-28 22:18:10 -07:00
660eef8a95 Merge pull request #4872 from ajityagaty/cli_opts_aliases
etcdctl: Add aliases for command flags.
2016-03-28 22:04:00 -07:00
0c137b344b rafthttp: do not block on proposal 2016-03-28 21:40:12 -07:00
2e3856740d etcdctl: Add aliases for command flags.
Add aliases to the flags that are supplied to the sub commands.
2016-03-28 20:57:34 -07:00
c53380cd2a Merge pull request #4886 from heyitsanthony/move-hash
v3rpc: move Hash RPC to Maintenance service
2016-03-28 19:35:03 -07:00
3fbacf4be2 v3rpc: move Hash RPC to Maintenance service 2016-03-28 17:15:58 -07:00
495bef8b4c Merge pull request #4885 from xiang90/log_doc
doc/dev: add logging doc
2016-03-28 17:00:41 -07:00
4bdfc0a46d clientv3: fix race on writing watch channel over return channel
Found in TestElectionFailover
2016-03-28 16:08:18 -07:00
5ee85bea7c v3rpc: fix race on watch progress map
Found in TestElectionWait
2016-03-28 16:08:18 -07:00
813afc3d11 rafthttp: fix race between AddRemote and Send 2016-03-28 16:08:18 -07:00
91dc6b29a6 clientv3/integration: fix race when setting progress report interval 2016-03-28 16:08:18 -07:00
2c83362e63 clientv3: fix race in KV reconnection logic 2016-03-28 16:08:18 -07:00
e129223dbe clientv3: fix race in watcher resume 2016-03-28 16:08:18 -07:00
47db0a2f2e test: add race detection to clientv3 integration tests 2016-03-28 16:08:18 -07:00
ffc7488af2 doc/dev: add logging doc 2016-03-28 15:34:51 -07:00
6e3a0948e4 Merge pull request #4868 from heyitsanthony/api-quota
etcdserver: storage quotas
2016-03-28 15:15:57 -07:00
a403a94d7b etcdserver: cap new keys on space alarm 2016-03-28 14:56:26 -07:00
9e7f47c490 etcdserver: Alarm RPC
Alarms are events that nodes can use to relay health information to
the rest of the cluster. A node may Activate an alarm and that alarm
will stay set until Deactivated.
2016-03-28 14:56:26 -07:00
ae077a2183 backend: add UnsafeForEach to BatchTx
Useful for efficiently iterating over an entire bucket.
2016-03-28 14:56:26 -07:00
9c8253c543 etcdserver, v3rpc: space quotas 2016-03-28 14:56:26 -07:00
fc346041e5 Merge pull request #4883 from heyitsanthony/fix-4874
integration: don't call rand.Intn in TestSTMConflict on 0
2016-03-28 13:36:19 -07:00
94e77cfa5d etcdserver: move v3 raft apply functions to interface 2016-03-28 13:16:21 -07:00
384c3ec907 integration: don't call rand.Intn in TestSTMConflict on 0
Fixes #4874
2016-03-28 13:06:07 -07:00
2b83d9c2e5 Merge pull request #4882 from xiang90/ctl_combine
*: combine etcdctl and etcdctlv3
2016-03-28 11:42:25 -07:00
87d9f06a45 *: combine etcdctl and etcdctlv3 2016-03-28 11:28:05 -07:00
83ada7232a Merge pull request #4871 from gyuho/windows_file_lock_20160326
pkg/fileutil: lock file on Windows
2016-03-27 12:38:38 -07:00
fa98d8d337 Merge pull request #4845 from mitake/auth-user
*: support adding user in v3 auth
2016-03-27 07:51:10 -07:00
8874545a1e *: support adding user in v3 auth
This commit adds a new subcommand "user add" to etcdctlv3. With the
command users can create a user for the authentication.

Example of usage:
$ etcdctlv3 user add user1
Password of user1:
Type password of user1 again for confirmation:
2016-03-27 18:11:42 +09:00
3f1a1c3192 pkg/fileutil: lock file on Windows 2016-03-27 00:35:44 -07:00
68b38e7ade Merge pull request #4875 from gyuho/clientv3_disable_grpclog
clientv3: disable client side grpc log
2016-03-26 22:57:37 -07:00
29fccb3221 clientv3: configurable grpc logger 2016-03-26 22:38:53 -07:00
b8fc61bcec Merge pull request #4869 from ajityagaty/insecure_skip_tls_verify
etcdctlv3: Add insecure-skip-tls-verify flag.
2016-03-26 12:12:55 -07:00
9c3242c6df Merge pull request #4862 from mitake/procfiles
Procfile, V3DemoProcfile: add default endpoint of v3 to Procfile remo…
2016-03-26 08:21:01 -07:00
7418c1af24 V3DemoProcfile: remove the obsolete flag
The flag --experimental-v3demo is already removed so V3DemoProcfile
cannot be used. This commit removes it.
2016-03-26 08:15:58 -07:00
4e39db4158 etcdctlv3: Add insecure-skip-tls-verify flag.
The user can specify insecure-skip-tls-verify flag to skip the
server certificate verification step.
2016-03-25 19:28:41 -07:00
877030ea9d pkg/fileutil: fix linux file locks over NFS
Fixes #4853
2016-03-25 16:28:29 -07:00
36db6cd982 Merge pull request #4867 from xiang90/ctl_env
etcdctlv3: accept evn for global configuration flags
2016-03-25 15:32:06 -07:00
a120ca16c0 etcdctlv3: accept evn for global configuration flags 2016-03-25 14:23:32 -07:00
92a73e727b Merge pull request #4857 from xiang90/warn_tls
etcdmain: warn on contradictory TLS settings
2016-03-25 09:38:11 -07:00
5449edc025 Merge pull request #4817 from mqliang/time-out
etcdctlv3: add timeout support
2016-03-25 07:30:48 -07:00
f165f8b44e etcdctlv3: add timeout support
add timeout setting support for etcdctlv3
2016-03-25 16:24:49 +08:00
20a267dc6a Merge pull request #4860 from heyitsanthony/tester-sched
tools/functional-tester: --schedule-cases flag
2016-03-24 22:05:05 -07:00
4a17097d00 tools/functional-tester: --schedule-cases flag
Command line argument for specifying a schedule of test cases per round.
Default is run each test case once each round.
2016-03-24 19:43:23 -07:00
05dc2dac70 Merge pull request #4859 from xiang90/ctl_secure
etcdctlv3: support secure connection without key/cert
2016-03-24 16:47:23 -07:00
0865688c27 etcdctlv3: support secure connection without key/cert 2016-03-24 16:29:33 -07:00
6285455f85 etcdmain: warn on contradictory TLS settings 2016-03-24 10:21:47 -07:00
7d2545c72e Merge pull request #4856 from xiang90/fail_key_cert
etcdmain: etcd should fail to start when https is enabled but tls con…
2016-03-24 10:10:43 -07:00
5ee3729738 etcdmain: etcd should fail to start when https is enabled but tls config is not given 2016-03-24 09:57:25 -07:00
d16bfa5e54 Merge pull request #4854 from mitake/genproto
scripts: update genproto.sh for vendor
2016-03-24 08:53:55 -07:00
d0d3b32210 Merge pull request #4850 from xiang90/rm_demo
*: enable v3 by default
2016-03-23 23:48:29 -07:00
0436223793 scripts: update genproto.sh for vendor
Current genproto.sh assumes Godep so its output files have obsolete
parts.
2016-03-24 14:30:46 +09:00
70a9391378 *: enable v3 by default 2016-03-23 17:01:36 -07:00
2fec88ebfc Merge pull request #4851 from gyuho/fix_functional_tester
functional-tester: add GRPCURLs for cluster config
2016-03-23 16:47:33 -07:00
9fb60deb7c functional-tester: add GRPCURLs for cluster config
GRPC and v2 client address share the same host(port)
but GRPC does not work with schema specified. This fixes
it by adding another member for GRPC without schema, as
we had before.
2016-03-23 16:28:05 -07:00
333ac5789a Merge pull request #4831 from xiang90/tlx
*: http and https on the same port
2016-03-23 15:59:58 -07:00
e4ac8edb2f Merge pull request #4849 from gyuho/functional_test
functional-tester: set gRPC endpoint for stresser
2016-03-23 15:32:14 -07:00
4d2227e5ab e2e: combine cfg.isClientTLS and cfg.isClientBoth 2016-03-23 15:30:58 -07:00
012143e703 functional-tester: set gRPC endpoint for stresser 2016-03-23 15:23:19 -07:00
9d55420a00 e2e: add an e2e test for TLS/non-TLS on the same port 2016-03-23 13:43:47 -07:00
ca5dff6682 Merge pull request #4848 from heyitsanthony/rename-compare-created
clientv3: rename comparison from CreatedRevision to CreateRevision
2016-03-23 10:32:49 -07:00
900a61b023 *: http and https on the same port 2016-03-23 10:28:38 -07:00
489779d905 clientv3: rename comparison from CreatedRevision to CreateRevision
To match protobuf naming
2016-03-23 09:50:46 -07:00
88e738fcb6 Merge pull request #4844 from ajityagaty/polish_naming_conventions
clientv3: Renaming SortByCreatedRev to maintain consistency.
2016-03-23 09:27:34 -07:00
0181725e55 Merge pull request #4846 from jonboulle/master
docs: "master election" -> "leader election"
2016-03-23 09:27:08 -07:00
6081a29c13 Merge pull request #4843 from heyitsanthony/go-vendor
*: migrate Godeps to vendor/
2016-03-23 06:01:26 -07:00
5f72a28157 docs: "master election" -> "leader election" 2016-03-23 12:23:01 +01:00
86a477c2f6 doc: update client README to use vendor/ 2016-03-22 18:02:10 -07:00
2f22ac662c travis: use GO15VENDOREXPERIMENT 2016-03-22 18:02:10 -07:00
2bb417bfff clientv3: Renaming SortByCreatedRev to maintain consistency.
Renamed SortByCreatedRev to SortByCreateRevision to be consistent
with the naming used for SortByModRevision.
2016-03-22 17:56:24 -07:00
45cf31650c test: ignore vendor/ directory on license check 2016-03-22 17:33:46 -07:00
fb3510b276 build: enable vendor experiment for go1.5 2016-03-22 17:33:46 -07:00
bd832e5b0a *: migrate Godeps to vendor/ 2016-03-22 17:10:28 -07:00
e9b9b228e7 Merge pull request #4842 from gyuho/serial
etcdctlv3: get command with consistency flag
2016-03-22 17:07:29 -07:00
a10662210a e2e: etcdctlv3 with serializable read 2016-03-22 16:52:33 -07:00
5686340d26 etcdctlv3: get command with consistency flag
As we do in benchmark tool.
2016-03-22 16:52:28 -07:00
096a89117a Merge pull request #4840 from ajityagaty/polish_naming_conventions
clientv3: Fix inconsistent naming convention in v3 client.
2016-03-22 15:27:12 -07:00
70e709c5f4 Merge pull request #4812 from xiang90/ping
etcdctlv3: implement endpoint-health command
2016-03-22 15:22:53 -07:00
43221f0b7a etcdctlv3: implement endpoint-health command
endpoint-health checks endpoint.

It can generate 3 outputs:

1. cannot connect to the member through endpoint

2. connected to the member, but member failed to commit any proposals

3. connected to the member, and member committed a proposal
2016-03-22 15:09:50 -07:00
606889a002 clientv3: Fix inconsistent naming convention in v3 client.
In order to have a consistent naming for variable/function names
pertaining to ModifiedRevision, all occurrences have been renamed
to ModRevision.
2016-03-22 14:58:11 -07:00
499b893704 Merge pull request #4838 from gyuho/dial
etcdctlv3: add dial timeout flag
2016-03-22 13:26:19 -07:00
8396da3e83 etcdctlv3: add dial timeout flag
Fix https://github.com/coreos/etcd/issues/4836.
2016-03-22 13:15:26 -07:00
2b44df5440 Merge pull request #4833 from gyuho/govet
etcdmain: fix shadowed variables
2016-03-22 10:01:31 -07:00
565eb61cd3 Merge pull request #4834 from gyuho/godep_pb
Godeps: semantic versioning cheggaaa/pb
2016-03-22 09:09:58 -07:00
a054ae320b Merge pull request #4830 from mischief/proxy-env
pkg/transport: use ProxyFromEnvironment when constructing a transport
2016-03-22 01:14:03 -07:00
afb1bc242b Merge pull request #4822 from mitake/auth-backend
auth, etcdserver: add a method for updating backend during apply snap…
2016-03-21 23:34:46 -07:00
4e39f690f2 auth, etcdserver: add a method for recoverying from backend during apply snapshot
This commit adds a new method Recovery() to auth.AuthStore for
recoverying auth state from backend during apply snapshot. It follows
a manner of the lessor.
2016-03-22 15:17:40 +09:00
bb9a7f5a7c Godeps: semantic versioning cheggaaa/pb
Fix https://github.com/coreos/etcd/issues/4832.
2016-03-21 22:06:16 -07:00
2364d71ea2 etcdmain: fix shadowed variables 2016-03-21 21:55:06 -07:00
d80a546ed4 pkg/transport: use ProxyFromEnvironment when constructing a transport
this allows use of HTTP_PROXY/HTTPS_PROXY for etcdctl.
2016-03-21 21:02:42 -07:00
e73ac5bdd7 Merge pull request #4826 from philips/buildv3-by-default
build: build etcdctlv3 by default
2016-03-21 17:04:11 -07:00
0ac4eba60e Merge pull request #4829 from gyuho/server_closure
etcdmain: fix blocking m.Server closure
2016-03-21 16:50:13 -07:00
cdb7cfd74b etcdmain: fix blocking m.Server closure 2016-03-21 16:39:20 -07:00
7e3fc182d5 Merge pull request #4828 from xiang90/cmux
*: gRPC + HTTP on the same port
2016-03-21 15:37:44 -07:00
7c3432a79f Godep: add cmux dependency 2016-03-21 14:33:37 -07:00
d3809abe42 *: gRPC + HTTP on the same port
We use cmux to do this since we want to do http+https on the same
port in the near future too.
2016-03-21 14:29:25 -07:00
adebd91114 Merge pull request #4785 from heyitsanthony/gce-fallocate
wal: extend WAL file to segment size on fallocate
2016-03-21 13:08:53 -07:00
3fed78ae7b Merge pull request #4484 from heyitsanthony/auto-tls
automatic peer TLS
2016-03-21 12:59:29 -07:00
0df732c052 wal: pre-create segment files
Pipeline file creation and allocation so it overlaps writes to the log.

Fixes #4773
2016-03-21 11:56:53 -07:00
24b806d2ee wal: preallocate WAL files with initial size equal to segment size
Avoids having to update file size metadata during fdatasync on common path.

Fixes #4755
2016-03-21 11:56:53 -07:00
8f653572ac Merge pull request #4827 from xiang90/fix_ctl
etcdctlv3: use godep dir for tablewriter dependency
2016-03-21 11:50:40 -07:00
5a0bb40a41 etcdctlv3: use godep dir for tablewriter dependency 2016-03-21 11:47:55 -07:00
d1ee12566b e2e: test auto tls 2016-03-21 11:44:14 -07:00
7d2aee8eca build: build etcdctlv3 by default
Any reason not to? It makes demoing etcd easier with the V3 procfile.
2016-03-21 11:42:01 -07:00
c8c0c728a0 Merge pull request #4825 from gyuho/key_link
Documentation: add public key link to release doc
2016-03-21 11:39:45 -07:00
e9b2bd751d etcdmain: add --peer-auto-tls option
Lets the peer generate its own (unsigned) certs.
2016-03-21 11:38:23 -07:00
a69c709839 pkg/transport: generate certs 2016-03-21 11:38:23 -07:00
86164374ef Merge pull request #4824 from gyuho/dash
*: replace '-' with '--' in doc
2016-03-21 11:33:22 -07:00
f58d1348a7 Documentation: add public key link to release doc 2016-03-21 11:28:49 -07:00
67c2384bdf *: replace '-' with '--' in doc
Fix https://github.com/coreos/etcd/issues/4595.
2016-03-21 11:12:43 -07:00
aafe717f2f fileutil: support file extending preallocate 2016-03-21 09:42:30 -07:00
7879429a94 Merge pull request #4802 from heyitsanthony/bench-stm
benchmark: STM benchmark
2016-03-20 16:10:54 -07:00
1383da1030 benchmark: STM benchmark 2016-03-20 12:21:29 -07:00
053bc83fe4 Merge pull request #4810 from gyuho/client_serialized_read
clientv3: set Serializable from Op
2016-03-19 14:35:55 -07:00
c740b60db8 Merge pull request #4814 from gyuho/godoc
*: minor updates for godoc
2016-03-19 14:29:48 -07:00
dae7e009b0 *: godoc clean up 2016-03-19 14:19:23 -07:00
0555a6112d Merge pull request #4813 from gyuho/clientv3
clientv3/concurrency: fix godoc
2016-03-18 19:07:54 -07:00
dc9af8e3f3 Merge pull request #4807 from gyuho/go1.4-build
Drop go1.4 support for development
2016-03-18 19:07:44 -07:00
21b33de810 rafthttp: drop go1.4 tests 2016-03-18 18:46:11 -07:00
5bba773199 pkg/testutil: drop go1.4 goroutine leak exception 2016-03-18 18:45:47 -07:00
0a82c06a2c pkg/types: drop go1.4 tests 2016-03-18 18:45:29 -07:00
33e22fa8d7 pkg/httputil: drop go1.4 tests 2016-03-18 18:45:12 -07:00
25e47db416 client: drop go1.4 tests 2016-03-18 18:44:56 -07:00
896cba5cb9 README: go1.5 for Go development 2016-03-18 18:44:40 -07:00
6aa17f0c76 Merge pull request #4775 from heyitsanthony/wal-locks
fileutil, wal: refactor file locking
2016-03-18 18:26:31 -07:00
16270dba4f Merge pull request #4805 from gyuho/drop-go1.4
travis: drop go1.4
2016-03-18 18:24:55 -07:00
4e4f0ab619 clientv3/concurrency: fix godoc 2016-03-18 16:34:58 -07:00
ac9376ea16 *: bump to v2.3.0+git 2016-03-18 16:32:04 -07:00
f38a611b55 clientv3: set Serializable from Op
Fix https://github.com/coreos/etcd/issues/4809.
2016-03-18 15:56:48 -07:00
5badbab8b7 travis: drop go1.4
Fix https://github.com/coreos/etcd/issues/4790.
2016-03-18 13:33:12 -07:00
5e6eb7e19d Merge pull request #4788 from gyuho/release_doc
Documentation: release with project key
2016-03-18 09:49:54 -07:00
3c1dbdef64 Merge pull request #4801 from gyuho/version_2_3
version: bump to 2.3
2016-03-18 09:46:07 -07:00
7d5cedbf34 version: bump to 2.3 2016-03-18 09:44:54 -07:00
a57712f105 Merge pull request #4800 from gyuho/version
Documentation: update ROADMAP with version 2.3
2016-03-18 09:43:39 -07:00
165c164780 Documentation: update ROADMAP with version 2.3 2016-03-18 09:41:16 -07:00
7b77984c99 Merge pull request #4782 from gyuho/upgrade_to_2.3
Documentation: upgrade to 2.3
2016-03-18 09:38:54 -07:00
f59a866fcb Merge pull request #4795 from xiang90/table
etcdctlv3: make member list beautiful
2016-03-17 16:10:35 -07:00
56d7899c20 etcdctlv3: member list now supports json 2016-03-17 15:54:44 -07:00
c37cd1f0a1 etcdctlv3: make member list beautiful 2016-03-17 14:49:53 -07:00
58c8521920 Merge pull request #4792 from heyitsanthony/snip-snip
clientv3: break etcdserver dependency
2016-03-17 12:24:54 -07:00
a001651bc1 clientv3: remove dependency on lease package 2016-03-17 11:52:34 -07:00
44753594ec v3rpc: move errors to v3rpc/rpctypes
Fixes #4771
2016-03-17 11:52:34 -07:00
ef135d52ad Merge pull request #4793 from gyuho/proxy_doc
Documentation: discovery-fallback flag to proxy.md
2016-03-17 11:37:25 -07:00
ded41fa16e Documentation: discovery-fallback flag to proxy.md 2016-03-17 11:33:49 -07:00
f491110c5b test: check clientv3 has no dependency on etcdserver or storage packages 2016-03-17 11:31:14 -07:00
3e6678a1f6 Documentation: release doc using etcd project key 2016-03-17 11:22:09 -07:00
179dc72fa7 Merge pull request #4791 from xiang90/l
integration: add TestV3LeaseFailover test
2016-03-17 10:47:32 -07:00
e6c39108a7 integration: add TestV3LeaseFailover test 2016-03-17 10:17:51 -07:00
cc9aabda05 Merge pull request #4783 from xiang90/fix_4753
raft: add optimization notes
2016-03-17 09:58:31 -07:00
f5e60c0e18 raft: add optimization notes 2016-03-17 09:53:50 -07:00
5d256b7b86 rafthttp: pause peer should also pause its reader 2016-03-17 09:43:02 -07:00
0207f3986e Merge pull request #4787 from coreos/xiang90-patch-1
doc: remove exp note for auth api
2016-03-16 19:04:44 -07:00
c73e02354d doc: remove exp note for auth api 2016-03-16 18:51:14 -07:00
7397e14c0a fileutil, wal: refactor file locking
File lock interface was more verbose than it needed to be while
simultaneously making it difficult to support systems (e.g., Windows)
that only permit locked writes on a single fd holding the lock.
2016-03-16 15:02:15 -07:00
e97bb3f3a1 Documentation: upgrade to 2.3 2016-03-16 12:34:33 -07:00
6b65c0f786 Merge pull request #4760 from heyitsanthony/clientv3-stm
clientv3/concurrency: STM
2016-03-16 11:44:12 -07:00
bc37a32062 clientv3/concurrency: software transactional memory
Repeatable read and serialized read STM implementations.
2016-03-16 11:23:06 -07:00
724bab110d Merge pull request #4781 from gyuho/csv
bench/cmd: print csv-format timeseries
2016-03-16 11:14:39 -07:00
58792ca59b bench/cmd: print csv-format timeseries 2016-03-16 11:06:36 -07:00
a2569c77de Merge pull request #4779 from xiang90/cq
etcdserver: leader should stepdown when lose quorum for v3
2016-03-16 09:09:05 -07:00
4610faf15e Merge pull request #4777 from mqliang/member-leaderinfo
show leader/member information when run 'etcdctl member list' command
2016-03-15 23:26:46 -07:00
2a28ac7ad4 etcdserver: leader should stepdown when lose quorum for v3 2016-03-15 23:23:26 -07:00
a7f6dc6c0d Merge pull request #4778 from xiang90/lease_promote
*: refresh the lease TTL correctly when a leader is elected.
2016-03-15 22:52:33 -07:00
d8c315ab55 etcdctl: show leader/member information when run 'etcdctl member list' command
leader/follower information is very helpful for debugging. User must get this information through http endpoint
before this patch, which is inconvenient.
2016-03-16 13:48:37 +08:00
e9a0a103e5 *: refresh the lease TTL correctly when a leader is elected.
The new leader needs to refresh with an extened TTL to gracefully handle
the potential concurrent leader issue. Clients might still send keep alive
to old leader until the old leader itself gives up leadership at most after
an election timeout.
2016-03-15 22:40:03 -07:00
c7a7dfdc9a Merge pull request #4772 from xiang90/bk
storage: support seq put to make db more compact
2016-03-15 16:48:12 -07:00
d883d5acd3 storage: support seq put to make db more compact 2016-03-15 16:36:36 -07:00
b56c2e017c Merge pull request #4770 from hongchaodeng/master
refactor recorder-based mock objects into separate packages
2016-03-15 15:53:36 -07:00
dcaf5ef586 move store recorder to 'mock/mockstore' 2016-03-15 15:41:07 -07:00
bae053f57f Merge pull request #4768 from xiang90/ctl
etcdctlv3: get support fromkey
2016-03-15 12:28:34 -07:00
a24aade667 etcdctlv3: add from-key flag for get command 2016-03-15 12:08:54 -07:00
6a6fe452ee Merge pull request #4766 from gyuho/sample
benchmark: move sample flag to root command
2016-03-15 11:09:00 -07:00
c9e4e2b6dc benchmark: move sample flag to root command
Sample is configuration for reports. This should be
flag at top command.
2016-03-15 10:36:27 -07:00
323687e1f1 Merge pull request #4763 from gyuho/real_latency
benchmark: printSecondSample with time series
2016-03-15 08:39:38 -07:00
5eefff12e1 benchmark: printSecondSample with time series 2016-03-15 08:35:03 -07:00
1d4febd16e Merge pull request #4764 from siddontang/master
etcdctlv3/command: add with-prefix flag for get
2016-03-14 22:22:41 -07:00
683274b201 etcdctlv3/command: add prefix flag for get 2016-03-15 12:54:13 +08:00
2aa635ea39 Merge pull request #4761 from heyitsanthony/txn-noninteractive
etcdctlv3: define non-interactive txn format to match interactive input
2016-03-14 14:04:18 -07:00
d1ece7d621 Merge pull request #4762 from gyuho/typo
benchmark: minor typos
2016-03-14 13:56:32 -07:00
a932674a5b benchmark: minor typos 2016-03-14 13:45:08 -07:00
4bbbb52892 etcdctlv3: define non-interactive txn format to match interactive input
Fixes #4559
2016-03-14 13:36:18 -07:00
58c92ee41b Merge pull request #4758 from xiang90/sync
wal: do not call fsync when it is not necessary
2016-03-14 11:58:16 -07:00
53e7ddbc66 wal: do not call fsync when it is not necessary 2016-03-14 11:52:06 -07:00
3b1aa1c93d Merge pull request #4714 from mitake/v3-auth-enable
etcdserver, storage: new storage interface AuthStore
2016-03-13 22:11:04 -07:00
4eb1cfd658 etcdserver, auth: new package auth for the auth feature
This commit adds a new package auth. Its role is persisting auth
related metadata. This commit also connects its main interface
AuthStore and v3 server.
2016-03-14 13:57:41 +09:00
de03dbf632 Merge pull request #4757 from xiang90/mm
clientv3: fix mirror and add integration test
2016-03-13 18:42:19 -07:00
fc49eeccae Merge pull request #4756 from coreos/xiang90-patch-1
Readme: adding gocard
2016-03-13 18:41:04 -07:00
22065fe334 clientv3: fix mirror and add integration test 2016-03-13 18:27:45 -07:00
25612169dd Readme: adding gocard
Gocard includes most of the go style checking tools that we care about. This is a good indicator for us.
2016-03-13 18:14:00 -07:00
a343b800b5 Merge pull request #4754 from xiang90/fdatasync
wal: support fadatasync on linux
2016-03-13 18:07:43 -07:00
e59efe45a1 wal: support fadatasync on linux 2016-03-13 17:22:53 -07:00
bab8f43cb0 Merge pull request #4726 from ajityagaty/mk_in_order
etcdctl: Add command to create in-order keys.
2016-03-13 10:15:42 -07:00
7a1fbefb2c Merge pull request #4753 from xiang90/leader_par
etcdserver: leader latency optimization
2016-03-13 09:55:40 -07:00
0f9d04237c etcdserver: leader latency optimization 2016-03-12 22:51:13 -08:00
c0a424c1d0 Merge pull request #4752 from aboyett/auth-doc-fix
authentication.md: fix formatting of fenced code block
2016-03-11 22:34:48 -08:00
3a3ddaa195 authentication.md: fix formatting of fenced code block
Add a missing blank line to one of the fenced code blocks in the
"Working with roles" section to conform with the formatting best
practice recommended in the GitHub guide "Creating and highlighting code
blocks"[1]:

> We recommend placing a blank line before and after code blocks to make
> the raw formatting easier to read.

The missing blank line prior to the code block causes incorrect HTML
rendering of this section within the CoreOS etcd Authentication
Guide[2]. This commit fixes the problem, but the underlying issue seems
to be a quirk of the markdown render used for the CoreOS documentation
pages, as the same markdown source does not exhibit the issue when
viewed on GitHub[3] or viewed through the python markdown module.

[1] https://help.github.com/articles/creating-and-highlighting-code-blocks/
[2] https://coreos.com/etcd/docs/2.2.5/authentication.html
[3] https://github.com/coreos/etcd/blob/v2.2.5/Documentation/authentication.md
2016-03-11 18:44:39 -08:00
d0a780f248 Merge pull request #4751 from xiang90/doc
doc: fix refresh section in api.md
2016-03-11 09:51:35 -08:00
84d2c1e7b0 doc: fix refresh section in api.md 2016-03-11 09:49:25 -08:00
ef0c8e5c18 etcdctl: Add an option to mk command to create in-order keys.
Adding a new option to the mk command to create in-order keys
under a given directory, identified by <key> argument. Optionally
TTL can also be set on the newly created in-order key.
2016-03-10 20:28:28 -08:00
9f2061ce71 Merge pull request #4748 from xiang90/t
etcdserver: remove todo
2016-03-10 19:41:02 -08:00
c6192d1d7a etcdserver: remove todo 2016-03-10 19:10:20 -08:00
47848bc2aa Merge pull request #4747 from xiang90/re
*: recover lessor when applying snapshot
2016-03-10 19:04:04 -08:00
adcba975cb *: recover lessor when applying snapshot 2016-03-10 17:06:58 -08:00
ae7e2c3203 Merge pull request #4743 from xiang90/doc
doc: add v3 data model
2016-03-10 15:36:33 -08:00
6a3e8d4bde doc: add v3 data model 2016-03-10 15:16:05 -08:00
cd6c1190b5 Merge pull request #4739 from heyitsanthony/e2e-tempdir
e2e: put etcd datadir in golang tempdir
2016-03-10 11:58:03 -08:00
bb45bb84c4 Merge pull request #4742 from xiang90/update_b
godeps: update boltdb dependency
2016-03-10 11:55:11 -08:00
b353372090 godeps: update boltdb dependency 2016-03-10 11:45:04 -08:00
4a6c06db13 e2e: put etcd datadir in golang tempdir
The command "TMPDIR=/mnt/myramdisk/etcd go test -v" was making data
directories in pwd instead of the tmpdir.
2016-03-10 11:12:08 -08:00
534a16f2a2 Merge pull request #4741 from xiang90/defrag_c
*: add client.defrag and defrag cmd for etcdctl
2016-03-10 10:29:01 -08:00
7c377fa703 *: add client.defrag and defrag cmd for etcdctl 2016-03-10 09:30:41 -08:00
0c41371064 Merge pull request #4738 from xiang90/shrink_rpc
etcdserver: add maintain service to support defrag
2016-03-09 22:50:59 -08:00
2f12ea893b etcdserver: add maintain service to support defrag 2016-03-09 22:29:21 -08:00
a44645e13d etcdserver: align 64-bit atomics on 8-byte boundary 2016-03-10 07:24:33 +02:00
a243f80c80 Merge pull request #4736 from heyitsanthony/fix-setdir-help
etcdctl: clarify setdir purpose in help message
2016-03-09 14:52:40 -08:00
edafbe9555 etcdctl: clarify setdir purpose in help message
Fixes #4640
2016-03-09 14:38:57 -08:00
6343410e24 Merge pull request #4735 from xiang90/fix_write
clientv3/integration: fix TestTxnWriteFail
2016-03-09 14:30:30 -08:00
3886129f52 clientv3/integration: fix TestTxnWriteFail
It might take client request more than dialtimeout to fail when
we kill the connection when the client is sending request.
2016-03-09 14:03:51 -08:00
6650db53a4 Merge pull request #4733 from heyitsanthony/backend-alignment
storage/backend: align fields used for atomic ops
2016-03-09 11:42:55 -08:00
dd01ab6dc0 storage/backend: align fields used for atomic ops
Fixes crashes on 32-bit tests.
2016-03-09 11:17:27 -08:00
19e39a36f7 Merge pull request #4732 from xiang90/i_future_watch
integration: fix TestV3WatchFutureRevision
2016-03-09 10:20:52 -08:00
73c8dbd459 Merge pull request #4731 from xiang90/backend
backend: fix TestBackendClose by giving more time to wait for io
2016-03-09 10:12:20 -08:00
39d307572e integration: fix TestV3WatchFutureRevision
Fix https://github.com/coreos/etcd/issues/4730.

Previously we put keys async and there might be a race when
the watch triggers before the put receives the response. When that
happens, put might fails to get the response since we shutdown the server
when watch triggers.
2016-03-09 09:55:52 -08:00
86e43b4173 Merge pull request #4729 from xiang90/raft_fix
raft: remove unnecessary waitSchedule in test
2016-03-09 09:45:20 -08:00
6cf4c4b3fd backend: fix TestBackendClose by giving more time to wait for io 2016-03-09 09:44:16 -08:00
f72be5487c Merge pull request #4728 from gyuho/util
pkg/fileutil: clean up interface, comments
2016-03-09 10:35:50 -07:00
22a8bbd3b1 pkg/fileutil: clean up interface, comments 2016-03-09 09:19:56 -08:00
aa59e7518e raft: remove unnecessary waitSchedule in test 2016-03-09 09:18:49 -08:00
a4624666fe Merge pull request #4720 from heyitsanthony/fix-testremovemember
clientv3/integration: do not remove client member in TestMemberRemove
2016-03-08 15:22:33 -08:00
6dd53ec699 Merge pull request #4721 from heyitsanthony/build-scary-archs
*: build phony etcd server binary for unsupported architectures
2016-03-08 14:04:02 -08:00
56fcee7ab0 Merge pull request #4718 from xiang90/v3_api
doc: add v3 api doc
2016-03-08 13:55:36 -08:00
3f83739a51 doc: add v3 api doc 2016-03-08 13:15:06 -08:00
5f304b4dee *: build phony etcd server binary for unsupported architectures
We don't qualify etcdserver for anything other than amd64, so don't
build binaries that are untested and might be unreliable.
2016-03-08 13:12:11 -08:00
e026b79c87 clientv3/integration: do not remove client member in TestMemberRemove
Fixes #4716
2016-03-08 11:55:26 -08:00
f74d732d77 Merge pull request #4717 from joshix/portsnote
README: Add explanation about official vs legacy ports
2016-03-08 10:57:29 -08:00
02975afe37 README: Add explanation about official vs legacy ports
Add a note about 2379/2380 vs 4001/7001. I believe this is as
far as we can go just yet, because we have not fully deprecated
the old ports, and still want to configure them in some instances.

Related #3480.
2016-03-08 10:33:11 -08:00
570775fe61 Merge pull request #4710 from heyitsanthony/clientv3-tlsconfig
clientv3: use tls.Config in clientv3.Config
2016-03-07 16:37:24 -08:00
78132c9b5b clientv3: use tls.Config in clientv3.Config
Fixes #4648
2016-03-07 16:08:40 -08:00
8e203b7bd5 Merge pull request #4711 from heyitsanthony/nuke-invfuturerev-test
clientv3/integration: remove invalid future revision test
2016-03-07 16:07:53 -08:00
969e42c3fa Merge pull request #4704 from gyuho/print_rate
benchmark: change complete notifier first
2016-03-07 16:00:48 -08:00
4eeea5ccda clientv3/integration: remove invalid future revision test
Future revisions are now supported, so test is outdated.
2016-03-07 15:52:34 -08:00
b8912c9fb1 benchmark: change complete notifier first
Fix https://github.com/coreos/etcd/issues/4708.
2016-03-07 14:54:11 -08:00
e29ed898d4 Merge pull request #4707 from heyitsanthony/fix-newmember-comment
etcdserver: update NewMember comment to reflect how id is computed
2016-03-07 14:20:52 -08:00
c666a11f38 etcdserver: update NewMember comment to reflect how id is computed
Fixes #4573
2016-03-07 14:09:53 -08:00
632461cc50 Merge pull request #4706 from heyitsanthony/fix-client-close-deadlock
clientv3: don't deadlock on Close with broken connection
2016-03-07 14:02:12 -08:00
d21d2e6624 clientv3: don't deadlock on Close with broken connection
Fixes #4679
2016-03-07 13:46:54 -08:00
13f853f59b Merge pull request #4705 from xiang90/benchmark
doc: add benchmark result for 2.2
2016-03-07 12:10:52 -08:00
4e6289b829 doc: add benchmark result for 2.2 2016-03-07 12:00:42 -08:00
e9be0415fd Merge pull request #4703 from xiang90/future_watch
*: support watch from future revision
2016-03-07 11:31:12 -08:00
a5c83e4c3e Merge pull request #4696 from heyitsanthony/fix-e2e-quorum
e2e: quorum cleanup
2016-03-07 11:18:15 -08:00
036ed87c6d *: support watch from future revision 2016-03-07 10:57:30 -08:00
b9228180f1 Merge pull request #4701 from gyuho/typo
storage: fix minor typo
2016-03-06 17:07:02 -08:00
50fd9d3b57 storage: fix minor typos 2016-03-06 17:05:02 -08:00
d0f6f49085 e2e: quorum cleanup
If a test gets data without quorum, it should only have one node in the
test cluster to avoid reading stale data.

Fixes #4694
2016-03-05 20:16:07 -08:00
1d15c7dd86 Merge pull request #4693 from heyitsanthony/etcdctl-fix-lists
etcdctl: correctly unmarshal list users and list roles
2016-03-05 20:04:13 -08:00
9809da95da client: correctly unmarshal roles in ListRoles 2016-03-05 19:42:58 -08:00
2a0d64bb4a client: correctly unmarshal users in ListUsers 2016-03-05 19:42:58 -08:00
a31f84121b Merge pull request #4699 from heyitsanthony/fix-barrier
storage: use creation revision to compute txn event types
2016-03-05 19:17:56 -08:00
2868c5587a Merge pull request #4698 from xiang90/fix_w
*: fix watch full key range
2016-03-05 19:10:53 -08:00
713f7c056f storage: use creation revision to compute txn event types
Fixes #4688
2016-03-05 19:03:07 -08:00
633a0bdf55 integration: add test for full range watching 2016-03-05 18:52:41 -08:00
d84811aecf *: fix watch full key range 2016-03-05 14:45:43 -08:00
e93e41cd9a Merge pull request #4643 from gyuho/stress
functional-tester: less intensive stresser
2016-03-05 13:17:19 -08:00
b3f0bcbeb4 functional-tester: less intensive stresser 2016-03-05 13:16:26 -08:00
b83b5307d1 Merge pull request #4695 from gyuho/endpoints
e2e: use endpoints flag
2016-03-05 13:00:00 -08:00
07030d59dd e2e: use endpoints flag 2016-03-05 12:28:31 -08:00
ca05f55a21 Merge pull request #4690 from heyitsanthony/fix-etcdctl-fullroles
client: unmarshal user with full roles into user with role names
2016-03-05 01:31:28 -08:00
e708bc14d7 Merge pull request #4689 from hongchaodeng/master
watch.go: docs on WatchResponse.Canceled
2016-03-04 16:09:16 -08:00
0926a91179 e2e: test granting roles to users 2016-03-04 16:09:01 -08:00
868728e5b5 client: if User unmarshal fails, decode user using full roles
Fixes #3702
2016-03-04 16:02:35 -08:00
5e017e94f9 watch.go: docs on WatchResponse.Canceled 2016-03-04 15:51:00 -08:00
104a3bdc01 Merge pull request #4687 from gyuho/example
clientv3: add IsProgressNotify with example
2016-03-04 15:46:35 -08:00
02d9aa481b etcdctl: accept user:pass format for add user
Otherwise needed an interactive terminal to create a user.
2016-03-04 13:29:06 -08:00
450b586011 clientv3: add IsProgressNotify with example
This makes the test endpoints same as we have in
goreman proc file, and adds 'IsProgressNotify' method
and the 'WatchProgressNotify' code example to godoc.
2016-03-04 12:16:43 -08:00
b73c1223d8 Merge pull request #4638 from gyuho/compact
benchmark: add auto-compact flags
2016-03-04 10:15:02 -08:00
aca29605b5 Merge pull request #4675 from gyuho/bench_watch
benchmark: watch, key-space-size(max possible key)
2016-03-04 10:14:42 -08:00
4097a72c0b Merge pull request #4678 from gyuho/watch_notify_clientv3
clientv3: add WithProgressNotify
2016-03-04 10:08:25 -08:00
ead5d432a3 Merge pull request #4682 from heyitsanthony/clientv3-clientctx
clientv3: include a context in Client
2016-03-04 09:48:37 -08:00
27316196d8 clientv3: add WithProgressNotify
Client side for https://github.com/coreos/etcd/issues/4628.
2016-03-04 09:47:13 -08:00
da0f77dc14 benchmark: measure Put with auto-compact 2016-03-04 09:34:24 -08:00
06f950f614 Merge pull request #4683 from heyitsanthony/recipes-err-handling
contrib/recipes: fix nil dereferences on error paths
2016-03-04 09:32:27 -08:00
360aafec76 clientv3: include a context in Client
Useful for clean up tasks
2016-03-04 09:20:44 -08:00
39109b8b53 contrib/recipes: fix nil dereferences on error paths 2016-03-04 00:38:35 -08:00
3b185f130a Merge pull request #4680 from xiang90/test_l
integration: add TestV3PutOnNonExistLease
2016-03-03 21:31:51 -08:00
44151ba531 integration: add TestV3PutOnNonExistLease 2016-03-03 20:32:44 -08:00
b0a88ab287 Merge pull request #4677 from heyitsanthony/clientv3-wr-err
clientv3: add Err() to WatchResponse
2016-03-03 15:42:53 -08:00
1e16758029 clientv3: add Err() to WatchResponse
Checking for number of events as a failure condition was a kludge.
2016-03-03 15:21:04 -08:00
dc7f9a89b0 Merge pull request #4674 from xiang90/progress
v3api: support progress
2016-03-03 14:28:26 -08:00
3cda514edb Merge pull request #4676 from heyitsanthony/clientv3-fix-cancel-retry
clientv3: do not reconnect if request context is canceled
2016-03-03 14:24:50 -08:00
b1521570b6 v3api: support progress 2016-03-03 13:58:15 -08:00
536b028831 benchmark: watch, key-space-size(max possible key)
By specifying 'key-space-size', we can test min/max-key-range
of keys to watch.

For https://github.com/coreos/etcd/issues/3863.
2016-03-03 13:46:17 -08:00
16c35167df clientv3: do not reconnect on request context cancellation 2016-03-03 13:43:16 -08:00
6746d394bf Merge pull request #4669 from xiang90/rev
storage: implement requestProgress
2016-03-03 10:43:48 -08:00
adbc53e3f7 Merge pull request #4670 from gyuho/tc
pkg/netutil: add linux netem functions
2016-03-03 10:41:11 -08:00
863e354ec5 Merge pull request #4672 from heyitsanthony/fix-mutex-lostwaiter
clientv3/concurrency: don't poll in mutex lock on early prior key delete
2016-03-03 10:35:23 -08:00
4422db389a pkg/netutil: add linux netem functions
This is useful for simulating bad networks by introducing
latencies to wide area networks.

Reference:
http://www.linuxfoundation.org/collaborate/workgroups/networking/netem
2016-03-03 10:14:28 -08:00
6d3f172c6e clientv3/concurrency: don't poll in mutex lock on early prior key delete
Lock would get the prior key on retry using WithRev(myRev - 1) instead of
using the latest revision; the Watch() would return immediately and Lock
devolves into polling.
2016-03-03 10:04:57 -08:00
9143329c85 storage: implement requestProgress 2016-03-03 09:39:29 -08:00
e3b755e9e0 Merge pull request #4655 from heyitsanthony/etcdctl-election
etcdctlv3: election command
2016-03-03 00:55:38 -08:00
20d89bcf32 etcdctlv3: elect command 2016-03-03 00:22:19 -08:00
3327858a54 clientv3/concurrency: move election recipe into clientv3 2016-03-03 00:22:19 -08:00
0eeb663754 Merge pull request #4660 from xiang90/shrink_db
backend: support shrink db
2016-03-02 20:28:51 -08:00
c89d80cb11 Merge pull request #4664 from gyuho/alpha1
version: bump to apha1
2016-03-02 19:44:55 -08:00
679b40bc77 Merge pull request #4663 from gyuho/endpoints
etcdctlv3: use string slice for endpoints
2016-03-02 16:41:49 -08:00
c792885952 version: bump to apha1
For https://github.com/coreos/etcd/issues/4652.
2016-03-02 16:38:49 -08:00
13025679c3 etcdctlv3: use string slice for endpoints
This deprecates 'endpoint' flag to enable etcdctl to parse
multi-endpoints flag.
2016-03-02 16:34:58 -08:00
378949f97c Merge pull request #4658 from mitake/v3-auth-enable
add a stub of etcdctlv3 auth enable
2016-03-02 14:45:11 -08:00
558640d91e backend: support shrink db 2016-03-02 14:35:28 -08:00
3cbd54fb0b etcdctlv3: ignore the binary etcdctlv3 2016-03-02 15:32:35 +09:00
b9d77eaaf2 etcdctlv3: a new command auth
Currently a stub of subcommand "auth enable" is implemented.
2016-03-02 15:32:35 +09:00
379d04ea53 clientv3: a new interface Auth for auth related RPCs 2016-03-02 15:17:59 +09:00
7a78c1ef1d etcdserver: AuthServer for auth related RPCs
Currently AuthEnable() is connected to etcdserver for experimental
purpose.
2016-03-02 15:17:59 +09:00
c7657f60ff Merge pull request #4657 from heyitsanthony/v3-procfile-ports
Procfile: serve the default grpc port 2378
2016-03-01 20:28:33 -08:00
4bcdad3778 Procfile: serve the default grpc port 2378
so v3 commands work using the default endpoint
2016-03-01 20:04:26 -08:00
124a444153 Merge pull request #4654 from gyuho/govet_tip
client: fix go vet error at tip
2016-03-01 15:50:54 -08:00
4ffe823c67 client: fix go vet error at tip 2016-03-01 15:37:05 -08:00
23a8339dd7 Merge pull request #4649 from mitake/v3-auth-proto
etcdserver: update rpc.proto for v3 authentication
2016-03-01 09:47:09 -08:00
46a7ef922d Merge pull request #4650 from peterbourgon/fix-raft-node-config-docs
Fix raft node config docs
2016-03-01 07:48:38 -08:00
aedf2c5876 raft: Config: comment wrapping @ 80col 2016-03-01 09:54:58 +01:00
6c1b3a71db raft: clarify Heartbeat/ElectionTick comments
Avoid other, ambiguous interpretations.
2016-03-01 09:52:14 +01:00
286d96284e etcdserver: update rpc.proto for v3 authentication 2016-03-01 17:11:50 +09:00
f0dbd0b856 Merge pull request #4646 from xiang90/starvation
etcdserver: detect raft stravation
2016-02-29 19:58:17 -08:00
942ae63398 Merge pull request #4647 from heyitsanthony/nuke-timeutil
pkg/timeutil: remove
2016-02-29 17:19:09 -08:00
1d6ebdd35c pkg/timeutil: removal
Overkill of a package for three lines of code.
2016-02-29 17:07:24 -08:00
d6520303c6 etcdserver: detect raft starvation caused by contention 2016-02-29 17:06:57 -08:00
3a9d532140 Merge pull request #4614 from heyitsanthony/future-watch-rpc
etcdserver, storage, clientv3: watcher ranges
2016-02-29 15:59:18 -08:00
b73553db68 Merge pull request #4645 from gyuho/clientv3_README
clientv3: document error handling in README
2016-02-29 16:45:48 -07:00
4bf3756aa8 clientv3: document error handling in README 2016-02-29 15:41:52 -08:00
eb327c690b clientv3: support watcher ranges 2016-02-29 15:20:41 -08:00
c0eac7ab72 storage: support watch on ranges 2016-02-29 15:20:41 -08:00
c0b06a7a32 pkg/adt: interval tree 2016-02-29 15:20:30 -08:00
eb1211bced Merge pull request #4416 from endocode/kayrus/relink
docs: Relink and fix broken links
2016-02-29 14:37:23 -08:00
d0efb3e448 Merge pull request #4644 from gyuho/doc
clientv3: document error handling
2016-02-29 15:31:45 -07:00
8dbc6cfd43 etcdserver: ranges in watcher rpc protocol
protocol change so watch requests are ranges; server rejects non-prefix ranges
2016-02-29 14:03:27 -08:00
a857d8e27c clientv3: document error handling 2016-02-29 13:54:35 -08:00
4fb25d5f0e Merge pull request #4613 from heyitsanthony/clientv3-composite
clientv3: compose API interfaces into client struct
2016-02-29 11:23:34 -08:00
7bd850a65c Merge pull request #4639 from xiang90/grpc
*: update gRPC dependency
2016-02-27 21:47:15 -08:00
6a99d967fa *: update gRPC dependency 2016-02-27 21:19:40 -08:00
18a5b88a32 Merge pull request #4635 from gyuho/endpoints
benchmark: use endpoints for benchmark flag
2016-02-26 18:13:52 -07:00
64e276800f benchmark: use endpoints for benchmark flag 2016-02-26 16:55:49 -08:00
df93f5cb5d Merge pull request #4632 from gyuho/watchid
*: return -1 for canceled watch request
2016-02-26 15:36:28 -07:00
4a0a83380e *: return -1 for canceled watch request 2016-02-26 14:26:46 -08:00
2ec138b160 Merge pull request #4630 from heyitsanthony/clientv3-watcher-closecancel
clientv3: return closed channel on Watch() cancel
2016-02-26 13:39:17 -08:00
1528a66808 Merge pull request #4631 from msingle/patch-1
client: minor typo fix
2016-02-26 12:18:43 -08:00
d02b1c982f clientv3: return closed channel on Watch() cancel
was returning nil; difficult to use correctly

Fixes #4626
2016-02-26 12:16:41 -08:00
7b57550484 client: minor typo fix 2016-02-26 15:16:00 -05:00
9f92da1913 Merge pull request #4566 from xiang90/com
etcdctlv3: Compatibility Support
2016-02-26 11:56:40 -08:00
3d507419a2 etcdctlv3: add compatibility section 2016-02-26 11:03:40 -08:00
f8c3fa637f clientv3: use default client lease api 2016-02-25 18:13:26 -08:00
8f7d474a6b clientv3: use default client cluster 2016-02-25 18:13:26 -08:00
3e57bbf317 clientv3: use default client kv 2016-02-25 18:13:26 -08:00
d430c7baf7 clientv3: use default client watcher 2016-02-25 18:13:26 -08:00
298c1e2487 tools/benchmark: port to clientv3 API 2016-02-25 18:13:26 -08:00
5f62c05a6d clientv3: compose all clientv3 APIs into client struct 2016-02-25 18:13:26 -08:00
bfcd39335c Merge pull request #4619 from heyitsanthony/clientv3-do
clientv3: expose Do in KV
2016-02-25 18:11:29 -08:00
43689b9a32 clientv3: expose Do in KV
Do() makes it possible to pass Ops around and apply them later.

Txn().Then(op).Commit() isn't enough because it will wrap the op
in a txn. Likewise, rewriting single op txns into single op rpc's
precludes deliberately submitting a single op transaction.
2016-02-25 17:33:47 -08:00
21649afcd4 Merge pull request #4623 from heyitsanthony/clientv3-fix-lease-panic
clientv3: respect first stream error in lease recv loop
2016-02-25 17:27:40 -08:00
993fd76b19 clientv3: respect first stream error in lease recv loop
Fixes #4622
2016-02-25 16:59:08 -08:00
9e493ccb14 Merge pull request #4621 from xiang90/auto-compaction
*: support time based auto compaction.
2016-02-25 16:19:00 -08:00
d265fe000c *: support time based auto compaction.
Fix https://github.com/coreos/etcd/issues/3906.

We will have extensive doc to talk about what is compaction
and what is auto compaction soon.
2016-02-25 16:02:03 -08:00
762639c2a3 Merge pull request #4618 from hongchaodeng/master
kv.proto: docs fix on watch event of DELETE/EXPIRE
2016-02-25 14:46:24 -08:00
6d32e44b0c kv.proto: docs fix on watch event of DELETE/EXPIRE 2016-02-25 13:51:38 -08:00
6a97c967cc Merge pull request #4617 from gyuho/txn_example
clientv3: fix txn example code
2016-02-25 12:22:34 -07:00
eb95bb2db9 Merge pull request #4611 from xiang90/p_s
doc/security.md: add notes for proxy security
2016-02-25 10:59:31 -08:00
81f77ee4f3 clientv3: fix txn example code 2016-02-25 10:52:47 -08:00
2510cacd47 docs: Relink and fix broken links 2016-02-25 12:42:11 +01:00
8f3981c651 Merge pull request #4612 from gyuho/watch_not_panic
*: watch true cancel, created for wrong rev
2016-02-24 22:07:03 -07:00
a78604dacb *: watch true cancel, created for wrong rev
This sets Created and Cancel true in pb.WatchResponse
when it has received wrong start revision instead of
panic. So that clientv3 can set 'Canceled' in WatchResponse
as well.

Fix https://github.com/coreos/etcd/issues/4610.
2016-02-24 20:56:17 -08:00
a120afb142 doc/security.md: add notes for proxy security 2016-02-24 20:22:54 -08:00
f003ce167a Merge pull request #4604 from heyitsanthony/etcdctl-lock
etcdctlv3: lock command
2016-02-24 20:02:51 -08:00
6053480b75 Merge pull request #4580 from AdoHe/etcdctl_use_endpoints
etcdctl: use endpoints instead of endpoint flag
2016-02-24 19:01:42 -08:00
d8a8116f9a etcdctl: use endpoints instead of endpoint flag 2016-02-24 21:49:50 -05:00
ed44bb00f8 etcdctlv3: lock command 2016-02-24 17:23:40 -08:00
d4b2044eb1 clientv3/concurrency: Mutex 2016-02-24 17:23:40 -08:00
20b4336cdb clientv3/concurrency: Session
A client may bind itself to a session lease to signal its
continued in participation with the cluster.
2016-02-24 16:40:16 -08:00
9f569842f0 clientv3: move syncer to mirror package
to be in line with sync meaning process synchronization, not data
synchronization
2016-02-24 14:21:41 -08:00
24ac3d0222 Merge pull request #4607 from endocode/kayrus/remove_dashes
docs: replaced single dashes in command line configuration
2016-02-24 09:46:21 -08:00
bbdff697db Merge pull request #4605 from heyitsanthony/fixup-godocs
*: fix godoc bugs in interfaces and slice fields
2016-02-24 08:53:33 -08:00
1e295d02cf docs: replaced single dashes in command line configuration
sed -i 's/\([^-a-z]\+\)\(-[a-z]\{2,\}\)/\1-\2/g' configuration.md
2016-02-24 17:28:36 +01:00
afa0368dcc *: fix godoc bugs in interfaces and slice fields
detected with goword
2016-02-24 00:45:40 -08:00
783e6f6b0d Merge pull request #4602 from gyuho/watch_option
*: combine Watch, WatchPrefix with variadic function
2016-02-23 20:26:54 -08:00
8f7948641c contrib/recipes: replace WatchPrefix with Watch 2016-02-23 20:02:24 -08:00
7a7751b994 etcdctlv3: combine Watch, WatchPrefix 2016-02-23 20:02:24 -08:00
a24d276891 clientv3: combine Watch, WatchPrefix with variadic
For https://github.com/coreos/etcd/issues/4598.
2016-02-23 20:02:21 -08:00
53f94c22b3 Merge pull request #4600 from gyuho/opoption_doc
clientv3: add GoDoc to OpOption
2016-02-23 15:36:38 -08:00
e22506cbe4 Merge pull request #4601 from hongchaodeng/master
clientv3: kv.Delete typo
2016-02-23 15:25:11 -08:00
5bc08b7475 clientv3: add GoDoc to OpOption 2016-02-23 15:18:33 -08:00
a19b30b7ab clientv3: kv.Delete typo 2016-02-23 15:07:10 -08:00
2403cdc4c0 Merge pull request #4592 from gyuho/doc
clientv3: add more code examples
2016-02-23 14:06:09 -08:00
72a1e5618b clientv3: add more code examples 2016-02-23 14:05:36 -08:00
86e04d5ff3 Merge pull request #4597 from heyitsanthony/etcdctlv3-format
etcdctlv3: add formatting for json and protobuf
2016-02-23 13:08:19 -08:00
386c64be7f etcdctlv3: protobuf formatting 2016-02-23 12:49:37 -08:00
355896b00a etcdctlv3: json formatting 2016-02-23 12:49:37 -08:00
8302f839b6 etcdctlv3: add printer interface and simple printer 2016-02-23 09:56:57 -08:00
410d32a9b1 Merge pull request #4594 from xiang90/wi
etcdctlv3: make watch interactive mode better
2016-02-22 23:41:26 -08:00
a2902c08a9 etcdctlv3: make watch interactive mode better 2016-02-22 23:06:31 -08:00
c48bafae85 Merge pull request #4591 from heyitsanthony/etcdctlv3-nuke-teletypes
etcdctlv3: use "\n" as output line separator
2016-02-22 22:19:26 -08:00
4295d0db8b etcdctlv3: use "\n" as output line separator 2016-02-22 15:45:56 -08:00
d8b124cf3a Merge pull request #4571 from heyitsanthony/txn-interactive
etcdctlv3: improve txn interactive mode
2016-02-22 15:33:44 -08:00
d139788407 Merge pull request #4575 from aknuds1/fix-clustering-docs
Update clustering documentation for etcd2
2016-02-22 14:58:16 -08:00
b280291f9e etcdctlv3: use --interactive for interactive mode in watch 2016-02-22 14:38:23 -08:00
87dcb2adea etcdctlv3: unify txn interactive mode input with get/put/delete 2016-02-22 14:38:23 -08:00
e5b2247f4f doc: Use double-dash switches 2016-02-22 16:35:18 -06:00
d67192c9f4 Merge pull request #4590 from gyuho/clientv3_doc
clientv3: README, GoDoc examples
2016-02-22 14:24:59 -08:00
f0686189e5 clientv3: README, GoDoc examples 2016-02-22 14:21:36 -08:00
54d15256e7 etcdctlv3: use clientv3 api for txn command 2016-02-22 09:51:59 -08:00
137dc1f795 Merge pull request #4585 from heyitsanthony/fix-testtriggersnap
etcdserver: fix race in TestTriggerSnap
2016-02-21 22:19:20 -08:00
a524d5bdb7 etcdserver: fix race in TestTriggerSnap
Fixes #4584
2016-02-21 22:03:35 -08:00
55c3cf3ce6 Merge pull request #4582 from heyitsanthony/godoc-ci
*: automate checking for broken exported godocs
2016-02-21 21:27:06 -08:00
c5b51946eb *: exported godoc fixups 2016-02-21 20:36:44 -08:00
f6d8059ac1 test: scan for exported godoc violations 2016-02-21 20:36:44 -08:00
67472d1ee0 Merge pull request #4583 from gyuho/delete
*: return the number of deleted keys
2016-02-21 18:11:13 -08:00
fc86e1ded1 *: return the number of deleted keys
For https://github.com/coreos/etcd/issues/4576.
2016-02-21 17:59:21 -08:00
ab9f925c04 Merge pull request #4581 from heyitsanthony/recipes-clientv3
contrib/recipes: use clientv3 APIs
2016-02-21 15:26:41 -08:00
3bb3351ca0 contrib/recipes: use clientv3 kv API 2016-02-21 14:43:41 -08:00
16420cfe63 contrib/recipes: use clientv3 lease API 2016-02-21 14:43:41 -08:00
936e991f9f contrib/recipes: use clientv3 watcher API 2016-02-21 00:10:58 -08:00
f8c998906c Merge pull request #4574 from heyitsanthony/clientv3-lease-ctx
clientv3: support context cancellation on lease keep alives
2016-02-20 23:53:16 -08:00
50ad181477 clientv3: support context cancellation on lease keep alives 2016-02-20 23:21:15 -08:00
5dfcdae521 Merge pull request #4579 from heyitsanthony/txn-fix-if-clobber
clientv3: copy correct pointers into txn comparisons
2016-02-20 22:18:56 -08:00
7b82576b60 clientv3: copy correct pointers into txn comparisons
Was copying the range variable's pointer; all elements of cmp were the same.
2016-02-20 22:01:33 -08:00
969c87b39f Merge pull request #4578 from gyuho/travis
travis: add go1.6
2016-02-20 21:17:02 -08:00
683c78f9a3 travis: add go1.6 2016-02-20 21:02:43 -08:00
25b4b8560b Merge pull request #4572 from xiang90/fix_tester_leak
tools/functional-tester: fix leaky issue by closing conn
2016-02-19 22:04:17 -08:00
e316678a4d tools/functional-tester: fix leaky issue by closing conn 2016-02-19 22:04:01 -08:00
c3824b10da Merge pull request #4570 from xiang90/ctl_mirror
etcdctlv3: add doc for mirror maker
2016-02-19 15:04:45 -08:00
13deb32447 etcdctlv3: add doc for mirror maker 2016-02-19 14:18:14 -08:00
582e089569 Merge pull request #4569 from gyuho/stress
etcd-tester: continue for deadline exceeded
2016-02-19 13:49:31 -08:00
8bcd823ed7 etcd-tester: continue for deadline exceeded 2016-02-19 13:48:58 -08:00
825003a723 Merge pull request #4565 from xiang90/ctl_watch
etcdctlv3: better watch command
2016-02-19 13:15:33 -08:00
755a022fcf etcdctlv3: better watch command 2016-02-19 11:42:37 -08:00
99eb6f35c1 Merge pull request #4533 from skarekrow/patch-1
Update freebsd.md
2016-02-18 21:04:46 -08:00
6764881256 doc: Update freebsd.md
Packages have changed names from coreosetcd to coreos-etcd
2016-02-18 23:03:19 -06:00
f607f64876 Merge pull request #4534 from mitake/obsolete-comment
etcdserver, auth: remove obsolete mutex
2016-02-18 17:56:29 -08:00
11bb07c248 Merge pull request #4564 from heyitsanthony/fix-watchreconnrequest
clientv3: fix current watcher reconnection
2016-02-18 15:14:22 -08:00
f66162932c clientv3: fix current watcher reconnection
If a current watcher didn't receive any events, a reconnect cycle would
advance its revision to the store's current revision. Instead, reconnect
using the watcher's creation header revision if the watcher hasn't received
any events.

Fixes #4502
2016-02-18 15:01:57 -08:00
a22bb7a4e8 Merge pull request #4562 from xiang90/get
etcdctlv3: better get command
2016-02-18 14:35:14 -08:00
9ea8ed3a13 etcdctlv3: better get command 2016-02-18 14:19:51 -08:00
d35a0d6533 Merge pull request #4563 from hongchaodeng/master
watch event docs
2016-02-18 13:59:25 -08:00
93795745b0 storage: add watch event docs for create case 2016-02-18 13:58:36 -08:00
c9d233d69a Merge pull request #4561 from heyitsanthony/gotip-shadow
integration: fix go vet -shadow error
2016-02-18 13:02:46 -08:00
55171707c3 Merge pull request #4560 from heyitsanthony/v3-delete-withfromkey
etcdserver: add >= support for v3 delete range
2016-02-18 13:02:03 -08:00
94fe87f010 Merge pull request #4557 from xiang90/del
etcdctlv3: make del command better
2016-02-18 12:47:58 -08:00
4fc89678b2 etcdserver: add >= support for v3 delete range 2016-02-18 12:34:04 -08:00
270fa00e54 integration: fix go vet -shadow error
breaking go tip
2016-02-18 12:26:35 -08:00
917d75f65e etcdctlv3: make del command better 2016-02-18 12:23:34 -08:00
71288597da Merge pull request #4556 from heyitsanthony/watcher-batch
storage: limit total unique revisions in unsynced watcher event list
2016-02-18 11:53:46 -08:00
7c17665a1a storage: limit total unique revisions in unsynced watcher event list 2016-02-18 11:36:22 -08:00
e6d6b648c4 Merge pull request #4553 from xiang90/raft_http
rafthttp: remove unncessary go routine
2016-02-18 10:47:45 -08:00
7d73d41758 Merge pull request #4555 from heyitsanthony/v3-with-prefix
clientv3: WithPrefix operation option
2016-02-18 10:37:24 -08:00
566fd02f62 Merge pull request #4558 from gyuho/path_fix
etcd-agent: get base when renaming
2016-02-18 09:15:27 -08:00
b2bad7bd79 etcd-agent: get base when renaming
Partially related to https://github.com/coreos/etcd/issues/4552.
2016-02-18 09:03:34 -08:00
2a3cacb60c rafthttp: remove unncessary go routine 2016-02-18 07:57:58 -08:00
4a041693de Merge pull request #4550 from xiang90/etcdctl_put
etcdctlv3: make PUT command clean and documented
2016-02-18 07:50:59 -08:00
535064924c etcdctlv3: make PUT command clean and documented 2016-02-18 07:46:05 -08:00
59291770d6 clientv3: WithPrefix operation option 2016-02-18 01:27:06 -08:00
cf71b64286 Merge pull request #4549 from gyuho/path
functional-tester: remove log prefixes
2016-02-17 19:05:07 -08:00
061e996998 functional-tester: remove log prefixes
capnslog already prefixes with its package name.
2016-02-17 19:01:16 -08:00
6bfd45a83e Merge pull request #4548 from gyuho/plog
functional-tester: plog for milli-second timestamp
2016-02-17 18:43:10 -08:00
7aa62ec595 functional-tester: plog for milli-second timestamp
Standard log package by default only prints out the second-scale
so the 3rd party log feeder mixes the order of the events, which makes
the debugging hard. This replaces it with capnslog and make them consistent
with all other etcd log formats.
2016-02-17 18:39:05 -08:00
40d3e0daff Merge pull request #4547 from gyuho/timeout
etcd-tester: 10-second timeout for stressers
2016-02-17 15:44:30 -08:00
239a6d89c5 etcd-tester: 10-second timeout for stressers
For https://github.com/coreos/etcd/issues/4477.
2016-02-17 15:44:05 -08:00
ef2d3feca6 Merge pull request #4528 from heyitsanthony/fix-watchcurrev
fix several watcher races
2016-02-17 14:26:33 -08:00
6b3fa6aa72 Merge pull request #4546 from xiang90/batch
rafthttp: smart batching
2016-02-17 14:05:11 -08:00
155412bbfa integration: overlapped create and put v3 watcher test 2016-02-17 14:03:52 -08:00
af225e7433 v3rpc: don't race on current watcher header revision 2016-02-17 14:03:52 -08:00
2cbf7cf6d1 storage: do not send outdated events to unsynced watchers 2016-02-17 14:03:51 -08:00
e4f22cd6d8 rafthtt: smart batching
Improved the overall performance more than 20% under heavyload
with little latency impact

heavy load
```
Requests/sec: ~23200  vs  Requests/sec: ~31500

Latency distribution:
  10% in 0.0883 secs.
  25% in 0.1022 secs.
  50% in 0.1207 secs.
  75% in 0.1460 secs.
  90% in 0.1647 secs.
  95% in 0.1783 secs.
  99% in 0.2223 secs.

vs

Latency distribution:
  10% in 0.1119 secs.
  25% in 0.1272 secs.
  50% in 0.1469 secs.
  75% in 0.1626 secs.
  90% in 0.1765 secs.
  95% in 0.1863 secs.
  99% in 0.2276 secs.
```

Similar on light load too.
2016-02-17 13:17:12 -08:00
a4105b5cce Merge pull request #4542 from xiang90/t
rafthttp: refactoring
2016-02-17 09:17:44 -08:00
59e7be4a2a v3api: send watch events only after sending watchid creation
If events show up before the watch id, the client won't be able
to match the event with the requested watcher.
2016-02-17 01:06:55 -08:00
019a145304 integration: put keys after watcher ack in TestV3WatchFromCurrentRevision
Watcher would miss events since the keys would be created after
sending the watcher request but before etcd registered the watcher.
2016-02-17 01:06:52 -08:00
74382f56fb rafthttp: handle short case in if statement 2016-02-16 19:26:51 -08:00
d393102e24 rafthttp: refactor 2016-02-16 19:21:53 -08:00
11d3e9ac69 rafthttp: better comment for streamWriter 2016-02-16 19:21:06 -08:00
56318f5433 rafthttp: add necessary locking 2016-02-16 19:18:05 -08:00
976236b083 Merge pull request #4539 from xiang90/snap
*: record the number of bytes of snapshot sent/received
2016-02-16 16:39:22 -08:00
994333e720 *: record the number of bytes of snapshot sent/received 2016-02-16 16:08:26 -08:00
31d2bb9739 Merge pull request #4537 from gyuho/mk
e2e: compare output in Go string literal
2016-02-16 16:01:20 -08:00
7cae2ae2a0 e2e: compare output in Go string literal
I manually print out the command outputs when the issue
was reproduced, and checked they are matching when compared as
Go string literals (UTF-8), but not when compared with regex.

Fixes https://github.com/coreos/etcd/issues/4480.
2016-02-16 13:57:49 -08:00
82c3600cfa Merge pull request #4536 from gyuho/tidy_cleanup
etcd-agent: tidy cleanup before SIGKILL
2016-02-16 13:25:40 -08:00
56e3ab0943 etcd-agent: tidy cleanup before SIGKILL
https://github.com/golang/go/blob/master/src/os/exec_posix.go#L18 shows that
cmd.Process.Kill calls syscall.SIGKILL to the command. But
http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_12_01.html explains
'If you send a SIGKILL to a process, you remove any chance for the process to
do a tidy cleanup and shutdown, which might have unfortunate consequences.'
This sends SIGTERM, SIGINT syscalls to the PID so that the process could
have more time to clean up the resources.

Related to https://github.com/coreos/etcd/issues/4517.
2016-02-16 13:08:22 -08:00
613a1e7fdd Merge pull request #4535 from xiang90/mirrormaker
etcdctlv3: add initial mirrormaker
2016-02-16 11:34:11 -08:00
f71e733b8e etcdctlv3: add mirrormaker 2016-02-16 08:02:17 -08:00
6ba9373962 clientv3/sync: fix getting empty key error 2016-02-15 22:01:11 -08:00
30e4d7d6aa Merge pull request #4532 from xiang90/ctlv3
etcdctlv3: refactoring
2016-02-15 20:12:04 -08:00
0cf9cde1b4 etcdserver, auth: remove obsolete mutex
The removed mutex is obsolete because the enabled field is removed
in the commit b2d2c79a2f.
2016-02-16 12:03:31 +09:00
d78cff2c4a etcdctlv3: separate out cmd parsing logic for creating client 2016-02-15 14:44:25 -08:00
e75734aa68 Merge pull request #4529 from gyuho/govet
storage: shadowed err var fix at go-tip
2016-02-15 14:41:16 -08:00
03a7f2e10f etcdctlv3: secure is not HTTPS 2016-02-15 10:30:22 -08:00
fe5500228a Merge pull request #4523 from xiang90/syncer
*: move sync logic to clientv3/sync
2016-02-14 23:24:39 -08:00
24a6abaf59 *: move sync logic to clientv3/sync 2016-02-14 22:52:34 -08:00
449c116a44 storage: shadowed err var fix at go-tip 2016-02-14 19:49:03 -08:00
0662db11ed Merge pull request #4525 from heyitsanthony/fix-tls-proxy
e2e: tls proxy tests
2016-02-14 16:17:32 -08:00
1719bc0b0c e2e: tls proxy tests 2016-02-14 00:55:07 -08:00
925629dad8 Merge pull request #4521 from heyitsanthony/fix-doublebarrierfailover
contrib/recipes: fix revision race in double barrier
2016-02-13 15:26:25 -08:00
20ac633059 Merge pull request #4516 from gyuho/path
etcd-agent: ignore error when no file to rename
2016-02-13 14:24:17 -08:00
0f7f375043 contrib/recipes: fix revision race in double barrier
current kv revision might be ahead of ready put event; watch using key's mod
revision instead.

Fixes #4425
2016-02-13 11:57:12 -08:00
3d73e72bf6 Merge pull request #4049 from xiang90/raft_comment
raft: rework comment for advance interface
2016-02-13 10:22:18 -08:00
cff1208005 Merge pull request #4520 from xiang90/bench
tools/benchmark: support serializable range benchmark
2016-02-13 09:25:24 -08:00
4d0a2b4215 Merge pull request #4462 from mitake/benchmark-watch
tools/benchmark: revive watch benchmark
2016-02-13 09:24:00 -08:00
3a9a1c7d9b tools/benchmark: support serializable range benchmark 2016-02-13 09:23:35 -08:00
99e7449f44 tools/benchmark: revive watch benchmark
Current watch benchmark seems to be broken. This commit revives it.
2016-02-14 01:15:04 +09:00
205033d25f etcd-agent: ignore error when no file to rename
Fixes https://github.com/coreos/etcd/issues/4512.
When cluster fails before creation of log or data directory
the file does not exist and cannot be renamed. This skips such
error because there's no need to store empty logs in failure_archive.
2016-02-12 16:37:04 -08:00
c15b2a5077 Merge pull request #4514 from xiang90/tester
tools/functional-tester: add metrics
2016-02-12 14:45:10 -08:00
a30201c1d2 Merge pull request #4513 from gyuho/f1
etcd-tester: use Hash method to get both revision and hash
2016-02-12 14:44:52 -08:00
1bec0e6a0b tools/functional-tester: add metrics 2016-02-12 14:42:41 -08:00
5b2847b338 etcd-tester: use Hash method to get both revision and hash 2016-02-12 14:40:51 -08:00
93f2a4487a Merge pull request #4507 from gyuho/better_hash
etcdserver: populate ResponseHeader in Hash method
2016-02-12 14:36:26 -08:00
7a6f5695bb Merge pull request #4495 from heyitsanthony/snapshot-command
etcdctlv3: snapshot command
2016-02-12 14:34:47 -08:00
2710e4eed1 etcdserver: populate ResponseHeader in Hash method 2016-02-12 14:26:18 -08:00
91e2086d18 etcdctlv3: snapshot command
Partially addresses #4097
2016-02-12 14:19:26 -08:00
2415303991 clientv3: typedef <-chan WatchResponse to WatchChan 2016-02-12 14:06:59 -08:00
8e411b1b3b clientv3: send compacted revision before closing watch chan 2016-02-12 14:06:59 -08:00
ee1a03167d storage, v3: pass compaction revision through watchresponse 2016-02-12 14:06:59 -08:00
6851fffdfb clientv3: support >= Range requests
Turns out grpc will convert an empty byte string to nil, so use "\0" to
indicate Range on >= key in v3 grpc protocol.
2016-02-12 14:06:59 -08:00
390a4518c0 raft: rework comment for advance interface 2016-02-12 13:43:51 -08:00
1d02559ae5 Merge pull request #4501 from xiang90/lt
integration: test switch lease via put
2016-02-12 13:20:05 -08:00
11be967d12 Merge pull request #4510 from xiang90/client_support
clientv3: support serializable
2016-02-12 13:17:31 -08:00
5908e5b601 clientv3: support serializable 2016-02-12 12:24:46 -08:00
00f89941a9 Merge pull request #4508 from xiang90/l
*: support local range request
2016-02-12 12:14:53 -08:00
30c11c1bca *: support local range request 2016-02-12 12:04:06 -08:00
895b50029f Merge pull request #4506 from xiang90/w
refactoring watch integration test.
2016-02-12 10:11:20 -08:00
9cd45312d5 Merge pull request #4505 from heyitsanthony/v3-range-ge
storage: support ranges for >= key
2016-02-12 10:03:45 -08:00
be1534812a integration: give watch stream a timeout to fail the test fast 2016-02-12 09:58:15 -08:00
8ed9ebf3e1 integration: WaitResponse -> waitResponse 2016-02-12 09:50:29 -08:00
5f1d30b76a integration: move watch tests to v3_watch_test.go 2016-02-12 09:47:33 -08:00
4854d7f69d storage: support ranges for >= key
If end == "", range(key, end) will give all keys >= key.
2016-02-12 09:45:43 -08:00
392d3a1f26 Merge pull request #4497 from hongchaodeng/docs
kv.proto: docs of create_revision, mod_revision
2016-02-11 22:10:08 -08:00
fa45e13073 integration: test switch lease via put 2016-02-11 22:04:54 -08:00
a89ba1e583 Merge pull request #4499 from heyitsanthony/apply-scheduler
etcdserver: use fifo scheduler for applier
2016-02-11 21:44:34 -08:00
8c9dba8275 Merge pull request #4500 from gyuho/etcdctl_doc
etcdctl: make doc on 'no-sync' clearer
2016-02-11 21:40:31 -08:00
658f2e53ba etcdctl: make doc on 'no-sync' clearer
For issues like https://github.com/coreos/etcd/issues/4496.
2016-02-11 19:52:03 -08:00
616f395920 etcdserver: use fifo scheduler for applier 2016-02-11 19:21:30 -08:00
c27a4a1d3d kv.proto: docs of create_revision, mod_revision 2016-02-11 18:25:46 -08:00
89ca5ccccd Merge pull request #4486 from gyuho/f1
etcd-tester: failures aware of leader/non-leader
2016-02-11 17:08:09 -08:00
40c598cfa6 Merge pull request #4494 from xiang90/sched
*: fix schedule.Wait race
2016-02-11 15:56:01 -08:00
f34b8d334b Merge pull request #4408 from xiang90/revoke
detach keys from lease
2016-02-11 15:55:02 -08:00
c1851dfca1 etcd-tester: add leader failure cases 2016-02-11 15:46:44 -08:00
bfa5e310a9 *: detach keys from leases
1. deatch when a key is removed
2. deatch when the key's lease changes
3. potentially deatch when restroing a tombstone key
2016-02-11 15:31:25 -08:00
870e4c2681 *: fix schedule.Wait race 2016-02-11 15:21:33 -08:00
56cc2d00df Merge pull request #4493 from xiang90/fix_ctl
etcdctlv3: put should check error
2016-02-11 15:03:34 -08:00
b5d5bf625d etcdctlv3: put should check error 2016-02-11 15:01:33 -08:00
a78826e025 Merge pull request #4489 from heyitsanthony/fix-watcher-reqresend
clientv3: fix bad variable capture in watch request retry
2016-02-11 14:20:17 -08:00
e2146e2080 Merge pull request #4490 from gyuho/godoc
clientv3: fix godoc for member apis
2016-02-11 14:14:44 -08:00
b19d57e1c3 clientv3: fix godoc for member apis 2016-02-11 13:55:38 -08:00
4b9bf0d673 Merge pull request #4488 from gyuho/page_cache
etcd-agent: cleans page cache when cleaning up
2016-02-11 13:49:54 -08:00
78df258ea8 etcd-agent: cleans page cache when cleaning up
Reference:
- https://www.kernel.org/doc/Documentation/sysctl/vm.txt
- https://github.com/torvalds/linux/blob/master/fs/drop_caches.c
2016-02-11 13:48:54 -08:00
a8bfd1218b Merge pull request #4487 from gyuho/leader_api
etcdserver: include IsLeader in etcdserverpb.Member
2016-02-11 13:39:02 -08:00
3b7bd38a2d clientv3: fix bad variable capture in watch request retry
variables would be niled out when the goroutine runs, causing a crash
2016-02-11 13:35:07 -08:00
5fbf64c144 clienv3: add MemberAdd method based on v3 change 2016-02-11 13:27:34 -08:00
a56287b9b4 etcdserver: include IsLeader in etcdserverpb.Member 2016-02-11 13:04:03 -08:00
fcf94f3a59 Merge pull request #4483 from heyitsanthony/clientv3-op-opts
clientv3: optionize put and delete
2016-02-10 15:37:35 -08:00
3c9e8540a7 clientv3: optionize put and delete 2016-02-10 15:03:11 -08:00
21e5cf1555 Merge pull request #4447 from xiang90/sched
*: add a scheduler and use it to schedule compaction
2016-02-10 14:49:33 -08:00
d314345e6d *: add a scheduler and use it to schedule compaction 2016-02-10 14:27:08 -08:00
4b68977851 Merge pull request #4481 from xiang90/testing-tool
tools/etcd-dump-logs: support parsing v3 log
2016-02-10 14:00:32 -08:00
3611a9ad2e tools/etcd-dump-logs: support parsing v3 log 2016-02-10 13:52:02 -08:00
2a842eb049 Merge pull request #4476 from heyitsanthony/fix-raftexample-restart
contrib/raftexample: fix restart path
2016-02-10 13:00:57 -08:00
02b24c58fd contrib/raftexample: fix tests
os.Exit() on raft stop breaks out of the test fixture; instead,
monitor the error channel and exit on close
2016-02-10 11:49:13 -08:00
0cb304ec61 contrib/raftexample: fix restart path
The ConfChange fix crashes WAL replay because it assumed the node
always exists. Additionally, restart on a single node cluster
would deadlock because it had the wrong raft HardState.

To fix, replay path now goes through the regular raft loop.

Fixes #4474
2016-02-10 11:49:13 -08:00
d1b5fdea25 Merge pull request #4460 from mitake/build
build, test: don't pass -a flag for go build during ordinal building
2016-02-10 18:34:43 +01:00
5e47ba3fad Merge pull request #4473 from heyitsanthony/clientv3-ctx-kv
clientv3: ctx-ize KV
2016-02-09 17:54:14 -08:00
51c4894f62 clientv3: ctx-ize KV 2016-02-09 17:42:34 -08:00
3b8237d011 Merge pull request #4472 from gyuho/f0
etcd-tester: count success for v3
2016-02-09 17:16:06 -08:00
7b2ce70783 etcd-tester: count success for v3
needed for snapshot count comparison
2016-02-09 17:12:03 -08:00
bb504fdf23 Merge pull request #4470 from gyuho/test
etcd-tester: close leaky gRPC connections
2016-02-09 16:30:09 -08:00
7d2b7e0d23 etcd-tester: close leaky gRPC connections
when closed errors will be one of:

```
grpc.ErrorDesc(err) == context.Canceled.Error() ||
grpc.ErrorDesc(err) == context.DeadlineExceeded.Error() ||
grpc.ErrorDesc(err) == "transport is closing" ||
grpc.ErrorDesc(err) == "grpc: the client connection is closing"
```
2016-02-09 16:26:33 -08:00
a60da8f3ce Merge pull request #4471 from heyitsanthony/fix-integration-certs
integration: add key usage to server.crt
2016-02-09 15:52:14 -08:00
ed29bc3221 integration: add key usage to server.crt
curl handshake was failing; related: #209
2016-02-09 15:34:53 -08:00
3b0f8d53e5 Merge pull request #4468 from gyuho/f0
etcd-tester: continue after cleanup
2016-02-09 13:43:32 -08:00
16aa263d8c etcd-tester: continue after cleanup 2016-02-09 13:32:39 -08:00
c8994aab62 Merge pull request #4466 from gyuho/f0
etcd-tester: close gRPC connection when canceling
2016-02-09 11:07:00 -08:00
a46e20f92a etcd-tester: close gRPC connection when canceling
Currently gRPC connection just gets recreated
for every Stress call. When Stress ends or gets
canceled, gRPC connection must also be closed.

For https://github.com/coreos/etcd/issues/4464.
2016-02-09 11:04:16 -08:00
e9c0d5424a Merge pull request #4467 from gyuho/f00
etcd-tester: fix wrong error checking
2016-02-09 10:20:22 -08:00
e252c0c0ca etcd-tester: fix wrong error checking
Hash method returns either (nil, err) or (Hash, nil).
The current error checking is wrong. It only needs to check
the error is either nil or non-nil.

This causes panic in https://github.com/coreos/etcd/issues/4463
by allowing the case when resp is nil, but err is not nil.
2016-02-09 10:00:05 -08:00
fa71bec550 Merge pull request #4458 from xiang90/cl
etcd-tester: cleanup
2016-02-08 21:16:28 -08:00
e4d2ff3bd9 build, test: don't pass -a flag for go build during ordinal building
./build takes long time. On my Core i5 box, it requires almost 25
seconds. Without -a flag, it takes almost 15 seconds. Therefore this
commit reduces the flag in default. ./test activates -a via a new env
var GO_BUILD_FLAGS.
2016-02-09 14:11:44 +09:00
25834211a9 etcd-tester: cleanup 2016-02-08 20:54:25 -08:00
6d447f7a47 Merge pull request #4457 from gyuho/f0
etcd-agent: mkdir with read/write to all users
2016-02-08 20:51:30 -08:00
77f753ac32 etcd-agent: mkdir with read/write to all users 2016-02-08 20:50:11 -08:00
f368639f00 Merge pull request #4456 from mitake/v3-put-0-args
etcdctlv3: handle a case of 0 arguments in put command
2016-02-08 19:35:54 -08:00
674d54ad9b etcdctlv3: handle a case of 0 arguments in put command 2016-02-09 12:22:25 +09:00
15c8876e4c Merge pull request #4455 from heyitsanthony/etcdctlv3-compaction-err
etcdctlv3: report compaction error, if any
2016-02-08 19:15:40 -08:00
4698e7e23b Merge pull request #4450 from mitake/v3-put-stdin
etcdctlv3: support reading value from stdin
2016-02-08 19:13:56 -08:00
075f5f68ad etcdctlv3: support reading value from stdin
This commit lets etcdctlv3 support reading value from stdin like
`etcdctl set`. It is convenient for storing complex, long value.
2016-02-09 10:54:35 +09:00
aa9d3c8b74 etcdctlv3: report compaction error, if any 2016-02-08 15:09:03 -08:00
4d27abc296 Merge pull request #4454 from heyitsanthony/v3-cmp
clientv3: make compare compliant with proposed txn usage
2016-02-08 15:08:35 -08:00
f5fc0b8afa Merge pull request #4449 from gyuho/f0
etcd-tester: avoid directory name conflict
2016-02-08 14:37:47 -08:00
4f41d361a8 clientv3: make compare compliant with proposed txn usage 2016-02-08 13:48:29 -08:00
16543778f1 etcd-tester: avoid directory name conflict 2016-02-08 13:38:26 -08:00
70006da092 Merge pull request #4453 from heyitsanthony/v3-withoption
clientv3: withOption for Get
2016-02-08 13:31:24 -08:00
0fde354eba Merge pull request #4164 from cchamplin/ttl-refresh
store/httpapi: support refresh ttl without firing watch
2016-02-08 13:20:34 -08:00
b3c2891c1d Merge pull request #4452 from xiang90/too_large
*: limit request size for v3
2016-02-08 13:14:59 -08:00
8dcd24bd64 clientv3: withOption for Gets 2016-02-08 13:11:55 -08:00
35567221a7 *: limit request size for v3 2016-02-08 12:54:03 -08:00
2a261e1b03 Merge pull request #4438 from adamwg/raftexample-add-nodes
Reconfiguration for raftexample (#4018)
2016-02-08 12:46:07 -08:00
ffd61c0faf contrib/raftexample: Update README to reflect dynamic configuration changes (fixes #4018) 2016-02-08 13:03:25 -07:00
b72a0788ad Merge pull request #4439 from xiang90/fix_tr
transport: make tr stop safe
2016-02-08 11:25:03 -08:00
ea688c1f06 transport: make tr stop safe 2016-02-08 11:13:52 -08:00
4a527be302 contrib/raftexample: Allow nodes to be removed from a running cluster
A node with ID n can be removed by DELETEing /n on the HTTP server.
2016-02-08 10:51:06 -07:00
7c0b6d9be9 contrib/raftexample: Allow nodes to be added to a running cluster
A node with ID n can be added by POSTing the new node's URL to /n on the
HTTP server.
2016-02-08 10:51:06 -07:00
7d862960cc contrib/raftexample: Add a channel for proposing config changes
Add a channel over which we can propose cluster config changes to
raft. In an upcoming commit we'll add an HTTP endpoint that sends config
changes over this channel.
2016-02-08 10:51:06 -07:00
eb7fef559d contrib/raftexample: Handle conf change entries
So far we don't propose conf changes, but we'll be ready to handle them
when we do.
2016-02-08 10:51:03 -07:00
82778ed478 Add refresh parameter to allow TTL refreshes without firing watch/wait responses 2016-02-08 10:37:37 -07:00
2be7f7c2fb Merge pull request #4448 from gyuho/f0
etcd-tester: add compactKV every case, clean up logs
2016-02-06 15:14:41 -08:00
08dbabdb5f etcd-tester: add compactKV
It compacts storage for every case.
For https://github.com/coreos/etcd/issues/4380.
2016-02-06 15:02:58 -08:00
e7a5899582 Merge pull request #4410 from mitake/security-options
etcdctlv3: handle empty options related to security
2016-02-05 20:56:27 -08:00
6d12bf4951 Merge pull request #4445 from gyuho/func
etcd-tester: log cancel in stresser
2016-02-05 18:47:42 -08:00
044f7775e3 etcd-tester: log cancel in stresser
And fix some minor print formats.
2016-02-05 18:31:27 -08:00
38ab8aade4 Merge pull request #4437 from heyitsanthony/fix-testv2ctlwatch
e2e: fix race in etcdctl watch tests
2016-02-05 17:05:10 -08:00
c8fc3413b7 Merge pull request #4431 from heyitsanthony/rafthttp-localurl
rafthttp: plumb local peer URLs through transport
2016-02-05 16:56:32 -08:00
b7eb539b7a clientv3/integration: add delay after restart in TestTxnWriteFail
CI was timing out with publish failures
2016-02-05 16:44:41 -08:00
fe7cfe4d3d rafthttp: plumb local peer URLs through transport 2016-02-05 16:44:41 -08:00
a1ea70e36d Merge pull request #4442 from xiang90/rpc_err
*: add etcdserver namespace for rpc error
2016-02-05 15:22:35 -08:00
bc3fc4ea33 *: add etcdserver namespace for rpc error 2016-02-05 15:13:24 -08:00
6fc1fdc0b1 Merge pull request #4441 from philips/add-videos-to-v3-doc
Documentation: add more context on the v3 API
2016-02-05 14:45:16 -08:00
ef86b0972c Documentation: add more context on the v3 API
Add links to videos we have recorded and some context besides just the
bullet points.
2016-02-05 14:43:14 -08:00
054a4f3d7a Merge pull request #4433 from gyuho/f0
functional-tester/etcd-tester: silent grpclog, get revs, sleep longer
2016-02-05 14:09:07 -08:00
09fc764552 functional-tester/etcd-tester: silent grpclog, check revs 2016-02-05 14:04:58 -08:00
a31f9a8af1 contrib/raftexample: Publish only committed entries
We shouldn't publish entries to the kvstore until they've been
committed.
2016-02-05 13:59:49 -07:00
8f3e17b781 Merge pull request #4436 from heyitsanthony/txnfail-reconn
clientv3: retry remote connection on txn write failure
2016-02-05 12:52:16 -08:00
6bbb916b47 e2e: fix race in etcdctl watch tests 2016-02-05 12:27:05 -08:00
a6008f41e2 clientv3: retry remote connection on txn write failure 2016-02-05 11:51:44 -08:00
c6455ba2ce Merge pull request #4434 from xiang90/bolt
use initial map flag in bolt
2016-02-05 11:40:39 -08:00
26c645f049 storage/backend: set initial db size to avoid potential deadlock 2016-02-05 11:29:16 -08:00
8156a58ba3 godep: update bolt 2016-02-05 11:29:16 -08:00
7960bd8690 Merge pull request #4430 from heyitsanthony/clientv3-test-kv-retry
clientv3/integration: test Get retry
2016-02-05 11:17:54 -08:00
0385734111 clientv3/integration: KV retry tests
make sure Get will succeed after reconnect cycle with and without Put failure
2016-02-05 10:56:42 -08:00
d0977d59ce Merge pull request #4429 from heyitsanthony/fix-testtxnwritefail
clientv3/integration: add timeouts to TestTxnWriteFail
2016-02-05 10:37:44 -08:00
e3e4d09653 clientv3/integration: add timeouts to TestTxnWriteFail
so it doesn't take ten minutes to fail
2016-02-05 10:24:56 -08:00
c3fd2f95f0 Merge pull request #4432 from gyuho/f0
functional-tester/etcd-agent: configurable log path
2016-02-05 10:22:20 -08:00
e2b5b1cd1a functional-tester/etcd-agent: configurable log path 2016-02-05 09:37:24 -08:00
2cd1cc4111 Merge pull request #4428 from gyuho/f0
functional-tester/etcd-agent: configurable agent port
2016-02-04 21:40:33 -08:00
8e1325d9e1 functional-tester/etcd-agent: configurable agent port
To make local testing easier.
2016-02-04 21:10:30 -08:00
7abd21ee44 etcdctlv3: handle empty options related to security
Current etcdctlv3 doesn't handle options related to security when they
are not passed. Connections cannot be established and etcd produces
logs like this:

```
14:09:07 etcd1 | 2016/02/04 14:09:07 transport: http2Server.HandleStreams received bogus greeting from client: "\x16\x03\x01\x00\x9a\x01\x00\x00\x96\x03\x03\xf6\t\xda\x06QV\xb4\xdd\xc1gF\x1cC"
```

This commit fixes the problem. In addition, a case that empty strings
are passed to the options (e.g. --key="") are treated as error.
2016-02-05 13:31:37 +09:00
f003e421f5 Merge pull request #4426 from gyuho/f0
etcd-agent: fix data-dir path check
2016-02-04 18:34:16 -08:00
220d0c3c14 etcd-agent: fix data-dir path check
Need one more dash to match 'data-dir' flag.
2016-02-04 16:53:01 -08:00
2897fb0c5c Merge pull request #4412 from gyuho/f0
functional-tester: fix grpc endpoint, consistent check
2016-02-04 15:45:24 -08:00
85a4a5b596 functional-tester: fix grpc endpoint, consistent check
And some clean ups.
2016-02-04 15:10:43 -08:00
a60173f79c Merge pull request #4421 from jonboulle/master
docs: remove old client-matrix link
2016-02-04 14:15:26 -08:00
d21ef68a0c Merge pull request #4413 from gyuho/TestKVCompact
clientv3/integration: add TestKVCompact
2016-02-04 14:14:37 -08:00
60085a05f1 Merge pull request #4423 from xiang90/id
pkg/idutil: reduce conflict rate from 1% to 0.005%
2016-02-04 14:13:11 -08:00
5b4b1c7039 clientv3/integration: add TestKVCompact 2016-02-04 13:45:51 -08:00
e44e753e66 pkg/idutil: reduce conflict rate from 1% to 0.005%
Perviously, we only use 8bits from member identification
in id generation. The conflict rate is A(256,3)/256^3, which
is around 1%. Now we use 16bites to reduce the rate to 0.005%.

We can attach the full member id into id generation if needed...
2016-02-04 13:25:18 -08:00
f19ff0c39d docs: remove old client-matrix link
This document was removed in 23406dc2ee
but still linked to here.
2016-02-04 20:32:15 +01:00
0cdf1c45cf Merge pull request #4418 from xiang90/ci
pkg/wait: make id checking stricter
2016-02-04 10:50:11 -08:00
d43bd48977 pkg/wait: make id checking stricter
Do not allow register with same id.
2016-02-04 09:59:49 -08:00
a0b00a5b89 Merge pull request #4409 from heyitsanthony/v3-txn-tests
clientv3/integration: txn tests
2016-02-04 09:30:52 -08:00
9523c2d29f clientv3/integration: txn tests 2016-02-04 08:40:24 -08:00
26f440be7c Merge pull request #4406 from gyuho/f0
*: functional-tester with v3
2016-02-03 15:54:10 -08:00
c07fc3e08e Merge pull request #4407 from heyitsanthony/txn-no-retry
clientv3: don't retry txns that may modify the store
2016-02-03 15:37:49 -08:00
16dcade07d Merge pull request #4402 from heyitsanthony/minority-failure
rafthttp: add leader to transport if peer does not exist
2016-02-03 15:31:01 -08:00
7a3426a231 tools/functional-tester/etcd-tester: support v3 kv storage 2016-02-03 15:24:54 -08:00
b6a08a97e2 clientv3: don't retry txns that may modify the store 2016-02-03 14:55:16 -08:00
ed682c9f08 tools/functional-tester: minor cleanup 2016-02-03 14:30:34 -08:00
db0b505de5 rafthttp: add requester to transport if peer does not exist
cluster integration now supports adding members with stopped nodes, too

Fixes #3699
2016-02-03 14:16:46 -08:00
6da3c08b4d Merge pull request #4401 from QuentinPerez/format
wrong number of args for format in Errorf/Printf
2016-02-03 13:21:33 -08:00
86aafcd15a clientv3/integration: fix args format in Errorf/Printf 2016-02-03 22:17:58 +01:00
f82a1b0583 Merge pull request #4404 from gyuho/hash
etcdserver: add kv Hash method (for testing purpose)
2016-02-03 13:14:13 -08:00
2d197ac9e8 *: add kv Hash method (for testing purpose) 2016-02-03 12:52:39 -08:00
c98f6fa1b9 Merge pull request #4399 from mitake/genproto
scripts: get goimports in genproto.sh
2016-02-03 21:27:28 +01:00
9bfe617728 Merge pull request #4400 from mitake/v3-member-tirivial
etcdserver: update comments in a generated file
2016-02-03 09:01:40 -08:00
f7d35a1ef8 etcdserver: update comments in a generated file
On the latest master branch, etcdserver/etcdserverpb/etcdserver.pb.go
is changed when scripts/genproto.sh is executed. The content only has
changes for comment. Therefore it is not important but the change is
annoying when we update the proto file.
2016-02-04 00:45:16 +09:00
be9c9ae7d5 scripts: get goimports in genproto.sh
genproto.sh uses goimports. Getting the command in the script is
useful.
2016-02-04 00:37:50 +09:00
456975f631 Merge pull request #4396 from xiang90/fix_watch
storage: update watch.cur and fix tests
2016-02-03 01:14:29 -08:00
b09214df32 storage: update watch.cur and fix tests 2016-02-03 00:54:07 -08:00
6c7ff98b0d Merge pull request #4395 from xiang90/fix_watch
fix watch issues in storage
2016-02-03 00:10:22 -08:00
3ed404633a v3rpc: add compacted field from wresp 2016-02-02 23:24:15 -08:00
52416fafb0 storage: send compaction 2016-02-02 23:17:27 -08:00
5780497e18 storage: remove unncessary handle func 2016-02-02 23:02:15 -08:00
ae5161382b storage: release tx lock until finish using the readonly bytes
The backend will return read only bytes that are only vaild while
the tx is open. We should hold the lock until we get a full copy
by unmarshal.
2016-02-02 22:49:05 -08:00
d7f6ad0334 Merge pull request #4392 from xiang90/watch
storage: make unsync a watcherSetByKey
2016-02-02 21:36:30 -08:00
7277b1fe15 Merge pull request #4394 from heyitsanthony/coalesce-stacks
pkg/testutil: more aggressive goroutine stack trace coalescing
2016-02-02 21:30:53 -08:00
72b31d6fdc pkg/testutil: more aggressive goroutine stack trace coalescing
Strips out the pointer arguments in the header of the stack trace so
that more stack traces match each other.
2016-02-02 21:20:24 -08:00
cb30d6e6f8 Merge pull request #4393 from xiang90/fix_test
clientv3/integration: fix member remove
2016-02-02 21:10:40 -08:00
c7876d4111 clientv3/integration: fix member remove
Do not connect to the member to remove.
2016-02-02 20:49:00 -08:00
31c0c5181a storage: make unsync a watcherSetByKey 2016-02-02 20:09:35 -08:00
622bc0d8b7 Merge pull request #4390 from xiang90/watch
storage: remove unnecessary abstraction
2016-02-02 20:06:22 -08:00
8dc6248aa7 storage: add set delete 2016-02-02 19:28:42 -08:00
810c3e74a8 storage: remove unnecessary abstraction 2016-02-02 19:15:46 -08:00
79c07024fb Merge pull request #4389 from xiang90/watch
storage: add watchSet and watchSetByKey type
2016-02-02 19:13:04 -08:00
e5b35b82c5 storage: add watchSet and watchSetByKey type 2016-02-02 18:56:36 -08:00
2919be91b9 Merge pull request #4387 from heyitsanthony/integration-cluster-speedup
integration: decrease timeout for isMemberBootstrapped
2016-02-02 14:45:18 -08:00
9ae8d85049 integration: decrease timeout for isMemberBootstrapped
Spending seconds(!) when it would fail anyway.

integration/TestV3 (before): 100.670
integration/TestV3 (after): 29.571
2016-02-02 14:34:58 -08:00
83411b92b4 Merge pull request #4386 from xiang90/promote
integration: add test promote and move lease tests to lease_test.go
2016-02-02 14:06:48 -08:00
6f72b31316 integration: add test promote and move lease tests to lease_test.go 2016-02-02 13:45:11 -08:00
71e000de65 Merge pull request #4376 from heyitsanthony/txn-no-duplicate-putkey
etcdserver: reject v3 txns with duplicate put keys
2016-02-02 13:17:47 -08:00
c5c5063efe etcdserver: reject v3 txns with duplicate put keys
An API check to support PR #4363; bad requests didn't return an error.
2016-02-02 12:32:33 -08:00
20673e384a Merge pull request #4382 from xiang90/lease_keep_test
clientv3/integration: test lease keepalive
2016-02-02 12:01:22 -08:00
5f9f56ca17 Merge pull request #4383 from xiang90/client_no_end
clientv3: add no endpoint error
2016-02-02 12:00:44 -08:00
7a91108b91 clientv3: add no endpoint error 2016-02-02 11:01:58 -08:00
fd0e68d16b clientv3/integration: test lease keepalive 2016-02-02 10:59:22 -08:00
5f20aaa457 Merge pull request #4360 from heyitsanthony/v3-client-watcher
V3 client watcher
2016-02-01 23:39:30 -08:00
87ed04ea6f Merge pull request #4372 from gyuho/kv_delete
clientv3/integration: add TestKVDelete*
2016-02-01 23:30:11 -08:00
580c563ed6 clientv3: watcher implementation 2016-02-01 23:21:55 -08:00
826df1787a Merge pull request #4373 from heyitsanthony/clientv3-unix-endpoints
clientv3: support unix endpoints
2016-02-01 22:49:49 -08:00
3f29e730eb Merge pull request #4374 from xiang90/member_api
clientv3: implement cluster api
2016-02-01 22:49:43 -08:00
9afee37471 Merge pull request #4375 from xiang90/kvapi_no_retry
clientv3: do not retry on modifications
2016-02-01 22:49:18 -08:00
b74a42b286 clientv3: support unix endpoints 2016-02-01 22:24:42 -08:00
eb8ab3ace4 clientv3: synchronous lease Close 2016-02-01 22:24:42 -08:00
a9bd30b4af clientv3: do not retry on modifications 2016-02-01 21:54:40 -08:00
a25423ca99 clientv3: implement cluster api 2016-02-01 21:46:23 -08:00
e49ae8b03f clientv3/integration: add TestKVDelete* 2016-02-01 17:07:52 -08:00
24f5640d83 Merge pull request #4371 from gyuho/govet_lease
clientv3: fix shadowed variables in lease
2016-02-01 15:17:38 -08:00
d4438fbb97 Merge pull request #4370 from gyuho/kv_lease
clientv3/integration: TestKVPut with lease id
2016-02-01 15:15:01 -08:00
f7692cf5d2 clientv3: fix shadowed variables in lease 2016-02-01 15:08:24 -08:00
7d278ef6bb clientv3/integration: TestKVPut with lease id 2016-02-01 14:46:20 -08:00
0707261397 Merge pull request #4361 from gyuho/e2e
e2e: check regexp.MatchReader return, curl SSL issue
2016-02-01 13:23:32 -08:00
438fecebcd Merge pull request #4367 from xiang90/lease_test
Lease test
2016-02-01 13:20:25 -08:00
a8e72b6285 proxy: prints out when endpoints are found 2016-02-01 13:08:21 -08:00
bef7887c0d clientv3/integration: add basic lease test 2016-02-01 12:59:44 -08:00
2e051c1c61 e2e: check regexp.MatchReader return, curl SSL issue
1. proc.ExpectRegex returns the result of regexp.MatchReader,
which does not return error even if there is no match of regex.
This fixes it by checking the boolean value and if the boolean
value is false, it returns error.

2. Adds more tests and finishes coreos#4259.

3. When we do the regex match correctly, curl request through SSL
returns error. For the purpose of debugging, I changed it to log
without failing the tests. etcdctl with SSL works fine.

4. Add // TODO: 'watch' sometimes times out in Semaphore CI environment but
works fine in every other environments.

5. increase test time
2016-02-01 12:20:53 -08:00
8431801814 lease: fix lease init race 2016-02-01 12:07:34 -08:00
64766e9d6a Merge pull request #4366 from heyitsanthony/fix-rejectinsecure
integration: accept transient failure in TestGRPCRejectInsecureClient
2016-02-01 11:58:41 -08:00
7d8ae8af78 integration: accept transient failure state in TestGRPCRejectInsecureClient 2016-02-01 11:32:22 -08:00
220fba32a3 Merge pull request #4353 from xiang90/lease
clientv3: initial lease
2016-02-01 10:40:44 -08:00
f2c24dec05 clientv3: initial lease 2016-02-01 09:55:32 -08:00
595cfd9a11 Merge pull request #4364 from heyitsanthony/goword-typos
*: fix many typos
2016-01-31 22:24:43 -08:00
20461ab11a *: fix many typos 2016-01-31 21:42:39 -08:00
4ba1ec6a4d Merge pull request #4363 from xiang90/watch
storage: simplify watch store
2016-01-31 16:49:44 -08:00
611751aee2 storage: simplify watch store
We decided that we will not support modifing the same
key in one txn multiple times. That can simlify the current
code/design a lot.
2016-01-31 16:33:07 -08:00
1ab99206bc Merge pull request #4362 from gyuho/leaky_raft
raft: fix leaky goroutines in raft test
2016-01-31 12:55:54 -08:00
c827c7432c raft: fix leaky goroutines in raft test 2016-01-31 12:41:33 -08:00
cb7ebe81a8 Merge pull request #4359 from joshix/kayrus-deprcpeers
etcdctl: Changed default "endpoint" servers order
2016-01-30 21:20:10 -08:00
1b7b20f4f8 etcdctl: Changed default "endpoint" servers order
And added "DEPRECATED" note to a "peers" option (relates to d685135832)

Updated to amend commit.
2016-01-30 21:07:57 -08:00
42acd957a3 Merge pull request #4358 from gyuho/typo
*: fix minor typos, comments
2016-01-30 18:29:03 -08:00
9f7907cd30 Merge pull request #4357 from gyuho/govet
store: fix to 'go vet' errors
2016-01-30 18:24:19 -08:00
71c2a9bb3c *: fix minor typos, comments 2016-01-30 18:15:56 -08:00
8644ddea20 Merge pull request #4356 from gyuho/range
*: kv range to return current revision
2016-01-30 17:56:48 -08:00
445ff6970b store: fix to 'go vet' errors
This check has been introduced to go tip [1]. Just fixes by calling
the Index method.

[1]: 0f89efa255
2016-01-30 17:53:58 -08:00
f6215574f2 *: kv range to return current revision
This changes the behavior of KV's range and tx range to return
current revision rather than range revision. This makes populating
range response header easier.
2016-01-30 17:37:34 -08:00
6577df17d6 Merge pull request #4354 from coreos/revert-4348-clientv3_integration_test
Revert "*: TestKVRange to clientv3/integration, fix rev"
2016-01-29 18:21:13 -08:00
57dedd8c89 Revert "*: TestKVRange to clientv3/integration, fix rev" 2016-01-29 18:20:56 -08:00
f6031b9d11 Merge pull request #4349 from heyitsanthony/v3-client-conntls
V3 client TLS
2016-01-29 17:05:38 -08:00
ca9bd575b1 integration: v3 grpc tls tests 2016-01-29 16:38:52 -08:00
60c037f1c3 integration: add client tls support 2016-01-29 16:38:11 -08:00
4634874d99 etcdmain, integration, v3rpc: consolidate grpc server setup 2016-01-29 16:38:11 -08:00
563850bcc1 etcdmain: support v3 tls 2016-01-29 16:38:11 -08:00
4380617e1a tools/benchmark: support tls 2016-01-29 16:38:11 -08:00
781bf625af etcdctlv3: support tls
Fixes #4299
2016-01-29 16:37:59 -08:00
f37c896159 clientv3: support tls 2016-01-29 16:37:18 -08:00
f549dabe7f Merge pull request #4351 from gyuho/e2e
e2e: add more etcdctl tests
2016-01-29 16:33:40 -08:00
cf80035d72 Merge pull request #4348 from gyuho/clientv3_integration_test
*: TestKVRange to clientv3/integration, fix rev
2016-01-29 16:25:15 -08:00
bde5f7f20f e2e: add more etcdctl tests 2016-01-29 16:20:12 -08:00
69abdf8144 *: TestKVRange to clientv3/integration, fix rev
For https://github.com/coreos/etcd/issues/4338.
And resp.Header.Revision should be from the one in storage
when we just do range, because there is no storage data
change.
2016-01-29 16:12:21 -08:00
e5527914aa Merge pull request #4346 from gyuho/watch_timeout
e2e: increase watch timeout
2016-01-29 09:01:33 -08:00
73b71dc9a7 Merge pull request #4344 from shawnps/patch-3
raft: fix var name in comment
2016-01-28 23:27:20 -08:00
713b56c860 e2e: increase watch timeout 2016-01-28 23:24:04 -08:00
edd823bba6 raft: fix var name in comment 2016-01-29 16:18:47 +09:00
754967644d Merge pull request #4339 from shawnps/patch-2
clientv3/integration: add tt.key string formatting verb to Fatalf call
2016-01-28 23:09:06 -08:00
eebb31b0e7 Merge pull request #4340 from shawnps/patch-3
integration: add want IDs to Errorf calls
2016-01-28 23:04:34 -08:00
12556af26b Merge pull request #4343 from shawnps/patch-6
testutil: fix typo in comment
2016-01-28 23:03:29 -08:00
6e35f61b65 Merge pull request #4342 from shawnps/patch-5
logutil: fix typo in comment
2016-01-28 23:02:38 -08:00
0cbd5bfe7d testutil: fix typo in comment 2016-01-29 16:02:07 +09:00
6c451a44ca Merge pull request #4341 from shawnps/patch-4
rafthttp: fix typo in test comment
2016-01-28 23:01:58 -08:00
4e649970df logutil: fix typo in comment 2016-01-29 16:01:19 +09:00
96d82b40fb rafthttp: fix typo in test comment 2016-01-29 15:59:36 +09:00
7abbd31fcd integration: add want IDs to Errorf calls 2016-01-29 15:57:02 +09:00
1ac0ca5317 clientv3/integration: add tt.key string formatting verb to Fatalf call 2016-01-29 15:56:04 +09:00
e7f50d8444 Merge pull request #4336 from gyuho/clientv3_test
integration: V3 grpc with clientv3 (only Put)
2016-01-28 21:33:54 -08:00
1767788074 *: expose integration functions for clientv3 2016-01-28 21:21:34 -08:00
9a441c2c1a Merge pull request #4334 from heyitsanthony/fix-4333
etcdserver/test: use recorderstream in TestApplyRepeat
2016-01-28 18:20:00 -08:00
082a6c304e etcdserver/test: use recorderstream in TestApplyRepeat
was racing when waiting for the node commit

fixes #4333
2016-01-28 17:19:06 -08:00
127d717c0a Merge pull request #4335 from xiang90/ts
clientv3: threadsafe
2016-01-28 17:04:43 -08:00
85bfbfa5ad clientv3: threadsafe 2016-01-28 16:41:09 -08:00
26028ce44b Merge pull request #4331 from xiang90/c_t
clientv3: hook up KV and Txn
2016-01-28 16:30:41 -08:00
7b8cd274c9 Merge pull request #4330 from gyuho/proxy_e2e
e2e: etcdctl test for proxy no-sync
2016-01-28 16:13:44 -08:00
6491bae27f e2e: etcdctl test for proxy no-sync
For https://github.com/coreos/etcd/issues/3894.
2016-01-28 16:01:29 -08:00
eb03d48034 clientv3: hook up KV and Txn 2016-01-28 15:15:21 -08:00
aef77f9829 Merge pull request #4329 from xiang90/client_txn
clientv3: initial txn
2016-01-28 14:49:26 -08:00
92653dcbfb clientv3: initial txn 2016-01-28 14:27:42 -08:00
9842a3b84a Merge pull request #4328 from heyitsanthony/v3-client-conntimeout
clientv3: support connection timeout
2016-01-28 13:40:44 -08:00
64413927cc clientv3: support connection timeout 2016-01-28 13:25:45 -08:00
7cc02bc143 clientv3: fix vet warnings 2016-01-28 13:25:10 -08:00
993dc2b7db Merge pull request #4327 from gyuho/minor_govet
integration: fix shadowed variables (based govet)
2016-01-28 11:55:08 -08:00
599ecebdec integration: fix shadowed variables based on govet 2016-01-28 11:42:58 -08:00
5bd930c9d2 Merge pull request #4325 from xiang90/client_lease
clientv3: lease initial api
2016-01-28 10:49:50 -08:00
937eeafc3a Merge pull request #4323 from xiang90/client_watch
clientv3: initial watch API
2016-01-28 10:49:33 -08:00
6d41ccbe59 Merge pull request #4316 from xiang90/client_ops
clientv3: fill in kv ops
2016-01-28 10:49:18 -08:00
026c2e7a7c clientv3: lease initial api 2016-01-28 09:20:29 -08:00
c5b9433496 Merge pull request #4324 from jonboulle/master
client: fix typo in docstring (than -> then)
2016-01-28 18:09:42 +01:00
5490db7cca client: fix typo in docstring (than -> then) 2016-01-28 18:07:39 +01:00
205ffa5cb6 clientv3: initial watch API 2016-01-28 08:54:32 -08:00
2d2f14385d clientv3: fill in kv ops 2016-01-28 08:17:53 -08:00
7adb8442ba Merge pull request #4320 from sublee/fix-typo
documentation: fix typo "a etcd" -> "an etcd"
2016-01-28 13:36:15 +01:00
c4a0159601 documentation: fix typo "a etcd" -> "an etcd"
"a" is not a correct article for "etcd".
2016-01-28 19:19:32 +09:00
145d5b85a7 Merge pull request #4314 from xiang90/clientv3_impl
clientv3: use retryConnection
2016-01-27 22:52:31 -08:00
a3b7876a3c clientv3: use retryConnection 2016-01-27 22:31:15 -08:00
3df91f85c4 Merge pull request #4312 from heyitsanthony/v3-client-connretry
clientv3: connection retry and customizable endpoint selection
2016-01-27 20:57:38 -08:00
c338a47751 Merge pull request #4313 from xiang90/clientv3
etcdclientv3: setup initial structure
2016-01-27 20:50:40 -08:00
dba92346f3 etcdclientv3: setup initial structure 2016-01-27 20:36:36 -08:00
2db2f381fb clientv3: connection retry and customizable endpoint selection 2016-01-27 19:27:31 -08:00
ddaf023b9c Merge pull request #4295 from heyitsanthony/v3-recipes-leases
recipes: add election and double barrier recipes
2016-01-27 19:12:18 -08:00
6f0cc54541 contrib/recipes: add election and double barrier recipes
these recipes rely on leases so they weren't included in the last batch
2016-01-27 15:44:51 -08:00
163812246f Merge pull request #4306 from heyitsanthony/v3-client
replace raw v3 grpc connections with clientv3.Client
2016-01-27 14:52:40 -08:00
56fce9f386 contrib/recipes, integration: use clientv3
updating both together since there's a circular dependency
2016-01-27 14:37:51 -08:00
36d9942de1 Merge pull request #3536 from xiang90/client
clientv3: add initial kv api for client
2016-01-27 14:35:20 -08:00
e4dab0f40d clientv3: add initial kv api for client 2016-01-27 14:05:55 -08:00
a7b6bbff3f tools/benchmark: use clientv3 2016-01-27 12:13:17 -08:00
9a5a3ebc79 etcdctlv3: consolidate dial code; use clientv3 2016-01-27 12:13:17 -08:00
5ccf7f5151 clientv3: small client wrapper
mostly to standardize etcd grpc dials
2016-01-27 12:13:12 -08:00
0020c63dec Merge pull request #4301 from gyuho/no_pipe
etcdctl: use os.Stdout, os.Stderr directly for cmd
2016-01-27 11:10:34 -08:00
37290820de Merge pull request #4293 from bdarnell/bcast-after-commit
raft: Always call bcastAppend after maybeCommit
2016-01-27 09:58:22 -08:00
0f3b9c21b6 Merge pull request #4302 from srijs/patch-2
raft/doc: add notice about thread safety of messages
2016-01-27 09:41:50 -08:00
28585ddafa Merge pull request #4300 from gyuho/grpc_dial
*: pass WithInsecure to grpc.Dial for now
2016-01-27 09:13:36 -08:00
be21d90108 raft/doc: add notice about thread safety of messages
Fixes #4285
2016-01-27 20:18:19 +11:00
c8eebd0070 etcdctl: use os.Stdout, os.Stderr directly for cmd 2016-01-27 00:54:40 -08:00
fa21946267 *: pass WithInsecure to grpc.Dial for now
Related to https://github.com/coreos/etcd/issues/4299.
2016-01-27 00:24:03 -08:00
14255854d8 Merge pull request #4298 from heyitsanthony/fix-testapplysnapshot-race
etcdserver/test: synchronously wait on TestApplySnapshotAndCommittedE…
2016-01-26 21:18:09 -08:00
64596f0c49 etcdserver/test: synchronously wait on TestApplySnapshotAndCommittedEntries
Replaces the RecorderBuffered with a RecorderStream so Wait will block
waiting for updates to the etcdserver store.

Fixes #4296
2016-01-26 21:03:03 -08:00
6054748181 Merge pull request #4297 from ngaut/ngaut/raft-typo
raft: typo
2016-01-26 20:48:53 -08:00
751ab40f44 raft: typo 2016-01-27 12:35:14 +08:00
6d8b82f6ce Merge pull request #4294 from xiang90/member_api
*: finish member api implementation
2016-01-26 18:48:16 -08:00
36cc8446c7 *: finish member api implementation 2016-01-26 18:09:14 -08:00
02628298f4 Merge pull request #4292 from gyuho/gRPC_update
*: gRPC update
2016-01-26 17:55:48 -08:00
a35d5889f6 *: update gRPC, proto interface 2016-01-26 17:41:39 -08:00
a0a142f3e7 contrib/recipes: update gRPC, proto interface 2016-01-26 17:41:35 -08:00
652c01bffe tools/benchmark: update gRPC, proto interface 2016-01-26 17:41:32 -08:00
51e62aa007 integration: update gRPC, proto interface 2016-01-26 17:41:27 -08:00
1145414a08 etcdctlv3: update gRPC, proto interface 2016-01-26 17:41:23 -08:00
ad15bdcb07 etcdserver: update gRPC, proto interface 2016-01-26 17:41:19 -08:00
1c4c45cc7a scripts: update genproto for import issue 2016-01-26 17:41:12 -08:00
4bb0481115 Godeps: update gRPC w/ related packages 2016-01-26 17:41:08 -08:00
4c024b305f Merge pull request #4290 from heyitsanthony/fix-apply-noents
etcdserver: don't try to apply empty message list
2016-01-26 14:11:54 -08:00
04cece8f18 Merge pull request #4291 from bdarnell/remove-commit
raft: Remove redundant `raft.Commit` field.
2016-01-26 14:09:41 -08:00
0771d713e6 raft: Always call bcastAppend after maybeCommit 2016-01-26 16:55:47 -05:00
22925a1d2f raft: Remove redundant raft.Commit field.
Keeping this field in sync with `raft.raftLog.committed` was
error-prone, so instead we synthesize the `HardState` on demand.

Fixes #4278.
2016-01-26 15:18:55 -05:00
bd02d668c8 etcdserver: don't try to apply empty message list
If all messages have been applied, don't apply an empty messages list;
otherwise appliedi will update to 0 and etcd will panic.

Fixes #4278
2016-01-26 11:56:37 -08:00
179a8f9768 Merge pull request #4289 from xiang90/member_api
etcdserver: initial member api proto
2016-01-26 10:16:44 -08:00
864fc197c1 etcdserver: initial member api proto 2016-01-26 09:56:50 -08:00
59c6735c3c Merge pull request #4282 from xiang90/range_invalid
etcdserver: check invalid range in txn
2016-01-25 22:23:55 -08:00
dd1bbaa293 Merge pull request #4281 from mitake/remove-cached-auth-flag
etcdserver, auth: not cache a flag of auth status
2016-01-25 21:55:44 -08:00
a56387bc3e Merge pull request #4284 from xiang90/max_txn
v3rpc: check max ops in txn
2016-01-25 21:16:01 -08:00
c8bf77c722 v3rpc: check max ops in txn 2016-01-25 21:04:19 -08:00
128b5e7387 etcdserver: check invalid range in txn 2016-01-25 20:21:17 -08:00
2a9cccd659 Merge pull request #4283 from heyitsanthony/fix-stopdelay-leak
etcdserver: complete stopWithDelay on server shutdown
2016-01-25 20:11:55 -08:00
12f6b8e72d etcdserver: complete stopWithDelay on server shutdown
Was causing goroutine leaks on my machine.
2016-01-25 19:45:29 -08:00
b2d2c79a2f etcdserver, auth: not cache a flag of auth status
This commit removes a flag that indicates auth is enabled or disabled
because it doesn't have an invalidation mechanism.

Fixes https://github.com/coreos/etcd/issues/3601 and https://github.com/coreos/etcd/issues/3964
2016-01-26 11:46:25 +09:00
8199147cf8 Merge pull request #4246 from bdarnell/commit-after-remove-node
raft: Call maybeCommit after removing a node
2016-01-25 11:47:56 +08:00
b1a45fe1c8 Merge pull request #4274 from xiang90/leasehttp
leasehttp: move lease/http.go to its own pkg
2016-01-25 10:25:25 +08:00
8c9b8e91f2 Merge pull request #4275 from xiang90/fix_lease_restore
lease: fix restore
2016-01-25 10:21:09 +08:00
77cf05364d Merge pull request #4261 from gyuho/racey_e2e
*: detect leaky goroutines, fix leaks
2016-01-24 18:17:49 -08:00
e925a359a2 lease: fix restore 2016-01-25 10:06:14 +08:00
ef6320e638 etcdserver: make cluster checking interval shorter 2016-01-25 08:16:05 +08:00
1aa312fcce *: lease forwarding should resue transport 2016-01-25 06:56:07 +08:00
72ffa74476 pkg/transport: update timeout transport to reuse conn when timeout is not set 2016-01-25 06:55:54 +08:00
5e2dbadbc0 leasehttp: move lease/http.go to its own pkg 2016-01-25 06:09:54 +08:00
8905632837 Merge pull request #4272 from srijs/patch-2
raft: use configured logger in raft/node.go
2016-01-24 23:24:30 +08:00
4dd1718bde Merge pull request #4273 from srijs/patch-3
readme: link to raft.github.io instead of raftconsensus.github.io
2016-01-24 15:05:54 +01:00
02a34abf85 readme: link to raft.github.io instead of the old raftconsensus.github.io 2016-01-25 00:28:18 +11:00
896719c877 raft: use configured logger in raft/node.go
Those three log statements in node.go have not been using the logger that was passed via `raft.Config`, but instead the default raft logger. This changes it to use the proper logger.
2016-01-25 00:15:44 +11:00
96d2ee20e3 *: detect leaky goroutines, fix leaks
gexpect.Interact leaks. This adds ReadLine method to wait for the leaky
goroutine to accept an EOF.

Fixes https://github.com/coreos/etcd/issues/4258.

Reference: https://github.com/coreos/etcd/pull/4261#issuecomment-174198945.
2016-01-23 13:52:41 -08:00
5099bf6f7a Merge pull request #4269 from heyitsanthony/v3-reject-put-bogus-lease
etcdserver: return error when putting a key with a bad lease id
2016-01-22 21:25:17 -08:00
9572197aee etcdserver: return error when putting a key with a bad lease id 2016-01-22 20:47:31 -08:00
5a9f81b198 Merge pull request #4267 from gyuho/govet
pkg/testutil: fix unreachable govet complain
2016-01-22 15:33:55 -08:00
0d646a25ee pkg/testutil: fix unreachable go tool vet complain 2016-01-22 15:16:35 -08:00
c21d87354e Merge pull request #4266 from gyuho/minor_govet
integration: minor govet shadow fix
2016-01-22 14:43:13 -08:00
5e4113374b integration: minor govet shadow fix 2016-01-22 14:40:21 -08:00
53d6aede82 Merge pull request #3889 from gyuho/raft_doc.go_20151118
raft: doc, debugging instruction on MessageType
2016-01-22 14:22:49 -08:00
6c240b4037 Merge pull request #4262 from heyitsanthony/v3-lease-watch-expire
storage: publish delete events on lease revocation
2016-01-22 14:09:19 -08:00
ae05c87c2f Merge pull request #4238 from heyitsanthony/v3-recipes
contrib: v3 recipes
2016-01-22 14:08:21 -08:00
b07900ae03 contrib: v3 recipes
Concurrency recipes using the V3 API (sans leases).
2016-01-22 13:46:22 -08:00
5a967eb2a0 storage: publish delete events on lease revocation 2016-01-22 13:40:55 -08:00
53def2dc5e Merge pull request #4260 from heyitsanthony/v3-lease-forward-keepalive
lease: forward lease keepalive to leader
2016-01-22 12:53:17 -08:00
2e157530a0 etcdhttp, lease, v3api: forward keepalives to leader
keepalives don't go through raft so let follower peers announce
keepalives to the leader through the peer http handler
2016-01-22 12:40:40 -08:00
be7d573366 lease: store server-decided TTL in lease
If actual TTL is not stored in lease, the client will receive the correct
TTL and therefore won't be able to keepalive correctly.
2016-01-22 11:44:12 -08:00
2b54c5a977 Merge pull request #4253 from heyitsanthony/v3-lease-grant-consistency
lease: grant consistent lease IDs
2016-01-22 11:10:12 -08:00
9113a27bde lease: grant consistent lease IDs
When raft broadcasts a Grant to all nodes, all nodes must
agree on the same lease ID. Otherwise, attaching a key to
a lease will fail since the lease ID is node-dependent.
2016-01-22 09:43:39 -08:00
6413c96024 Merge pull request #4254 from gyuho/check_wait
client: do not timeout when wait is true
2016-01-21 18:59:03 -08:00
bbb7fb5a46 client: do not timeout when wait is true
Current V2 watch waits by encoding URL with wait=true.
When a client sets 'no-sync', it requests directly to
proxy and the proxy redirects it by cloning the request
object, which leads to cancel the original request when
it times out and the cloned request gets closed prematurely.

This fixes coreos#3894 by querying
the original client request in order to not use context timeout
when 'wait=true'.
2016-01-21 18:45:15 -08:00
1db0148ffd Merge pull request #4252 from gyuho/client_doc
*: move EndpointSelection doc to godoc
2016-01-21 10:02:32 -08:00
2a3bd01f58 *: move EndpointSelection doc to godoc
This merges two redundant documentation into one.
2016-01-21 09:48:05 -08:00
6eb0b35ed3 Merge pull request #4231 from mitake/go-client-doc
Documentation: add a doc for using the go client library
2016-01-21 00:46:14 -08:00
e196a0e8d2 Documentation: add a doc for using the go client library
This commit adds a document that provides tips of how to use the go
client library. Currently it describes how to use the
client.SelectionMode parameter that is added in
https://github.com/coreos/etcd/pull/4030.
2016-01-21 17:31:36 +09:00
1ec71c1cdc Merge pull request #4250 from mitake/ls-quorum
etcdctl: add an option to ls for consistent result
2016-01-20 21:15:35 -08:00
cae0577619 etcdctl: add an option to ls for consistent result
Like the commit 11f49a0960, this commit adds a new option "--quorum"
to etcdctl ls command. It is required for obtaining a consistent
result.
2016-01-21 14:03:10 +09:00
5184260907 Merge pull request #4249 from gyuho/minor_typo
*: minor typos, kill TODOs
2016-01-20 16:25:18 -08:00
835d824965 *: minor typos, kill TODOs 2016-01-20 16:21:39 -08:00
cd323e0ec8 Merge pull request #4242 from gyuho/unsynced_multi
integration: TestV3WatchMultipleEventsPutUnsynced
2016-01-20 15:39:49 -08:00
39116e2e20 integration: TestV3WatchMultipleEventsPutUnsynced 2016-01-20 15:31:13 -08:00
d26b1460c5 Merge pull request #4248 from gyuho/rest_of_unsynced_test
integration: add more tests for unsynced watch
2016-01-20 12:32:08 -08:00
96f646c586 integration: add more tests for unsynced watch
For https://github.com/coreos/etcd/issues/4216.
2016-01-20 12:13:58 -08:00
6a43aa28fe Merge pull request #4247 from gyuho/unsynced_cancel
integration: cancel operation for unsynced watcher
2016-01-20 11:47:31 -08:00
8c40232198 integration: cancel operation for unsynced watcher
Related https://github.com/coreos/etcd/issues/4216.
2016-01-20 11:28:31 -08:00
46bb2582fe raft: Call maybeCommit after removing a node.
removeNode reduces the required quorum size, so some pending entries may
be able to commit after it is applied.

Discovered in cockroachdb/cockroach#3642
2016-01-20 11:05:48 -04:00
c185bdaf95 raft: Improve formatting of DescribeMessage 2016-01-20 11:03:07 -04:00
092879291f Merge pull request #4228 from mitake/procfile-pprof
Procfile: enable pprof in Procfiles
2016-01-19 22:33:37 -08:00
72195afbc9 Merge pull request #4237 from gyuho/multi_stream
integration: add TestV3WatchMultipleStreams
2016-01-19 14:37:33 -08:00
12362d292d integration: add TestV3WatchMultipleStreams
Related https://github.com/coreos/etcd/issues/4216.
2016-01-19 14:27:14 -08:00
d2e35f68f9 Merge pull request #4235 from gyuho/watch_multi_synced
integration: watch test for multi-events with txn
2016-01-19 14:00:58 -08:00
a571f83343 Merge pull request #4232 from heyitsanthony/test-fmt-first
test: test fmt before running unit tests
2016-01-19 13:47:09 -08:00
166055b443 integration: watch test for multi-events with txn
Related to https://github.com/coreos/etcd/issues/4216.
2016-01-19 13:47:09 -08:00
de765ac7dd Merge pull request #4236 from heyitsanthony/fix-watch-test-race
integration: fix race in WatchFromCurrentRevision
2016-01-19 12:50:23 -08:00
7e0a5b8ed7 integration: fix race in WatchFromCurrentRevision
Since watching from current revision, keys should be put after the
watcher is registered or the test may time out. Shows up in CI.
2016-01-19 12:30:49 -08:00
63197782ea test: trigger formatting tests before unit tests
Don't waste time running full unit tests only to fail CI over fmt or vet.
2016-01-19 11:39:39 -08:00
7d9a88a687 test: refactor sorts of tests into separate functions 2016-01-19 11:39:31 -08:00
882d63226d Procfile: enable pprof in Procfiles
Procfiels are used for development purpose. So enabling pprof in
default would be confortable for developers.
2016-01-18 15:18:57 +09:00
9ca3c8e581 Merge pull request #4224 from heyitsanthony/v3-rangereq-more-flag
support V3 rangereq more flag and revision request flag
2016-01-17 22:16:33 -08:00
05531b4600 integration: test v3 RangeRequest 2016-01-17 22:03:08 -08:00
ccfd68a251 etcdserver: support Revision option in v3 RangeRequest 2016-01-17 21:45:22 -08:00
8df3f0c545 etcdserver: support 'More' flag for v3 RangeRequest 2016-01-17 21:45:22 -08:00
1090320bb2 Merge pull request #4227 from gyuho/wait_response
integration: use WaitResponse for watch tests
2016-01-17 16:32:32 -08:00
f9b505ae56 integration: use WaitResponse for watch tests 2016-01-17 14:11:30 -08:00
98dfdebf13 Merge pull request #4225 from gyuho/watch_test_multi
integration: add TestV3WatchMultiple
2016-01-16 20:32:26 -08:00
0f3573a57e integration: add TestV3WatchMultiple
For https://github.com/coreos/etcd/issues/4216.
2016-01-16 20:23:45 -08:00
22dd738228 Merge pull request #4223 from gyuho/watch_cancel_test
integration: watch cancel test
2016-01-15 17:23:25 -08:00
2535509811 integration: add TestV3WatchCancel
Related https://github.com/coreos/etcd/issues/4216.
2016-01-15 17:16:12 -08:00
01ba9960d9 Merge pull request #4196 from Timer/etcdctl-docs
Add docs for configuration flags and env vars
2016-01-15 16:59:44 -08:00
476178fce0 etcdctl: add docs for configuration flags and env vars 2016-01-15 19:46:29 -05:00
bc6613902f Merge pull request #4222 from heyitsanthony/concurrent-watch-testing
integration: submit keys concurrently with watcher streaming
2016-01-15 11:10:40 -08:00
be4466e331 Merge pull request #4215 from xiang90/fix_proxy
etcdmain: fix proxy srv lookup
2016-01-15 11:03:21 -08:00
9aea99cd6e integration: submit keys concurrently with watcher streaming
Tests for races between producer and consumer on watcher
2016-01-15 10:57:33 -08:00
9b5313a97c Merge pull request #4218 from gyuho/test_header_revision
integration: test header revision in v3 grpc
2016-01-14 21:42:11 -08:00
2f2b408686 integration: test header revision in v3 grpc
Related https://github.com/coreos/etcd/issues/4216.
2016-01-14 21:26:13 -08:00
2f9f4220c6 Merge pull request #4217 from heyitsanthony/start-store-on-rev1
storage: start initial revision at 1
2016-01-14 17:16:55 -08:00
ecba9b61cf storage: start initial revision at 1
When the start revision was 0, there was no way to safely watch
starting from the first store revision.
2016-01-14 17:05:56 -08:00
cf873bcf81 Merge pull request #4214 from gyuho/watch_integration_test
integration: add WatchFromCurrentRevision test
2016-01-14 16:56:56 -08:00
d036ac85cb integration: add WatchFromCurrentRevision test 2016-01-14 16:44:59 -08:00
f3daa9f677 etcdmain: proxy should only lookup srv if there is no existing cluster file 2016-01-14 11:23:36 -08:00
02ab7be106 Merge pull request #4211 from gyuho/stack_watch
*: FatalStack to stacktrace tests after timeout
2016-01-14 10:27:44 -08:00
497bbd3010 *: FatalStack to stacktrace tests after timeout
Related to https://github.com/coreos/etcd/issues/4065.
2016-01-14 10:20:14 -08:00
2eac21ae0a Merge pull request #4210 from xiang90/fix_panic
storage: fix panic in test
2016-01-14 08:05:46 -08:00
ec0877b239 Merge pull request #4212 from gyuho/typo_packages
*: fix minor typos
2016-01-14 13:29:52 +01:00
b6077f9d57 *: fix minor typos 2016-01-14 01:28:29 -08:00
f2b0689f74 storage: fix panic in test 2016-01-13 23:18:27 -08:00
84d7318820 Merge pull request #4208 from xiang90/fix_test
backend: make test more reliable
2016-01-13 22:52:15 -08:00
e1de19bf75 backend: make test more reliable 2016-01-13 22:00:25 -08:00
0f782762f4 Merge pull request #4179 from wangjia184/master
doc/libraries-and-tools.md: add .net client library
2016-01-13 21:19:44 -08:00
wj
5a3ba5202d doc/libraries-and-tools.md: add .net client library 2016-01-14 12:24:36 +08:00
6c82d768b2 Merge pull request #4201 from mitake/benchmark-pprof
tools/benchmark: add flags for pprof to storage put
2016-01-13 20:17:30 -08:00
1c802e9266 tools/benchmark: add flags for pprof to storage put
This commit adds flags for profiling with runtime/pprof to storage
put:
- --cpuprofile: specify a path of CPU profiling result, if it is not
    empty, profiling is activated
- --memprofile: specify a path of heap profiling result, if it is not
    empty, profiling is activated

Of course, the flags should be added to RootCmd ideally. However,
adding common flags that shared by children command requires the
ongoing PR: https://github.com/spf13/cobra/pull/220 . Therefore this
commit adds the flags to storage put only.
2016-01-14 13:10:35 +09:00
a8a786598d Merge pull request #4206 from xiang90/fix_test
storage: extend timeout for slow CI
2016-01-13 16:15:07 -08:00
0cba12d991 storage: extend timeout for slow CI
1. extend timeout

2. print out stacktrace. When it fails again, we can get more confidence that the
failure is caused by slow IO.
2016-01-13 16:04:19 -08:00
5f3f09f82d Merge pull request #4200 from mitake/deadcode
tools/benchmark: remove deadcode
2016-01-13 15:24:05 -08:00
9e11da50ad Merge pull request #4190 from heyitsanthony/v3-integration-test
integration: testing support for v3 grpc api
2016-01-13 14:46:11 -08:00
53186da0a9 integration: a few v3 grpc api tests 2016-01-13 14:24:27 -08:00
6949f052c4 integration: add support for grpc server and client 2016-01-13 14:20:26 -08:00
722fb43797 Merge pull request #4202 from gyuho/prefix_watch
storage: check prefix in unsynced
2016-01-13 11:32:43 -08:00
d2d70513a1 Merge pull request #4185 from xiang90/client-srv
*: support client srv target
2016-01-13 11:26:35 -08:00
4f427bca43 storage: check prefix in unsynced
Current syncWatchers method skips the events that have
prefixes that are being watched when the prefix is not
existent as a key. This fixes https://github.com/coreos/etcd/issues/4191
by adding prefix checking to not skip those events.
2016-01-13 11:21:47 -08:00
bfa21001a1 *: support client srv target 2016-01-13 11:12:15 -08:00
c59bc9c4db Merge pull request #4204 from gyuho/typo
client: keys.go minor typo
2016-01-13 11:11:50 -08:00
b47f721a98 integration: configure cluster with configCluster struct
makes discovery, tls, and v3 explicitly part of the cluster information
2016-01-13 11:09:13 -08:00
3ac8ff3a84 client: keys.go minor typo 2016-01-13 11:02:37 -08:00
f2a4993c11 Merge pull request #4187 from gyuho/store_stats
Documentation: stats/metrics reset on etcd restart
2016-01-13 09:53:17 -08:00
b6d5993121 Merge pull request #4193 from gyuho/etcdctl_help_doc
etcdctl, etcdctlv3: add help message for non-valid value arg
2016-01-13 09:52:59 -08:00
5fb26f2e8c Documentation: stats/metrics reset on etcd restart
Addressing https://github.com/coreos/etcd/issues/4035.
2016-01-13 09:51:13 -08:00
054db2e3cf etcdctl, etcdctlv3: add help message for non-valid value arg
Unix commands interprets argument value of first character '-'
as a flag. And this won't be fixed in our upstream CLI libraries.
This adds help message to show users workarounds.

Addressing https://github.com/coreos/etcd/issues/2020.
2016-01-13 09:25:24 -08:00
ca9ad6897a Merge pull request #4192 from heyitsanthony/gexpect-tests
e2e: etcd end-to-end integration tests
2016-01-13 09:10:29 -08:00
b35ab33045 Merge pull request #4155 from mitake/pprof
etcdmain: add options for pprof
2016-01-13 03:13:50 -08:00
16b63310b2 tools/benchmark: remove deadcode
The Execute() function is a deadcode. Let's remove it.
2016-01-13 16:57:53 +09:00
588f655b4e etcdmain: add an option for pprof
This commit adds a new option for activating profiling based on pprof
in etcd process.
 - -enable-pprof: boolean type option which activates profiling

For example, if a client URL is http://localhost:12379, users and
developers access heap profiler with this URL:
http://localhost:12379/debug/pprof/heap
2016-01-13 16:12:26 +09:00
b83c52888c Merge pull request #4199 from heyitsanthony/fix-recorder-datarace
testutil: fix data race in RecorderBuffered
2016-01-12 21:56:58 -08:00
6de07cf9ea e2e: etcd end-to-end tests
Uses gexpect to test the etcd binary directly. Tests #4135, #4171
2016-01-12 21:27:59 -08:00
54c905f87f testutil: fix data race in RecorderBuffered
Was accessing a shared data structure instead of the private copy.

Fixes #4198
2016-01-12 21:08:51 -08:00
da9378b7e2 Merge pull request #4194 from gyuho/etcdctl_check_key
client: add IsKeyNotFound function
2016-01-12 20:12:36 -08:00
f67f6d7c7c client: add IsKeyNotFound function
This can be used to check if an error is client.ErrorCodeKeyNotFound.
Related to https://github.com/coreos/etcd/issues/4080.
2016-01-12 20:04:08 -08:00
1df478ea5d Merge pull request #4195 from davygeek/master
follow golint notice replace '+=1' to '++'
2016-01-12 18:00:53 -08:00
194607812c raft: follow golint notice to replace +=1 with ++ 2016-01-13 09:39:00 +08:00
9b27198698 godeps: add gexpect and deps 2016-01-12 16:53:15 -08:00
42b5bc021a Merge pull request #4186 from xiang90/fix_store
store: handle watch dir removal correctly
2016-01-12 14:47:02 -08:00
efa9cd7e0c Merge pull request #4184 from heyitsanthony/v3-rangereq-sort
etcdserver: support sorted range requests in v3 api
2016-01-12 10:26:52 -08:00
3aa5cee1f3 Merge pull request #4188 from xiang90/lease_stop
*: stop lessor when etcdserver is stopped
2016-01-12 10:23:48 -08:00
82eeffbd58 etcdserver: support sorted range requests in v3 api
Fixes #4166
2016-01-12 10:08:30 -08:00
6b1d9fb7ce *: stop lessor when etcdserver is stopped 2016-01-12 10:06:11 -08:00
547250321b store: handle watch dir removal correctly 2016-01-11 22:42:56 -08:00
374b14e471 Merge pull request #4178 from xiang90/lease_keepalive
*: now lease keepAlive works on leader
2016-01-10 13:13:31 -08:00
59bf83c7f4 *: now lease keepAlive works on leader 2016-01-09 22:12:02 -08:00
20cdd7db8e Merge pull request #4173 from xiang90/lease_attach
support lease Attach
2016-01-09 11:10:45 -08:00
f01c8188f8 *: rename lease.DeleteableRange to lease.RangeDeleter 2016-01-09 11:01:58 -08:00
f5753f2f51 *: support lease Attach
Now we can attach keys to leases. And revoking the lease removes all
the attached keys of that lease.
2016-01-09 11:01:58 -08:00
133f46246e Merge pull request #4176 from xiang90/refactor
lease: remove minExpiry and add helper funcs
2016-01-08 14:40:26 -08:00
12912501bd lease: remove minExpiry and add helper funcs 2016-01-08 14:29:33 -08:00
0554a18060 Merge pull request #4175 from xiang90/lease_expire
*: revoke expired leases
2016-01-08 13:47:06 -08:00
2566699a48 *: revoke expired leases 2016-01-08 13:37:58 -08:00
f45a8fe623 Merge pull request #4174 from heyitsanthony/fix-limit-keepalive
etcdmain: support keep alive listeners on limit listener connections
2016-01-08 10:41:57 -08:00
7de0e9130c Merge pull request #4167 from xiang90/lease_promote
*: expose Lessor Promote and Demote interface
2016-01-08 10:38:08 -08:00
1814867733 Godeps: remove golang.org/x/net/netutil
Now using our own LimitListener to support KeepAlives.
2016-01-08 10:32:25 -08:00
811fbc5672 etcdmain: support keep alive listeners on limit listener connections
Fixes #4171
2016-01-08 10:11:31 -08:00
cb3ca4f8fb Merge pull request #4169 from gyuho/typo
*: fix minor typos
2016-01-08 11:20:59 +01:00
f76166a041 *: fix minor typos 2016-01-08 00:21:19 -08:00
a7287b6374 Merge pull request #4161 from gyuho/typo_in_benchmark
tools/benchmark/cmd: print error out to stderr
2016-01-07 18:50:09 -08:00
f5fa9b5384 *: expose Lessor Promote and Demote interface 2016-01-07 18:18:20 -08:00
99bee2fd29 Merge pull request #4162 from xiang90/lease
*: add support for lease create and revoke
2016-01-07 16:58:59 -08:00
d9ca929a33 *: add support for lease create and revoke
Basic support for lease operations like create and revoke.
We still need to:
1. attach keys to leases in KV implmentation if lease field is set
2. leader periodically removes expired leases
3. leader serves keepAlive requests and follower forwards keepAlive
requests to leader.
2016-01-07 16:39:39 -08:00
383e11d528 Merge pull request #4165 from heyitsanthony/benchmark-stddev
tools/benchmark: report standard deviation
2016-01-07 16:00:26 -08:00
187064187c tools/benchmark: report standard deviation 2016-01-07 15:30:23 -08:00
2ff95b68e7 Merge pull request #4163 from mordyovits/patch-1
storage: minor typo in metrics help field
2016-01-07 13:35:59 -08:00
0d01035693 Minor typo in metrics help field 2016-01-07 16:18:50 -05:00
cc39cde319 tools/benchmark/cmd: print error out to stderr 2016-01-07 12:55:26 -08:00
4d921ab0e4 Merge pull request #4159 from gyuho/kv_header
etcdserver/api/v3rpc: fill in KV ResponseHeader
2016-01-07 12:27:49 -08:00
5842177172 etcdserver/api/v3rpc: fill in KV ResponseHeader 2016-01-07 12:18:31 -08:00
6f39608624 Merge pull request #4160 from xiang90/fix_lease
lease: unlock before another batch operation
2016-01-07 11:20:31 -08:00
8774d53459 Merge pull request #4158 from heyitsanthony/nolease-to-leasepkg
lease: move storage.NoLease to lease package
2016-01-07 10:43:51 -08:00
f22ea70c14 lease: unlock before another batch operation 2016-01-07 10:41:16 -08:00
9e0378998b Merge pull request #4153 from xiang90/fix_listener
etcdmain: tls listener MUST be at the outer layer of all listeners
2016-01-07 10:36:24 -08:00
f9af744be3 lease: move storage.NoLease to lease package 2016-01-07 10:33:44 -08:00
1f97f2dc36 etcdmain: tls listener MUST be at the outer layer of all listeners
go HTTP library uses type assertion to determine if a connection
is a TLS connection. If we wrapper TLS Listener with any customized
Listener that can create customized Conn, HTTPs will be broken.

This commit fixes the issue.
2016-01-07 10:26:49 -08:00
db60cdc42c Merge pull request #4154 from xiang90/snapshot_from_backend
*: get snapshot from backend
2016-01-06 23:10:23 -08:00
43a777b7a2 *: get snapshot from backend
We should get snapshot from backend, not just KV.
We plan to store the lease data into backend too.
2016-01-06 22:40:23 -08:00
b42a0e4283 Merge pull request #4151 from xiang90/s
storage: support recovering from backend
2016-01-06 22:17:18 -08:00
1714290f4e storage: support recovering from backend
We want the KV to support recovering from backend to avoid
additional pointer swap. Or we have to do coordination between
etcdserver and API layer, since API layer might have access to
kv pointer and use a closed kv.
2016-01-06 21:16:55 -08:00
b546f4c2c2 Merge pull request #4152 from xiang90/fix_force
backend: create bucket should increase pending
2016-01-06 20:47:32 -08:00
5dd8af444a backend: create bucket should increase pending 2016-01-06 20:25:50 -08:00
f91d96c9a4 Merge pull request #4150 from gyuho/fix_arg_update_dir
etcdctl: get only the first argument for updatedir
2016-01-06 16:44:05 -08:00
dd02ec6554 etcdctl: ignore value in updatedir command
Fixes coreos#4145.
client.KeysAPI ignores value if SetOptions.Dir is true.
2016-01-06 16:37:04 -08:00
c70d533771 Merge pull request #4138 from gyuho/watchresponse_header
*: fill in WatchResponse.Header
2016-01-06 15:19:36 -08:00
366e7a879f *: fill in WatchResponse.Header
Related to coreos#3848.
2016-01-06 15:12:53 -08:00
ebbb91a713 Merge pull request #4147 from heyitsanthony/listener-unix-sockets
pkg/transport: support listeners on unix sockets
2016-01-06 12:41:38 -08:00
f2df87f3e4 pkg/transport: support listeners on unix sockets
Given unix://<socketname>, NewListener will listen on unix socket <socketname>.
This is useful when binding to tcp ports is undesirable (e.g., testing).
2016-01-06 12:09:05 -08:00
eab052d5c4 Merge pull request #4141 from ngaut/ngaut/refactor
raft: Rename q() to quorum() which is more readable
2016-01-06 07:32:39 -08:00
027dd6169b Merge pull request #4143 from siddontang/master
raft,rafthttp: fix typo
2016-01-06 00:24:28 -08:00
54a45ba2f5 *: fix typo 2016-01-06 16:17:02 +08:00
8ee232d4ec raft: Rename q() to quorum() which is more readable 2016-01-06 15:23:35 +08:00
45b9cb170d Merge pull request #4142 from gyuho/delete_test_file
storage: remove test file after test
2016-01-05 22:15:40 -08:00
ad29ba3073 storage: remove test file after test 2016-01-05 22:05:28 -08:00
82f2cd6cef Merge pull request #4140 from xiang90/storage
*: make backend outside kv
2016-01-05 20:34:17 -08:00
5dd3f91903 *: make backend outside kv
KV and lease will share the same backend. Thus we need to make
backend outside KV.
2016-01-05 19:55:29 -08:00
70d120e08e Merge pull request #4137 from xiang90/lease
lease: recovery leases from backend
2016-01-05 11:32:03 -08:00
9156e54f1f lease: recovery leases from backend 2016-01-05 11:21:11 -08:00
1e61243fd7 Merge pull request #4134 from xiang90/lease
lease: modify API and persist lease to disk
2016-01-05 10:30:52 -08:00
23ddb9ff30 Merge pull request #4126 from heyitsanthony/testutil-recorder-stream
remove WaitSchedule() from etcdserver tests
2016-01-05 10:19:14 -08:00
09b420f08c *: move leaseID typedef to lease pkg 2016-01-05 10:18:17 -08:00
25f82b25f7 lease: modify API and persist lease to disk 2016-01-05 10:09:42 -08:00
838328b057 etcdserver: fix racey WaitSchedule() tests to wait for recorder actions
Fixes #4119
2016-01-05 09:39:18 -08:00
384cc76299 pkg/testutil: make Recorder an interface
Provides two implementations of Recorder-- one that is non-blocking
like the original version and one that provides a blocking channel
to avoid busy waiting or racing in tests when no other synchronization
is available.
2016-01-05 09:39:18 -08:00
e1bf726bc1 *: split out etcdserver's test mockup objects to live in interfaces' packages 2016-01-05 09:39:13 -08:00
be57b6b10e Merge pull request #4133 from gyuho/event_map_lookup
storage: fix watchable_store notify to hash-lookup once
2016-01-04 22:46:37 -08:00
7339abc79e storage: fix watchable_store notify to hash-lookup once
We should just assign events and ok at first, and check the
boolean value, instead of looking up the map twice.
2016-01-04 22:34:48 -08:00
d9d1342869 Merge pull request #4132 from heyitsanthony/watchid-typedef
storage: change type of WatchIDs from int64 to WatchID
2016-01-04 20:02:26 -08:00
21a6ade53d storage: change type of WatchIDs from int64 to WatchID 2016-01-04 19:52:22 -08:00
e5e355242d Merge pull request #4130 from gyuho/remove_cancelfunc
*: remove CancelFunc return for Watch. Use Cancel for watch.
2016-01-04 16:22:44 -08:00
556d4a6932 *: remove CancelFunc return for Watch. Use Cancel for watch. 2016-01-04 16:17:55 -08:00
b3ad736d2a Merge pull request #4131 from xiang90/kv_lease
*: support put with lease
2016-01-04 16:05:35 -08:00
4336278b44 *: support put with lease 2016-01-04 15:54:06 -08:00
2e2b0ea9a1 Merge pull request #4128 from akolb1/akolb1-4127
storage/backend: disable MAP_POPULATE on Solaris
2016-01-04 14:53:40 -08:00
152dcdd04d storage/backend: disable MAP_POPULATE on Solaris 2016-01-04 14:42:57 -08:00
e2bd35ba1a Merge pull request #4129 from gyuho/licence_2016
header: change date to 2016
2016-01-04 14:13:46 -08:00
58112f3abe header: change date to 2016
Update LICENCE header year to 2016.
2016-01-04 14:05:22 -08:00
cfe23b886d Merge pull request #4125 from ngaut/ngaut/refactor
raft: Tiny refactor
2016-01-04 11:49:08 -08:00
b38dfda1c9 raft: Tiny refactor
Rename i to id since i looks like index which is confusing.
2016-01-04 21:20:54 +08:00
e0a06bb5d6 Merge pull request #4123 from ngaut/ngaut/typo
raft: typo
2016-01-03 20:27:41 -08:00
acee23112a raft: typo 2016-01-04 11:51:51 +08:00
bf9e2a550c Merge pull request #4122 from gyuho/watchid_events
*: WatchResponse for multiple Events with WatchID
2016-01-03 16:40:28 -08:00
6540f47dfa *: WatchResponse for multiple Events with WatchID
storage/storagepb: remove watchID from Event

storage: add WatchResponse to watcher.go to wrap events, watchID

storage: watchableStore to use WatchResponse

storage: kv_test with WatchResponse

etcdserver/api/v3rpc: watch to receive storage.WatchResponse type
2016-01-03 16:32:48 -08:00
c832d7f6e2 Merge pull request #4120 from xiang90/ctrl_w
*: support watcher cancellation inside watchStream
2016-01-03 09:14:12 -08:00
eda0eefc25 *: support watcher cancellation inside watchStream 2016-01-03 00:20:21 -08:00
94ac9ae2da Merge pull request #4118 from xiang90/ctrl_w
v3api: add support for sending watcher control response
2016-01-02 23:27:34 -08:00
ec12686233 v3api: add support for sending watcher control response 2016-01-02 22:31:22 -08:00
4fa0cd5765 Merge pull request #4117 from xiang90/rm_watching
storage: rename watching -> watcher
2016-01-02 21:00:02 -08:00
807db7e2aa storage: rename watching -> watcher 2016-01-02 20:20:22 -08:00
34187a4fbe Merge pull request #4114 from xiang90/r_watch_stream
*: rename watcher to watchStream
2016-01-02 18:29:18 -08:00
ee0b3f42ed *: rename watcher to watchStream
Watcher vs Watching in storage pkg is confusing. Watcher should be named
as watchStream since it contains a channel as stream to send out events.
Then we can rename watching to watcher, which actually watches on a key
and send watched events through watchStream.

This commits renames watcher to watchStram.
2016-01-02 16:03:57 -08:00
41771d9522 Merge pull request #4112 from xiang90/proto
*: update watch related proto
2016-01-01 13:10:19 -08:00
ac330bb7c9 *: update watch related proto
1. Add watch/cancel request
2. Add necessary fields in response to return watch error
3. Add watch_id into watch response
2016-01-01 10:22:21 -08:00
7dd599b69d Merge pull request #4091 from gyuho/watch_events_slice
storage: watch events in slice
2015-12-31 23:54:08 -08:00
37b643b11d etcdctlv3/command: watch command to receive events slice 2015-12-31 23:44:02 -08:00
b59c993681 storage: kv_test.go events slice 2015-12-31 23:44:02 -08:00
14a0268ebc storage: watchable_store_test.go events slice 2015-12-31 23:44:02 -08:00
0b01acf131 storage: watchable_store.go events slice 2015-12-31 23:44:02 -08:00
f568a1ccfc storage: watcher_test.go events slice 2015-12-31 23:43:59 -08:00
a74147384d Merge pull request #4070 from mitake/storage-bench
tools: a new tool for benchmarking storage backends
2015-12-31 22:26:46 -08:00
454865bd67 tools: a new tool for benchmarking storage backends
Current etcd repository has a test for benchmarking a storage backend
in storage/kvstore_bench_test.go. However, it is hard to test various
parameters (e.g. batch interval, a number of keys, etc) with the test.

This commit adds a new benchmarking subcommand "storage" to
tools/benchmark. It will encourage analysis of storage backends with
various parameter and complex workloads.

Exmaple usage:
$ ./benchmark storage put
total: 9.894173792s
average: 9.894173ms
minimum latency: 6.596991ms
maximum latency: 29.455695ms
2016-01-01 15:18:54 +09:00
5aded6cd77 storage: watcher.go events slice 2015-12-31 19:26:20 -08:00
8f03c600b5 etcdserver/api/v3rpc: watch.go with events slice 2015-12-31 19:25:15 -08:00
8da6e76588 etcdserver/etcdserverpb: rpc WatchResponse with events slice 2015-12-31 19:24:46 -08:00
0b2d31f3bc storage: decouple default parameters and storage creation
newStore() uses constants for some important parameters
e.g. batchInerval. It is not suitable for other storage users
(e.g. tools/benchmark). This commit decouples the default parameters
from storage creation. etcd should use a newly added function
newDefaultStore() for creating a store with default parameters.
2015-12-31 22:28:59 +09:00
73230f9603 Merge pull request #4108 from xiang90/proto
*: fix proto and regenerate all go files
2015-12-30 20:29:04 -08:00
1dc0e664f0 *: fix proto and regenerate all go files 2015-12-30 20:11:19 -08:00
4444d92032 Merge pull request #4105 from heyitsanthony/benchmark-put-seq-keys
tools/benchmark: support puts on sequential keys over a bounded keyspace
2015-12-30 17:04:37 -08:00
1689bb3f02 tools/benchmark: support puts on sequential keys over a bounded keyspace
This patch makes it possible to use benchmark to generate n keys and
make random updates to only those n keys.
2015-12-30 16:47:24 -08:00
c8a0cc80dc Merge pull request #4104 from xiang90/ctl
etcdctl: fix syncWithPeerAPI by breaking the loop when there is no error
2015-12-30 11:17:30 -08:00
34abead33e etcdctl: fix syncWithPeerAPI by breaking the loop when there is no error 2015-12-30 11:06:42 -08:00
795b824f4d Merge pull request #4100 from mitake/ignore-benchmark
tools/benchmark: ignore the binary "benchmark"
2015-12-29 23:19:28 -08:00
b97f78d356 tools/benchmark: ignore the binary "benchmark" 2015-12-30 16:02:52 +09:00
f19a07289a Merge pull request #4098 from gyuho/merge_log
*: use merge logger for repeating etcdserver error logs
2015-12-29 21:23:30 -07:00
8346a7c052 Merge pull request #4094 from heyitsanthony/send-merged-done-nowait
etcdserver: respect done channel when sleeping for snapshot backoff
2015-12-29 20:18:08 -08:00
8f943f2f45 etcdserver/etcdhttp: use MergeLogger to log etcdserver errors
Related https://github.com/coreos/etcd/issues/3812.
2015-12-29 20:00:52 -08:00
64032541c3 pkg/logutil: round off start time, add merge_logger_test.go 2015-12-29 20:00:46 -08:00
942b5570bd Merge pull request #4096 from heyitsanthony/serialize-applier-snapmerge
etcdserver: serialize snapshot merger with applier
2015-12-29 19:37:11 -08:00
4cd86ae1ef etcdserver: serialize snapshot merger with applier
Avoids inconsistent snapshotting by only attempting to
create a snapshot after an apply completes.

Fixes #4061
2015-12-29 18:38:39 -08:00
04ac8969a1 Merge pull request #3986 from mqliang/defer
refactor store/store.go
2015-12-29 14:42:11 -07:00
4b355bd81e Merge pull request #4093 from xiang90/rm_proto
doc: remove proto in rfc, link to proto file in codebase
2015-12-29 13:25:46 -08:00
c7c3bda8b9 etcdserver: respect done channel when sleeping for snapshot backoff 2015-12-29 13:23:41 -08:00
9d9680121c etcdserver/etcdserverpb: make rpc.proto updated 2015-12-29 12:58:14 -08:00
39ed73c290 doc: remove proto in rfc, link to proto file in codebase 2015-12-29 12:53:27 -08:00
d9d7137ea3 Merge pull request #4092 from xiang90/api
*: update api proto
2015-12-29 12:46:12 -08:00
1a0201a31a *: update api proto 2015-12-29 12:31:53 -08:00
d62edfb464 Merge pull request #4090 from xiang90/writable
etcdserver: always check if the data dir is writable before starting
2015-12-29 11:40:41 -08:00
150e646b05 etcdserver: always check if the data dir is writable before starting etcd 2015-12-29 11:29:01 -08:00
f1761798e9 Merge pull request #4089 from xiang90/fix
etcdserver: fix creating member dir
2015-12-28 23:37:50 -08:00
0f2675d9b6 Merge pull request #4060 from heyitsanthony/fix-etcdctl-err
etcdctl: return exitcode 2 if can't connect to any peer urls
2015-12-28 23:28:29 -08:00
aef55342d1 etcdsever: avoid creating member dir before finishing validate bootstrap
This commit fixes the issue of creating member dir before validating
the configuration. When member dir exists, it indicates the local etcd
process is a valid etcd member. So we should only create member dir
after we finish configuration validation, joining validation or
discovery validation.
2015-12-28 23:20:27 -08:00
eae52a3138 Revert "etcdserver: always remove member directory when bootstrap fails"
This reverts commit a7e443d641.
2015-12-28 23:16:08 -08:00
cd42c9139e Merge pull request #4087 from gyuho/delete_discovery_check
etcdserver: always remove member directory when bootstrap fails
2015-12-29 00:04:37 -07:00
4477ef636e etcdctl: return exitcode 2 if can't connect to any peers 2015-12-28 23:04:34 -08:00
a7e443d641 etcdserver: always remove member directory when bootstrap fails
This removes member directory when bootstrap fails including joining existing
cluster and forming a new cluster. This fixes https://github.com/coreos/etcd/issues/3827.
2015-12-28 22:56:03 -08:00
c3655cbfd9 Merge pull request #4084 from gyuho/revisioin_document
storage: add/fix revision/generation description
2015-12-28 20:45:36 -07:00
5284c1c3bb storage: add/fix revision/generation description
This adds some struct descriptions to revision/generation structs and corrects
some spelling errors.
2015-12-28 19:32:03 -08:00
f3b3557951 Merge pull request #4085 from gyuho/doc_iana
Documentation: clarification on official etcd ports
2015-12-28 18:13:25 -08:00
7c587e0855 Documentation: clarification on official etcd ports
This is for https://github.com/coreos/etcd/issues/3480.
This adds a notice that etcd officially use 2379 and 2380 for
client and server ports.
2015-12-28 16:29:19 -08:00
6c5dc28d0f Merge pull request #4043 from gyuho/storage_range_all_unsynced
storage: range all unsynced at once
2015-12-28 14:45:40 -07:00
0d7fb820c7 Merge pull request #4082 from gyuho/storage_test_cleanup
storage: clean up test variable names, minor typos in comments
2015-12-28 13:02:17 -07:00
d64eb94580 storage: clean up test variable names, minor typos in comments
This just changes variable name to be more consistent: `N` rather than `Size`.
And fix some minor grammatical errors.
2015-12-28 11:49:57 -08:00
ecc3e15a46 storage: delete RangeHistory
This has been replaced by operations inside `syncWatchings`.
2015-12-28 11:37:32 -08:00
78b0b8a4a0 storage: range all unsynced at once
This is for https://github.com/coreos/etcd/issues/3848.
It replaces RangeHistory method for more efficient event
sending.
2015-12-28 11:37:26 -08:00
570687a509 Merge pull request #4081 from heyitsanthony/benchmark-multi-ep
tools/benchmark: support connecting to several endpoints
2015-12-28 10:31:35 -08:00
8e728afa62 tools/benchmark: support connecting to several endpoints
--endpoints is comma separated but gRPC blocks forever on comma
separated lists. Instead, round-robin select endpoints when
creating new connections.
2015-12-28 10:22:33 -08:00
d07a9cd893 Merge pull request #4059 from xiang90/snap_log
rafthttp: better snapshot sending logging
2015-12-28 10:05:35 -08:00
466b33445f Merge pull request #4079 from gyuho/store_shadow
store: fix govet shadow on expiration variable
2015-12-28 11:03:57 -07:00
b072f0b048 store: fix expiration var shadowing, change test function names
Found at https://travis-ci.org/coreos/etcd/jobs/99087279#L298.
And changes test function names to make them clear.
2015-12-28 08:50:34 -08:00
aec356e416 Merge pull request #4064 from xiang90/reduce_fysnc
backend: do not commit unless there is a pending change
2015-12-28 07:31:50 -08:00
1238187b72 Merge pull request #4078 from jonboulle/master
docs: clarify CAS/CAD do not work on directories
2015-12-27 22:35:51 +01:00
216c6674ed docs: clarify CAS/CAD do not work on directories
As noted in #4075. There are numerous style issues with this document
but I don't want to go down that rabbit hole so this is an attempt at a
minimally invasive clarification.
2015-12-27 22:35:08 +01:00
729b530c48 Merge pull request #4071 from gyuho/store_event_node
store: clean up event.go, node.go and add tests
2015-12-25 21:42:50 -07:00
64e182c69e store: clean up event.go, node.go and add tests
Updates IsCreated logic on event.go. Cleans up node.go
and adds tests to it.
2015-12-25 13:25:12 -08:00
70bcde89bc Merge pull request #4073 from gyuho/remove_seed
storage: remove unnecessary math/rand seed
2015-12-25 19:14:35 +01:00
df0c2e6842 storage: remove unnecessary math/rand seed
As @jonboulle pointed out at
https://github.com/coreos/etcd/pull/4070/files#r48441847:

> math/rand is unrelated to crypto/rand; the latter reads from /dev/urandom and
> is relying on the kernel's PRNG. Just remove the seed entirely.
2015-12-25 09:55:11 -08:00
dac56faf61 Merge pull request #4030 from mitake/endpoint-selection
client: add a mechanism for various endpoint selection mode
2015-12-24 12:55:16 +01:00
ff319add53 Merge pull request #4066 from gyuho/tip_shadow
pkg/fileutil: fix error var shadow
2015-12-24 10:24:27 +01:00
8d368c4dba pkg/fileutil: fix error var shadow
Go tip complains about error variable shadowing at
https://travis-ci.org/coreos/etcd/jobs/98636879#L291-L292.
2015-12-23 23:56:26 -08:00
22b3b3e07a Merge pull request #4038 from AkihiroSuda/etcd-4007
pkg/fileutil: skip TestIsDirWriteable when running as root
2015-12-23 22:23:57 -08:00
058f1449d6 pkg/fileutil: skip TestIsDirWriteable when running as root 2015-12-24 14:52:40 +09:00
8bc59b66d1 backend: do not commit unless there is a pending change
Reduce the nubmer of fsync etcd issues when the cluster is
idle.
2015-12-23 18:58:37 -08:00
a46ffc60e5 client: add a mechanism for various endpoint selection mode
Current etcd client library chooses a default destination node from
every member of a cluster in a random manner. However, requests of
write and read (for consistent results) need to be forwarded to the
leader node as the nature of Raft algorithm. If the chosen node is a
follower, additional network traffic will be caused by the forwarding
from follower to leader.

Mainly for reducing the forward traffic, this commit adds a new
mechanism for various endpoint selection mode to the client library
which can be configured with client.Config.SelectionMode.

Currently, two modes are provided:
 - EndpointSelectionRandom: default, same to existing behavior (pick
   a node in a random manner)
 - EndpointSelectionPrioritizeLeader: prioritize leader, for the above
   purpose

I evaluated the effectiveness of the EndpointSelectionPrioritizeLeader
with 4 t1.micro instances of AWS (3 nodes for etcd cluster and 1 node
for etcd client). Client executes this simple benchmark
(https://github.com/mitake/etcd-things/tree/master/prioritize-leader-bench),
just writes 10000 keys. When SelectionMode == EndpointSelectionRandom
(default), the benchmark needed 1 min and 32.102 sec to finish. When
SelectionMode == EndpointSelectionPrioritizeLeader, the benchmark
needed 1 min 4.760 sec.
2015-12-24 11:02:40 +09:00
72e115ee6e Merge pull request #4062 from xiang90/fix_snap
*: fix snapshot sending cycle
2015-12-23 17:10:10 -08:00
3c17e45bcb Merge pull request #4063 from heyitsanthony/fix-shouldstop
etcdserver: stop if removed along with multiple conf changes
2015-12-23 16:46:18 -08:00
d7ad721ede etcdserver: stop if removed along with multiple conf changes
shouldstop would get clobbered when several conf changes are in an apply
2015-12-23 16:29:21 -08:00
4be152bb4f rework 2015-12-23 16:21:16 -08:00
9a51d40940 fix comment 2015-12-23 14:10:39 -08:00
ab31ba0d29 *: fix snapshot sending cycle 2015-12-23 13:58:57 -08:00
74dba2d4cf rafthttp: better snapshot sending logging
snapshot sending is an important event. We should always log it explicitly.
2015-12-23 12:36:07 -08:00
7e5b7cfc65 Merge pull request #4056 from heyitsanthony/benchmark-less-mem
tools/benchmark: stream results into reports
2015-12-23 11:51:13 -08:00
0c640d781c Merge pull request #4047 from heyitsanthony/test-activate-raftexample
test: activate tests on contrib/raftexample
2015-12-23 11:28:50 -08:00
382103af60 tools/benchmark: stream results into reports
Reports depended on writing all results to a large buffered channel and
reading from that synchronously. Similarly, requests were buffered the
same way which can take significant memory on big request strings. Instead,
have reports stream in results as they're produced then print when the
results channel closes.
2015-12-23 11:24:35 -08:00
58ac6aeb5a test: activate tests on contrib/raftexample
adds contrib/raftexample to integration tests and fixes two test races
2015-12-23 11:13:37 -08:00
3f81f020c1 Merge pull request #4050 from xiang90/fsync
snap: call fsync before close db file
2015-12-23 09:42:13 -08:00
45de4e918e Merge pull request #3935 from dgonyeo/master
scripts: rewrote build-aci to use acbuild
2015-12-23 18:37:38 +01:00
834c2cf7cf Merge pull request #4054 from jonboulle/master
raft: small typo fixes in raft package doc
2015-12-23 18:19:47 +01:00
b4c4146d6b Merge pull request #4051 from xiang90/log
rafthttp: log before receiving snapshot
2015-12-23 08:57:28 -08:00
94da4b9ee5 rafthttp: log before receiving snapshot
Database snapshot can be as large as 5GB. It is reasonable
to log before receiving it. Or the user might not know what
is happening and why etcd starts to use IO intensively.
2015-12-23 08:45:36 -08:00
5c65c393a5 raft: small typo fixes in raft package doc 2015-12-23 16:37:06 +01:00
53be8405f3 client: a new API for obtaining a leader node information 2015-12-23 22:54:04 +09:00
191c5ef9cb snap: call fsync before close db file 2015-12-22 22:43:05 -08:00
289de69632 Merge pull request #4048 from xiang90/util
etcdserver: move unti out of server.go
2015-12-22 15:41:39 -08:00
d6d12b4d86 etcdserver: move unti out of server.go
etcdserver file is messy enough. Let's make it be less messy.
2015-12-22 15:17:14 -08:00
59998dbc50 Merge pull request #3882 from colhom/etcd2-backup
contrib/systemd: etcd2-backup package and docs
2015-12-22 15:08:54 -08:00
c147da94a2 Merge pull request #4041 from heyitsanthony/v3-snapshot-low-latency
low latency V3 snapshot recovery
2015-12-22 15:03:35 -08:00
85cd4d9647 contrib/systemd: etcd2-backup package and docs
multi-node backup and restore procedures for etcd2 clusters, presented as systemd jobs.
2015-12-22 14:52:10 -08:00
aca0c466ed etcdserver: asynchronously notify applier when raft writes finish
The raft loop would block on the applier's done channel after
persisting the raft messages; the latency could cause dropped network
messages. Instead, asynchronously notify the applier with a buffered
channel when the raft writes complete.
2015-12-22 14:15:14 -08:00
9d05a0d959 etcdserver: apply v3 database updates outside server event loop
raft's applyc writes block on the server loop's database IO since
the next applyc read must wait on the db operation to finish.
Instead, stream applyc to a run queue outside the server loop.
2015-12-22 14:15:09 -08:00
23d645babd Merge pull request #4046 from heyitsanthony/etcdserver-server-select-refactor
etcdserver: refactor server.go select loop
2015-12-22 12:29:10 -08:00
7e00325fe9 etcdserver: refactor server.go select loop
splits out the apply case into smaller functions
2015-12-22 12:13:39 -08:00
79fa03081c Merge pull request #4045 from philips/add-raftexample-to-raft-docs
raft: add raftexample to the docs
2015-12-22 12:06:23 -08:00
c72e4ae112 raft: add raftexample to the docs
To help people wanting use this package get started point to the
raftexample package.
2015-12-22 12:04:39 -08:00
b79dae287d Merge pull request #4042 from jonboulle/master
pkg: fix tiny docstring typo in ioutil
2015-12-22 17:00:17 +01:00
50efd01e34 pkg: fix tiny docstring typo in ioutil 2015-12-22 16:37:22 +01:00
eaaf98348c Merge pull request #4040 from gyuho/godep_20151221
Godeps: add missing dependencies
2015-12-21 22:30:04 -08:00
293103cc24 Godeps: add missing dependencies
I reran Godep after this patch https://github.com/tools/godep/pull/352.
2015-12-21 22:20:07 -08:00
b1138a42a2 Merge pull request #4036 from gyuho/storage_test_unsynced
storage: add more tests for synced, unsynced for watchable store
2015-12-21 20:30:43 -08:00
28d0e473a7 storage: add more tests for synced, unsynced for watchable store
This adds more tests on functions that updates synced and unsynced in watchable
store. Preparatory change for https://github.com/coreos/etcd/issues/3848.
2015-12-21 20:20:08 -08:00
f3f5726b8a Merge pull request #4037 from xiang90/proxy
etcdmain: fix incomplete proxy config file
2015-12-21 16:37:55 -08:00
4bcd7587e2 etcdmain: fix incomplete proxy config file
etcd might generate incomplete proxy config file after a power failure.
It is because we use ioutil.WriteFile. And iotuile.WriteFile does
not call Sync before closing the file.
2015-12-21 16:15:00 -08:00
d639e4f7f6 Merge pull request #4033 from heyitsanthony/raftexample-tests
Raftexample tests
2015-12-21 13:14:28 -08:00
chz
63bc804253 contrib/raftexample: shutdown rafthttp on closed proposal channel
Otherwise listening ports leak across unit tests and ports won't bind.
2015-12-21 13:03:42 -08:00
chz
b73a11ff45 contrib/raftexample: follow pipeline guidelines closer
close raft commit channel before issuing raft error since it's done
sending
2015-12-21 13:03:42 -08:00
chz
b7cf2385e6 contrib/raftexample: add test, fix dead lock on proposal channel
deadlock if no leader; node selects on propc=nil and writes to Ready,
client blocks on propC in same select as Ready reader, and so progress
of raft state machine deadlocks.
2015-12-21 13:03:35 -08:00
2681137fe0 Merge pull request #4020 from xiang90/ctl_04
etcdctl: support etcd0.4
2015-12-21 12:55:03 -08:00
541f2e5200 etcdctl: support basic operations with etcd 0.4.
For CoreOS users, they will get a updated version of etcdctl without updating
the etcd server version. And the users cannot really control this behavior.
We do not want to suddenly break them without enough communication.

So we still want the most basic opeartions like get, set, watch of etcdctl2 work
with etcd 0.4. This patches solve the incompability issue.
2015-12-21 11:59:13 -08:00
5587c4aa9a client: support reset Endpoints.
ResetEndpoints is useful when the there is a scheduled cluster
changes or when manually manage the cluster without auto-sync
enabled.
2015-12-21 11:59:13 -08:00
7e26fe9c16 Merge pull request #4032 from gyuho/one_mutex_for_storage
storage: use only one mutex for store struct
2015-12-21 11:58:44 -08:00
84d777305d storage: use only one mutex for store struct
Mutex is a variable, which means there needs to be only one mutex
value per scope. We don't need a separate mutex inside store struct,
**if we assume that `TxnPut` and `TxnRange` are called ONLY ONCE
per transaction (between `TxnBegin` and `TxnEnd`)**, as documented.
2015-12-21 11:42:40 -08:00
2a351e62f1 Merge pull request #4024 from heyitsanthony/add-command-argusage
etcdctl: member add command argusage to help
2015-12-21 10:59:07 -08:00
c597d591b5 scripts: rewrote build-aci to use acbuild 2015-12-21 10:15:08 -08:00
2974c4ec27 etcdctl: fill out ArgsUsage fields for help
USAGE in help now names positional arguments (e.g., "member remove <memberID>"
instead of "member remove [arguments...]")

Fixes #4021
2015-12-21 09:05:37 -08:00
c4732eb6e1 Merge pull request #4028 from gyuho/storage_test_variable
storage: remove unnecessary test variable assignment
2015-12-20 15:33:52 -08:00
2377ef870a storage: remove unnecessary test variable assignment
There is no need to assign a separate variable since 'base' is already defined
as a local variable within the loop.
2015-12-20 14:23:27 -08:00
98c1745278 Merge pull request #4026 from jonboulle/master
tests: update + enable check for leaked goroutines
2015-12-20 20:31:15 +01:00
b126ff77fb tests: only check for go1.5+ once 2015-12-20 19:51:53 +01:00
d50fbe384a tests: ignore leaked readLoop on go <1.5 2015-12-20 19:51:06 +01:00
e1fe7350a2 tests: update + enable check for leaked goroutines
Go 1.4 landed a new testing.M type [1][1] which allows for start-up and
shutdown hooks when running tests. The standard library now uses this
for checking for leaked goroutines in net/http [2][2].

This patch essentially re-ports the updated code from the net/http test
(we were using an older version of it) - in detail:
- updates the test to use `TestMain` instead of relying on
  `TestGoroutinesRunning` to be implicitly run after all other tests
- adds a few new goroutines to the list of exceptions (the test itself,
  as well as the golang/glog package and pkg/log.MergeLogger, both of
  which spin off goroutines to handle log flushing/merging respectively)
- removes a couple of TODOs in the test for extra goroutines that's run
  after individual tests (one of these re-enables the http package's
  `.readLoop` and the other was an out-of-date TODO)
- re-enables the test

[1]: https://golang.org/pkg/testing/#M
[2]: https://github.com/golang/go/blob/release-branch.go1.4/src/net/http/main_test.go#L18
2015-12-20 19:51:06 +01:00
dd76ee5801 Merge pull request #4027 from jcderr/patch-1
Radius Intelligence Use Case
2015-12-20 10:48:04 -08:00
a5f9403f8f Update production-users.md
Adding use case for Radius Intelligence.
2015-12-20 10:12:48 -08:00
2e736b51cc Merge pull request #4025 from jonboulle/sjpotter-api-nits
docs/api: add version & health, split out members
2015-12-19 17:42:32 +01:00
c18549261f docs: split out members API into own document
Also changes a few references to settle consistently on "members API"
instead of "member API" or "member APIs".
2015-12-19 15:57:15 +01:00
899dc4a6a6 docs: move /version to other_apis and add /health
moved /version http endpoint to other_api document and added health with
an example
2015-12-19 15:57:01 +01:00
cfd030fabf Merge pull request #4014 from ppalucki/functional
tools: add functional tester with Docker
2015-12-19 15:17:13 +01:00
9ee9e552e6 Godep: update codegangsta/cli dependency
Update codegangsta/cli dependency to the newer version for ArgsUsage
2015-12-18 17:48:04 -08:00
4f5f999847 tools/functional-test: add docker support
Commit adds docker bits to run functional tester within containers.

requires:
- docker 1.9 (networking)
- docker-compose
2015-12-18 15:56:18 +01:00
bff857dc28 Merge pull request #4011 from heyitsanthony/raftexample
contrib: example key-value store using raft
2015-12-17 15:05:59 -08:00
1f858e10c8 contrib: example key-value store using raft 2015-12-17 14:41:37 -08:00
afee51eeda Merge pull request #4013 from mickep76/update-libraries-and-tools
libraries-and-tools: name change for etcd-export to etcdtool
2015-12-17 14:34:36 +01:00
e4e2a7933f libraries-and-tools: name change for etcd-export to etcdtool 2015-12-17 13:52:14 +01:00
9b0b15c9be Merge pull request #4006 from mitake/kvtest-deadlock
storage, test: unlock transaction in the retry loop
2015-12-16 18:06:14 -08:00
af2569c2d8 storage, test: unlock transaction in the retry loop 2015-12-17 10:35:03 +09:00
ea50389060 Merge pull request #4010 from gyuho/window_compile
storage/backend: fixes Windows compile error
2015-12-16 11:12:39 -08:00
928c0d3601 storage/backend: fixes Windows compile error
The type is "Options," not "Option" -- at least, in the vendored version of boltdb in the repository.
2015-12-16 11:10:46 -08:00
a907ca5e62 Merge pull request #4004 from mitake/go-vet-fix
raft: remove go vet compliants
2015-12-15 20:37:08 -08:00
9b2da76796 raft: remove go vet compliants 2015-12-16 13:29:23 +09:00
ee02b50c05 Merge pull request #4000 from xiang90/production_users
README: link to production users
2015-12-15 15:56:44 -08:00
7b90099526 README: link to production users 2015-12-15 15:54:59 -08:00
923d5cec5e production-users.md: add cycoresys.com 2015-12-15 15:50:45 -08:00
0c6d5c7c03 Merge pull request #3997 from stevenschlansker/opentable-prod
Add OpenTable to production-users.md
2015-12-15 15:47:40 -08:00
73c8e3f0ab Add OpenTable to production-users.md 2015-12-15 12:38:12 -08:00
1c559bdb33 store: refactor
use defer statement to update `Stats` and report R/W Sucess/Failure, so
that the logic of Store's CURD operation and `Stats` update logic can be
separated.
2015-12-15 16:50:02 +08:00
6f59a15e55 Merge pull request #3992 from xiang90/fix_rafthttp_test
rafhttp: make TestStreamWriterAttachOutgoingConn more robust
2015-12-14 21:00:33 -08:00
80541d74d0 rafhttp: make TestStreamWriterAttachOutgoingConn more robust 2015-12-14 17:06:38 -08:00
96731f4525 Merge pull request #3991 from xiang90/fix_lock
pkg/fileutil: make TestLockAndUnlock less flaky on CI
2015-12-14 11:58:14 -08:00
be3e87b238 pkg/fileutil: make TestLockAndUnlock less flaky on CI
CI is slow sometime. To make the test less flaky, we increases the
timeout. This does not affect the correctness, but the test might
take longer to finish or to fail.
2015-12-14 11:38:07 -08:00
607ec83f81 Merge pull request #3988 from philips/add-production-users-doc
Documentation: add production users doc
2015-12-14 07:41:29 -08:00
e39ad84440 Documentation: add production users doc
Add the first production user: discovery.etcd.io. We should encourage
the commnuity to start adding their stories to this doc.
2015-12-14 00:00:23 -08:00
0eb46eb145 Merge pull request #3987 from gyuho/storage_test
storage: newFakeStore to return only 1
2015-12-13 17:58:24 -08:00
891cdd56b4 storage: newFakeStore to return only 1
This changes newFakeStore function to return only 1 because two other arguments
are already in the first return storage struct.
2015-12-13 17:46:47 -08:00
0225644d04 Merge pull request #3981 from gyuho/govet
*: fix shadowed variables
2015-12-13 00:00:12 -08:00
d55ab7798b storage: change var names from 'index'
Having the same variable name as 'index' type
can be confusing and shadowing other variables.
This gives different variable names to 'index' variables.
2015-12-12 16:37:24 -08:00
8696a1509c raft/rafttest: fix shadowed variable 2015-12-12 09:38:26 -08:00
4e06510280 pkg/fileutil: fix shadowed variables 2015-12-12 09:38:26 -08:00
c48b0a5e18 etcdmain: fix shadowed variables
Fix for https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:38:26 -08:00
a4de207d53 wal: fix shadowed variables
Fixes for https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:38:26 -08:00
a45b902d12 store: fixes shadowed variables with go tool vet.
Fixes for https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:38:26 -08:00
4289871cef tools/function-tester: fix shadowed variables
Fixes for https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:38:20 -08:00
52d21331e2 storage: fixes shadowed variables
Fixes for https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:20:34 -08:00
0ff822bf22 etcdserver/auth: fix shadowed variables from go tool
Fixes for https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:20:26 -08:00
40b11038f2 etcdserver: fixes shadowed variables for go tool vet
Fix for https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:13:12 -08:00
bccc602c8f etcdctl/command: fix shawdowed error variable
This fixes https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:13:12 -08:00
88aec09ddf client: fixes for govet -shadow
This fixes for shadowed error variables found by go tip go tool vet.
Fixes for https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:13:07 -08:00
68a3962f64 Merge pull request #3980 from jonboulle/master
raft: update RecentActive name in comments
2015-12-11 15:11:40 -08:00
af9f352fe3 raft: update RecentActive name in comments
Noticed when retrospectively reviewing #3976 that a couple of places
were missed when the variable was renamed.
2015-12-11 15:06:11 -08:00
8eaa8f9e0b Merge pull request #3978 from xiang90/rh
rafthttp: snapshot sender cleanup
2015-12-11 13:53:02 -08:00
7d78e0c85e rafthttp: remove the unncessary TODO
The issue is not caused by this code, but by reading snapshot
from disk. etcd assumes the snapshot of v3 kv should live in
memory. If not, etcd does not work well anyway.
2015-12-11 09:37:41 -08:00
95c29838e3 rafthttp: move ReadCloser to ioutil 2015-12-11 09:37:41 -08:00
460873689e Merge pull request #3977 from xiang90/fix_todo
etcdsever: swap kv pointer atomically
2015-12-11 09:30:50 -08:00
2fc3320e59 rafthttp: kill the receiving body timeout TODO in snapshot sender 2015-12-10 22:42:17 -08:00
c4cbaf5c2a etcdsever: swap kv pointer atomically 2015-12-10 17:29:36 -08:00
791c5344b1 Merge pull request #3976 from xiang90/snap_fix
Only send snapshot when member is online
2015-12-10 17:01:50 -08:00
cc6d98bf89 etcdserver: only send snapshot when the member is active 2015-12-10 16:15:26 -08:00
9df46f9d6f raft: expose RecentActive in Progress 2015-12-10 12:17:18 -08:00
9b26753dbf Merge pull request #3970 from xiang90/snapshot
*: rewrite snapshot merging and sending for v3
2015-12-10 09:55:42 -08:00
fbcbfc49b8 Merge pull request #3975 from Masterlvng/fix-readme
README: corret Endpoints param
2015-12-10 07:53:20 -08:00
833c934bd4 Merge pull request #3972 from xiang90/fix_race
store: fix data race when modify event in watchHub.
2015-12-10 07:47:49 -08:00
938333a9fe client/README: correct Endpoints param 2015-12-09 20:49:52 -08:00
b3d9196021 Merge pull request #3973 from xiang90/purge_test
pkg/fileutil: make purge test more reliable
2015-12-09 11:01:47 -08:00
e93c07ba91 pkg/fileutil: make purge test more reliable 2015-12-09 10:34:38 -08:00
d7a027e476 store: fix data race when modify event in watchHub.
The event got from watchHub should be considered as readonly.
To modify it, we first need to get a clone of it or there might
be a data race.
2015-12-09 10:11:51 -08:00
23bd60ccce *: rewrite snapshot sending 2015-12-08 18:21:21 -08:00
9220a47c30 Merge pull request #3968 from sjpotter/fix-build
remove bash'ism
2015-12-07 21:17:01 -08:00
2c2fe7ee8e build: remove bash'ism
[[ is not supported by posix bourne shell so use a substring match that is
2015-12-07 21:05:55 -08:00
977d3615f7 Merge pull request #3952 from BramGruneir/snapshot
Ensure that Progress is not nil when a MsgSnapStatus comes in
2015-12-07 13:17:46 -08:00
1901a4c718 raft: Ensure that Progress is not nil when a MsgSnapStatus comes in.
This was causing some issues in cockroach cockroachdb/cockroach#2950
2015-12-07 16:01:18 -05:00
5a4a5998a3 Merge pull request #3960 from gyuho/genproto
storagepb: minor updates from genproto
2015-12-04 16:18:52 -08:00
bed6b90e61 storagepb: minor updates from genproto
I ran genproto with the most recent protocol buffer
and it adds one line of missing comment.
2015-12-04 16:16:54 -08:00
b806e510a9 Merge pull request #3958 from gyuho/build_gotip
build: parse go version at go tip
2015-12-04 13:18:07 -08:00
0473cb93ac build: parse go version at go tip
This parses go version when build is running
in moast recent go master branch.
2015-12-04 13:08:19 -08:00
127b529582 Merge pull request #3959 from xiang90/fix_storage_test
storage: make RestoreContinueUnfinishedCompaction more reliable
2015-12-04 13:03:29 -08:00
a0eca5fd37 storage: make RestoreContinueUnfinishedCompaction more reliable 2015-12-04 11:48:46 -08:00
e0e80b37f2 Merge pull request #3957 from gyuho/travis_matrix
travis, test: allow failures with gotip
2015-12-04 11:33:35 -08:00
bbdd3c5f0e travis, test: allow failures with gotip
This allows tests to fail with Go tip, because go tip branch might not be
stable. This replaces https://github.com/coreos/etcd/pull/3953.
2015-12-04 11:16:59 -08:00
769f874542 Merge pull request #3956 from mitake/test-gofmt
test: print diff with gofmt
2015-12-03 17:22:14 -08:00
7094c78dcd test: print diff with gofmt
Current test doesn't pass -d option to gofmt. Let's pass the option
for easy fix.

Example output:
Checking gofmt...
gofmt checking failed:
client/client.go
diff client/client.go gofmt/client/client.go
--- /tmp/gofmt741496847 2015-12-04 10:11:11.340651702 +0900
+++ /tmp/gofmt265273890 2015-12-04 10:11:11.340651702 +0900
@@ -41,7 +41,7 @@

 var DefaultTransport CancelableTransport = &http.Transport{
        Proxy: http.ProxyFromEnvironment,
-       Dial:(&net.Dialer{
+       Dial: (&net.Dialer{
                Timeout:   30 * time.Second,
                KeepAlive: 30 * time.Second,
        }).Dial,
@@ -265,7 +265,7 @@
                        return ErrNoEndpoints
                }

-               for i, _ := range c.endpoints {
+               for i := range c.endpoints {
                        if c.endpoints[i].String() == lu.String() {
                                c.pinned = i
                                break
2015-12-04 10:12:05 +09:00
8d4073d078 Merge pull request #3945 from xiang90/new_watch_bench
tools/benchmark: add watch subcommand.
2015-12-03 16:56:02 -08:00
c6430b3292 tools/benchmark: add watch subcommand.
Watch command run benchmark tests for watch releated operations:
1. watch keys 2. sending events to watchers.

To test 2, this test also puts keys into etcd cluster to trigger
event sending.

Besides the benchmark results showed at client side, the tester
can also monitor the server-side mem/cpu usage and also check
the metrics of slow watchers. If there are a lot of slow watchers,
it means etcd server is over-loaded by watchers.
2015-12-03 15:56:17 -08:00
7f534fd503 Merge pull request #3951 from gyuho/travis
travis: add Go tip for testing
2015-12-03 14:39:51 -08:00
8e2c430f52 travis: add Go tip for testing
It would be good to test etcd with the latest Go branch,
so that we can find bugs either in Go or etcd in advance.

Reference:
https://docs.travis-ci.com/user/languages/go
2015-12-03 14:36:35 -08:00
d817f885db raft: doc, debugging instruction on MessageType
This adds documentation on MessageType. Having clear explanation about
MessageType helps understand raft logic and debug etcd when there is a
message dropping. This is partially for coreos#3806.
2015-12-03 00:45:11 -08:00
4e5f20de3b Merge pull request #3948 from xiang90/refactor
etcdserver: refactor a for loop in recvSnap test
2015-12-02 15:45:19 -08:00
0708a5e50d etcdserver: refactor a for loop in recvSnap test 2015-12-02 15:41:03 -08:00
2696d6960b Merge pull request #3947 from xiang90/fix_purge
pkg/fileutil: make purgeTest more robust
2015-12-02 15:18:11 -08:00
77069ca16b pkg/fileutil: make purgeTest more robust
1. Add a few comments to the test.

2. Provide a more robust way to check the purging
result. Tolerate slow io operations.
2015-12-02 15:12:42 -08:00
67ffeee521 Merge pull request #3946 from xiang90/fix_snap_test
etcdserver: get rid of unreliable WaitSchedule
2015-12-02 15:01:20 -08:00
4dd502dbb3 Merge pull request #3940 from gyuho/add_map_test
storage: add tests for unsafeAddWatching
2015-12-02 14:19:58 -08:00
ff2e8b55ae storage: add tests for unsafeAddWatching
This adds map operation tests for unsafeAddWatching, which
could have been failed without https://github.com/coreos/etcd/pull/3939.
It tests if unsafeAddWatching is correctly updating synced map.
2015-12-02 14:18:07 -08:00
3ec3ffbef0 etcdserver: get rid of unreliable WaitSchedule
In this case, we know we are waiting for an action happened on
storage. We can do a busy wait instead of calling waitSchedule.

The test previously failed on CI with no observed actions.
2015-12-02 13:18:11 -08:00
dd733ca51d Merge pull request #3942 from ngaut/master
v3rpc: Tiny clean up
2015-12-01 21:12:03 -08:00
e142e073e8 v3rpc: Tiny clean up
unreachable code
2015-12-02 12:30:21 +08:00
14210cf8a7 Merge pull request #3939 from xiang90/fix_watch
storage: add missing return for unsafeAddWatching
2015-12-01 15:01:30 -08:00
9f908ce67f storage: add missing return for unsafeAddWatching 2015-12-01 14:55:20 -08:00
99e80ef60f Merge pull request #3937 from gyuho/proxy_typo
Documentation: minor typo in proxy.md
2015-12-01 09:55:36 -08:00
93240bd0f0 Merge pull request #3933 from ngaut/fix-shadow-variables
tools: Fix shadow variables and incorrect printing format.
2015-12-01 08:55:22 -08:00
7118363b20 Documentation: minor typo in proxy.md
This fixes a minor typo in proxy.md.
2015-12-01 08:38:37 -08:00
858857d701 Merge pull request #3936 from joshix/proxydoc-jx
Documentation/proxy: Explain more about Procfile sample.
2015-11-30 16:29:51 -08:00
f30ec0bfea Documentation/proxy: Explain more about Procfile sample.
Say what goreman is so it doesn't confuse.
2015-11-30 16:19:20 -08:00
d8798a0724 Merge pull request #3871 from gyuho/proxy_doc_improve_20151115
Documentation: clarify flag usage for proxy
2015-11-30 16:11:57 -08:00
27831f022d Merge pull request #3934 from xiang90/new_benchmark_tool
tools: rewrite benchmark tool
2015-11-30 14:32:59 -08:00
367b7325c8 Documentation: clarify flag usage for proxy
This is for coreos#3740. Some users find
`advertise-client-urls` and `initial-cluster` flags confusing to set up a
proxy. This clarifies why we need both flags. And add summary to proxy.md
2015-11-30 14:07:06 -08:00
faff00d19e tools: rewrite benchmark tool 2015-11-30 11:52:43 -08:00
232439191c tools: Fix shadow variables and incorrect printing format. 2015-11-30 20:13:29 +08:00
d705df047b Merge pull request #3922 from gyuho/etcdctlv3_with_cobra
etcdctlv3: use spf13/cobra for cli interface
2015-11-27 14:35:40 -08:00
e8eb3d7744 Merge pull request #3927 from nordligulv/patch-1
client: fix goroutine leak in unreleased context
2015-11-27 10:38:40 -08:00
cb9a3e04b1 client: fix goroutine leak in unreleased context
If headerTimeout is not zero then two context are created but only one is released.
cancelCtx in this case is never released which leads to goroutine leak inside it.
2015-11-27 19:44:38 +03:00
b7647e0b55 etcdctlv3: use spf13/cobra for cli interface
This replaces codegansta/cli with spf13/cobra base on
this guideline: https://github.com/coreos/docs/blob/master/golang/README.md#cli.
2015-11-26 08:01:09 -08:00
a423a55b14 Merge pull request #3857 from es-chow/remove-multinode-goroutine
raft: add an thread-unsafe Node: RawNode
2015-11-26 07:52:08 -08:00
5bc56786dc raft: add RawNode which is a thread-unsafe node without goroutine and remove MultiNode 2015-11-26 17:14:14 +08:00
a6bb74e9ff Godeps: add spf13/cobra for etcdctlv3 2015-11-25 14:05:33 -08:00
27a243c2aa Merge pull request #3923 from gyuho/duplicate_exit
etcdctl: remove duplicate exit line
2015-11-25 09:45:02 -08:00
e8215cc577 etcdctl: remove duplicate exit line
`handleError` already exits with the exit code in arguments.
`os.Exit(1)` is never executed in this case.
2015-11-25 09:41:27 -08:00
0777cda4ea Merge pull request #3921 from barakmich/fix_issue_3920
etcdserver: Fix panic for v3 transaction compares on non-existent keys
2015-11-24 18:35:23 -08:00
452e5bffc0 etcdserver: Fix panic for v3 transaction compares on non-existent keys
Fixes #3920
2015-11-24 16:49:45 -05:00
9d7be9ec6f Merge pull request #3917 from xiang90/raft_stepdown
raft: support quorum check when raft is leader
2015-11-24 10:15:01 -08:00
a8cc1570d0 raft: support quorum check when raft is leader
If quorum check fails, the leader will step down to follower.
2015-11-24 09:36:37 -08:00
2762e1f3f7 Merge pull request #3918 from gyuho/V3Procfile
V3DemoProcfile: use double dash
2015-11-23 23:32:33 -08:00
7b90faafad V3DemoProcfile: use double dash
This just makes the V3DemoProcfile flags consistent with the other Procfile.
(Makes the single dash to double dash)

Related to https://github.com/coreos/etcd/pull/3911.
2015-11-23 23:27:30 -08:00
31ac6ad448 Merge pull request #3915 from philips/add-bdarnell
MAINTAINERS: add Ben Darnell
2015-11-23 21:03:22 -08:00
1a3092b954 MAINTAINERS: add Ben Darnell
Add Ben Darnell as a maintainer because of his ongoing and significant contributions to the raft package in this repo.
2015-11-23 17:22:43 -08:00
b31b946a08 Merge pull request #3913 from xiang90/update_doc
doc: talk about update client urls in reconf doc
2015-11-23 15:32:32 -08:00
c60933ebd9 doc: talk about update client urls in reconf doc 2015-11-23 15:32:11 -08:00
6df57cdcfa Merge pull request #3911 from gyuho/proc_double_dash
Procfile: change it to double-dash in Procfile
2015-11-23 13:05:27 -08:00
b83b0af41f Procfile: change it to double-dash in Procfile
This makes flags to etcdmain consistent with man page in help.go. The standard
Go flag package supports both '-' and '--', different than most of CLI
packages, but etcdctl with codegansta/cli uses double-dash('--'), which
sometimes gets confusing, especially to new users.
2015-11-23 12:58:21 -08:00
d435d443bb Merge pull request #3895 from yichengq/storage-watchid
storage: add watch ID to identify watchings
2015-11-22 22:15:59 -08:00
deb1da5f57 storage: add watch ID to identify watchings
One watcher includes multiple watchings, and their events are
sent out through one channel. For the received event, user would like to
know which watching it belongs to.

Introduce a watch ID. When watching on some key, user will get a watch
ID. The watch ID is attached to all events that is observed by this
watch.
2015-11-21 11:19:17 -08:00
2de9a5bbd0 Merge pull request #3899 from gyuho/3859_synced_map
storage: use map for watchableStore synced
2015-11-21 08:06:00 -08:00
48aebd9b09 storage: use map for watchableStore synced
This is for coreos#3859 switching slice to map for synced watchings.
For a large amount of synced watchings, map implementation performs better.
When putting 1 million watchers on the same key and canceling them one by
one: original implementation takes 9m7.268221091s, while the one with map
takes only 430.531637ms.
2015-11-21 00:42:09 -08:00
31574cb9da Merge pull request #3905 from xiang90/etcdctl_health
etcdctl: cluster health exit with non-zero when cluster is unhealthy
2015-11-20 14:38:18 -08:00
37b34b334b Merge pull request #3887 from ypu/flags
etcdmain: Add max-snapshots and max-wals to help
2015-11-20 14:20:57 -08:00
a211ba3361 Merge pull request #3890 from gyuho/pipeline_full_message
rafthttp: more detailed logs when filled-up buffer
2015-11-20 14:09:34 -08:00
e39206e084 etcdctl: cluster health exit with non-zero when cluster is unhealthy 2015-11-20 13:51:31 -08:00
82b83cad43 Merge pull request #3904 from coreos/jonboulle-patch-2
MAINTAINERS: remove blake, fix xiang's handle
2015-11-20 13:30:46 -08:00
6fae5f5a0a MAINTAINERS: remove blake, fix xiang's handle 2015-11-20 13:26:45 -08:00
11d00c7919 Merge pull request #3897 from xiang90/fix_watch
v3rpc: do not send closing event
2015-11-20 09:40:46 -08:00
b104df4b17 Merge pull request #3898 from mitake/get-quorum
etcdctl: a new option for quorum get
2015-11-20 08:08:49 -08:00
b868f4b1b1 v3rpc: report eventReceived correctly 2015-11-19 22:44:46 -08:00
11f49a0960 etcdctl: a new option for quorum get
Current etcdctl seems to lack an option for specifying quorum flag for
GET. This commit adds the option.
2015-11-20 14:09:50 +09:00
3cf90a4dff v3rpc: do not send closing event
When a watch stream closes, both of the watcher.Chan and closec
will be closed.

If watcher.Chan is closed, we should not send out the empty event.
Sending the empty is wrong and waste a lot of CPU resources.
Instead we should just return.
2015-11-19 17:56:15 -08:00
c400d05d0a Merge pull request #3892 from xiang90/fix_snapshot_handling
etcdserver: handle incoming v3 snapshot correctly
2015-11-19 12:18:18 -08:00
cf2d20c5c9 Merge pull request #3851 from yichengq/storage-kv-data
storage: save the KeyValue instead of Event in backend
2015-11-19 10:24:50 -08:00
1214f77519 storage: set revBytes capacity to avoid malloc when appending mark
This is a performance optimization.
2015-11-19 09:53:31 -08:00
f62e0ced9b Merge pull request #3893 from coreos/jonboulle-patch-1
docs/benchmarks: small fix in memory benchmark
2015-11-18 21:02:52 -08:00
ddc4f8bd45 etcdmain: Add max-snapshots and max-wals to help
Based on the configuration doc, seems these two flags are missing
in the help. So add them and the descriptions are from config.go in
the same directory.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2015-11-19 11:58:00 +08:00
6f3ce70b46 docs/benchmarks: small fix in memory benchmark 2015-11-18 19:20:18 -08:00
a07e4bb6e2 etcdserver: handle incoming v3 snapshot correctly
1. we should update all kv reference (including the
on in snapStore).

2. we should first restore a new KV and then close
the old one asynchronously.
2015-11-18 16:07:41 -08:00
6aa559f93d rafthttp: more detailed logs when filled-up buffer
This adds more detailed explanation about why some messages got dropped to help
users debug. This is for https://github.com/coreos/etcd/issues/3806.
2015-11-18 14:17:43 -08:00
33065739df Merge pull request #3782 from gyuho/doc.go_for_package_description
*: add missing package descriptions
2015-11-18 11:32:37 -08:00
81229dbea9 *: add missing package descriptions
This adds and updates package descriptions in etcd projects.
And also deletes some duplicate LICENSE statements.
2015-11-17 20:54:10 -08:00
2f74f76025 storage: remove the event concept from key-value layer
The point is to decouple the key-value storage layer and the
event notification layer clearly. It gives the watchableKV the
flexibility to define whatever event structure it wants without
breaking the ondisk format at key-value storage layer.

Changes:

1. change the format of key and value stored in backend

Store KeyValue struct instead of Event struct in backend value for
better abstraction as xiang suggests. And record the corresponded
action in the backend key.

2. Remove word 'event' from functions
2015-11-17 20:35:49 -08:00
c4672ced3e Merge pull request #3885 from joshix/prodready
README: Outright production-readiness
2015-11-17 18:18:16 -08:00
833f0388cd README: Outright production-readiness
State outright that etcd is used in production and ready for more of same.

Supersedes #3884.

Adopt #3884 in spirit, but directly in README as jonboulle suggested.

Delete Documentation/production-ready.md.
2015-11-17 18:05:31 -08:00
14c8a1c400 Merge pull request #3883 from gyuho/raft_typo
raft: minor typo in progress.go
2015-11-17 14:22:35 -08:00
e1c108e604 raft: minor typo in progress.go
Fixes a minor typo.
2015-11-17 14:21:35 -08:00
db4dcbf827 Merge pull request #3881 from xiang90/godep
Godeps: add LICENSE file for ugorji/go
2015-11-17 13:38:06 -08:00
0f339aaf2d godep: update godep 2015-11-17 13:18:24 -08:00
c0353697da Merge pull request #3880 from xiang90/fix_stop
etcdmain: fix unstoppable startEtcd function
2015-11-17 09:18:27 -08:00
9e4a003fb0 etcdmain: fix unstoppable startEtcd function
We should wrap the blocking function with a closure. And first
creates a go routine to execute the function. Or the inner function
blocks before creating the go routine.
2015-11-17 09:04:00 -08:00
8af76115cb Merge pull request #3873 from yichengq/func-long-timeout
tools/etcd-tester: extend timeout for stresser
2015-11-17 07:59:41 -08:00
08dc70cc0f Merge pull request #3875 from xiang90/fix_txn
etcdserver: start real txn for txn request
2015-11-16 21:16:20 -08:00
b4abe5b584 etcdserver: start real txn for txn request
We should open real txn for applying txn requests. Or the intermediate
state might be observed by reader.

This also fixes #3803. Same consistent(raft) index per multiple indenpendent
operations confuses consistentStore.
2015-11-16 21:11:27 -08:00
5d0268aa2e Merge pull request #3877 from bdarnell/campaign-while-leader
raft: no-op instead of panic for Campaigning while leader
2015-11-16 19:59:34 -08:00
fbeb58d265 raft: no-op instead of panic for Campaigning while leader
We need to be able to force an election (on one node) after creating a
new group (cockroachdb/cockroach#1384), but it is difficult to ensure
that our call to Campaign does not race with an election that may be
started by raft itself. A redundant call to Campaign should be a no-op
instead of a panic. (But the panic in becomeCandidate remains, because
we don't want to update the term or change the committed index in this
case)
2015-11-16 21:44:14 -05:00
5fa875fb5d Merge pull request #3876 from jonboulle/master
scripts: clean up genproto
2015-11-16 16:43:11 -08:00
dd0932a78d scripts: clean up genproto
Rather than copying in .proto files, use the same symlink
trick we do for doing the actual etcd build.

Also check for exact version of protoc early on.
2015-11-16 15:26:22 -08:00
32460538ba Merge pull request #3862 from xiang90/watch_bench_doc
doc: add etcd3 watch benchmark doc
2015-11-16 12:14:19 -08:00
dfc7cc7a62 tools/etcd-tester: extend timeout for stresser
Extend the timeout from 1s to defaultRequestTimeout 5s.

The 1s may bring unwanted burden to the target member. If the member is
busy at recovering, it has limited bandwidth for client requests. A
short timeout at client side will retry quickly while keeping the
on-going connections. Thus, etcd will queue lots of requests and
connections and takes long time to clear them. This finally causes the
timeout of member health check.

This problem is a general one that how etcd handles amounts of requests
at the same time in a good way. We don't plan to address it at current
stage.
2015-11-16 11:47:08 -08:00
6c0f14cefc Merge pull request #3870 from yichengq/fix-raft-log
raft: fix print format for term in one log line
2015-11-15 20:31:18 -08:00
3a65442d7d raft: fix print format for term in one log line
`term` should be printed in decimal representation instead of
hexadecimal one.
2015-11-15 20:26:16 -08:00
fdd87cd899 Merge pull request #3868 from xiang90/fix_auth_guest
auth: use canonical path for pre-defined guest role
2015-11-15 19:17:16 -08:00
a1616afc5d auth: use canonical path for pre-defined guest role 2015-11-15 17:58:09 -08:00
6bdc81d979 Merge pull request #3865 from gyuho/map_populate_for_unix
storage/backend: support MAP_POPULATE for unix
2015-11-15 16:53:32 -08:00
7638423f85 storage/backend: support MAP_POPULATE for unix
This adds build constraints in order to pass memory-map flags to bolt.Option.
If backend package passes syscall.MAP_POPULATE flag, the boltdb does read-ahead
which speeds up entire-database read, which then leads to faster storage
Restore. Benchmark result shows for 4GB, it opens and loads 6x faster in SSD,
and 12x faster in HDD. For 2GB, 1.6x faster with MAP_POPULATE in SSD.
2015-11-15 16:47:38 -08:00
37d3d20211 doc: add etcd3 watch benchmark doc
The primary goal of this doc is to confirm the memory
consumption of watch is as expected. Each connection
consumes O(10kb) of memory. Each stream consumes O(10kb)
of memory. Each watching consumes < O(1kb) of memory.

Then when you have a large number of watching with small
number of connections and streams, the ave memory consumption
per watch will be O(1kb).
2015-11-15 16:38:09 -08:00
185097ffaa Merge pull request #3860 from gyuho/typo_in_wal
wal: minor typo in wal pkg
2015-11-12 16:14:16 -08:00
55adfcb428 wal: minor typo in wal pkg
Fixes a minor typo in wal.go.
Thanks!
2015-11-12 15:23:12 -08:00
5acf5579b7 Merge pull request #3858 from gyuho/godep_bolt_20151112
Godeps: update boltdb/bolt for MAP_POPULATE
2015-11-12 13:17:26 -08:00
b4e0dbe721 Godeps: update boltdb/bolt for MAP_POPULATE
This is for https://github.com/boltdb/bolt/pull/455.
2015-11-12 12:25:37 -08:00
de02254659 Merge pull request #3853 from xiang90/lease_new
lease: delete items when the lease is revoked.
2015-11-11 22:13:37 -08:00
bf3bc0ed6b lease: delete items when the lease is revoked.
Add minimum KV interface and implmement the deleting mechanism for
revoking lease.
2015-11-11 13:21:12 -08:00
2990249c1d Merge pull request #3856 from xiang90/raft_doc_restart
raft: add doc to make restart clear
2015-11-11 11:15:49 -08:00
f7f28b9984 raft: add doc to make restart clear, especially for configuration changed case 2015-11-11 11:11:58 -08:00
0aa4ce0606 Merge pull request #3855 from xiang90/raft_doc
raft: add more words about raft protocol
2015-11-11 09:42:32 -08:00
6df52614fc raft: add more words about raft protocol 2015-11-11 09:20:25 -08:00
2d11e7464e Merge pull request #3849 from gyuho/etcdmain_typos_descriptions
etcdmain: minor typo, make descriptions consistent
2015-11-10 13:20:40 -08:00
12b4a122ce etcdmain: minor typo, make descriptions consistent
This fixes some typos and make help.go and config.go flag descriptions
consistent with each other.
2015-11-10 13:00:08 -08:00
3e74ff7ad4 Merge pull request #3834 from xiang90/lease_new
lease: initial lessor impl
2015-11-10 10:29:19 -08:00
ff36b9d9bc Merge pull request #3700 from xiang90/metrics_hi
Replace Summary with Histogram for all metrics
2015-11-10 10:06:45 -08:00
964f6050ee raft: use HistogramVec for message_sent_latency 2015-11-10 10:05:32 -08:00
434f39d813 Merge pull request #3847 from gyuho/doc_flag_issue3690
etcdmain: more description for init cluster token
2015-11-10 09:42:02 -08:00
5eb57c2aee etcdmain: more description for init cluster token
This adds more description to initial-cluster-token from
https://github.com/coreos/etcd/issues/3690 to help.go.
2015-11-10 09:40:08 -08:00
7ff8ec81ee Merge pull request #3771 from yichengq/cors-auth
pkg/cors: add authorization into Access-Control-Allow-Headers
2015-11-10 08:05:53 -08:00
ad55630aa8 Merge pull request #3844 from gyuho/docker_guide_etcd_version
Documentation: docker pull latest etcd from quay
2015-11-09 20:59:28 -08:00
b6afe94aee Documentation: docker pull latest etcd from quay
As pointed out at https://github.com/coreos/etcd/issues/3843, Docker guide uses
outdated version of etcd. This docker commands will pull from the latest
releases.
2015-11-09 19:52:41 -08:00
8ce4313b22 Merge pull request #3841 from joshix/toolexamplelink
Documentation/security: Fix links about tls keygen.
2015-11-09 16:36:48 -08:00
95ade2c0ac Documentation/security: Fix links about tls keygen.
Edit to replace a relative link (won't work with that target) with
an absolute link.
Heading 1 Title Case.
Polish graf 3.

Fixes https://github.com/coreos/docs/issues/662
2015-11-09 16:12:56 -08:00
1f965972fc Merge pull request #3839 from xiang90/rename
etcdserver: rename processInternalRaftReq to processInternalRaftRequest
2015-11-10 00:56:18 +01:00
ae2f69b41e etcdserver: rename processInternalRaftReq to processInternalRaftRequest
We have a structure called InternalRaftRequest. Making the function
shorter by calling it processInternalRaftReq seems to be random and
reduce the readability. So we just use the full name.
2015-11-09 13:37:36 -08:00
213e246f13 Merge pull request #3838 from mlahaye/typofix
etcdctl: fix typo in error message (Invaild to Invalid)
2015-11-09 13:20:21 -08:00
735440e52d etcdctl: fix typo in error message (Invaild to Invalid) 2015-11-09 15:10:35 -06:00
31601d494d Merge pull request #3819 from gyuho/shorten_interval_for_first_retrials
proxy: expedite proxy refresh given no endpoints
2015-11-09 15:45:26 +01:00
dcf0b45483 Merge pull request #3835 from gyuho/doc_typo_20151108
Doc: fix typos for v3benchmark
2015-11-08 19:40:43 -08:00
a27a6b1372 Doc: fix typos for v3benchmark
The official benchmakr code seems to be in `tools` directory (not in `hack`).
2015-11-08 19:38:49 -08:00
bf70b5127a lease: initial lessor impl 2015-11-08 11:28:50 -08:00
ca25ed3ad2 proxy: expedite proxy refresh given no endpoints
This fixes coreos#3647 by giving shorter proxy refresh interval whenever
there is no endpoints found. Deleted sleep command in Procfile and proxy
documentation accordingly.
2015-11-07 07:27:39 -08:00
7c9e92d1d5 Merge pull request #3830 from xiang90/bolt
Godeps: update boltdb
2015-11-06 13:04:38 -08:00
4669b899cc Godeps: update boltdb 2015-11-06 12:58:28 -08:00
3de5d478ef Merge pull request #3829 from jonboulle/master
godeps: bump coreos/pkg/capnslog
2015-11-06 18:49:08 +01:00
6f8356ba40 godeps: bump coreos/pkg/capnslog
Update to catch coreos/pkg#43 which should fix SYSLOG_IDENTIFIER getting
set when etcd is logging to the journal.
2015-11-06 18:37:06 +01:00
ab1d33b8bd *: bump to v2.3.0-alpha.0+git 2015-11-06 09:16:03 -08:00
a2d4f85d33 *: bump to v2.3.0-alpha.0 2015-11-06 09:08:39 -08:00
63872d812a Merge pull request #3825 from jonboulle/master
contrib: add example systemd unit file
2015-11-06 17:53:32 +01:00
652d3f1974 contrib: add example systemd unit file 2015-11-06 17:50:19 +01:00
e3ce605cb5 Merge pull request #3826 from jonboulle/scripts
scripts: enforce genproto.sh is run from repo root
2015-11-06 17:26:16 +01:00
de0cb472be scripts: enforce genproto.sh is run from repo root 2015-11-06 16:13:24 +01:00
f48e95f7b0 Merge pull request #3822 from mitake/strict-reconfig-error-log
etcdserver: correct error log for strict reconfig checking
2015-11-06 15:13:27 +01:00
2c8ffa6bcb etcdserver: correct error log for strict reconfig checking
This commit fixes an error log caused by the strict reconfig checking
option.

Before:
14:21:38 etcd2 | 2015-11-05 14:21:38.870356 E | etcdhttp: got unexpected response error (etcdserver: re-configuration failed due to not enough started members)

After:
log
13:27:33 etcd2 | 2015-11-05 13:27:33.089364 E | etcdhttp: etcdserver: re-configuration failed due to not enough started members

The error is not an unexpected thing therefore the old message is
incorrect.
2015-11-06 11:03:42 +09:00
9d880f136f Merge pull request #3818 from yichengq/req-snap-log
etcdserver: fix snapshot index in creation log line
2015-11-05 14:04:46 -08:00
0874c44cdc etcdserver: fix snapshot index in creation log line
The snapshot is created at appliedi instead of snapi.
2015-11-05 14:02:09 -08:00
dadfdf6af8 Merge pull request #3802 from yichengq/fix-storage-watch
storage: delete key instead of setting it to false
2015-11-05 11:40:46 -08:00
08f0d94019 Merge pull request #3809 from xiang90/rpc_kv
*: refactor kv rpc implementation
2015-11-04 19:05:48 -08:00
47cad59571 Merge pull request #3813 from yichengq/update-version
*: update clusterMinVersion and feature maps for incoming v2.3
2015-11-04 14:37:37 -08:00
ec3c2d23a3 *: update feature maps to adopt v2.3.0 2015-11-04 14:30:35 -08:00
b82c171f5f version: update MinClusterVersion to v2.2.0
This is the preparation for bumping to v2.3.0-alpha
2015-11-04 14:30:04 -08:00
03951495d3 Merge pull request #3811 from gyuho/storage_watchergauge_fix
storage: move watcherGauge to watchable_store
2015-11-04 13:23:10 -08:00
6e5eb03544 storage: move watcherGauge to watchable_store
watcherGauge should be increased everytime we creates Watcher, not per watch
method call.
2015-11-04 13:17:47 -08:00
319b77b051 Merge pull request #3810 from gyuho/storage_metrics_add_watcher_gauge
storage: add metrics to watcher
2015-11-04 13:09:07 -08:00
4ebf28aa2e storage: add metrics to watcher
This adds metrics to watcher, and changes some order in MustRegister function
calls in init (same order that we define the gauges).
2015-11-04 13:01:52 -08:00
33fe6f41fb Merge pull request #3808 from yichengq/fix-wait-test
pkg/wait: extend wait timeout in TestWaitTime
2015-11-04 11:39:24 -08:00
3d15526c35 Merge pull request #3796 from yichengq/fix-get-version
etcdserver: not reuse connections for peer transport
2015-11-04 11:39:14 -08:00
c37bd2385a *: refactor kv rpc implementation 2015-11-04 11:36:17 -08:00
3b8349c06e pkg/wait: extend wait timeout in TestWaitTime
Fix this error happening on travis:
```
--- FAIL: TestWaitTime-2 (0.01s)
		wait_time_test.go:46: cannot receive from ch as expected
```
2015-11-04 11:18:17 -08:00
4ccbcb91c8 rafthttp: add functions to create listener and roundTripper
This moves the code to create listener and roundTripper for raft communication
to the same place, and use explicit functions to build them. This prevents
possible development errors in the future.
2015-11-04 11:12:46 -08:00
32819f6b3f etcdserver: use roundTripper to request peerURL
It uses roundTripper instead of Transport because roundTripper is
sufficient for its requirements.
2015-11-04 10:49:42 -08:00
5272ee99b5 Merge pull request #3804 from xiang90/ctl_watch
etcdctlv3: support watch
2015-11-04 10:21:05 -08:00
616078dc1b Merge pull request #3807 from xiang90/kv
*: rename etcd service to kv service in gRPC
2015-11-04 10:11:02 -08:00
1a3f7f7fa4 *: rename etcd service to kv service in gRPC 2015-11-04 10:05:49 -08:00
65d153db73 Merge pull request #3783 from yichengq/merge-logger
rafthttp: use MergeLogger for rafthttp logging
2015-11-04 09:48:43 -08:00
6040d57106 rafthttp: use MergeLogger to merge message-drop log
rafthttp logs repeated messages when amounts of message-drop logs
happen, and it becomes log spamming.
Use MergeLogger to merge log lines in this case.
2015-11-04 07:26:58 -08:00
5329159b5e rafthttp: remove failureMap from peerStatus
The logging mechanism is verbose, so it is removed from peerStatus.

We would like to see the status change
of connection with peers, and one error that leads to deactivation.
There is no need to print out all non-repeated errors.
2015-11-04 07:26:33 -08:00
5c1b833232 etcdctlv3: support watch
A draft impl for demo.
2015-11-03 19:28:57 -08:00
c8e622f517 storage: make putm/delm a set with empty value
This cleans the code, and reduces the allocation space.
2015-11-03 19:10:45 -08:00
6dbfc21846 storage: delete key instead of setting it to false
When getting the watched events, it iterate all keys in putm and delm
to generate the events. If we don't delete the key from putm/delm,
it would range on the key that is not actually put or deleted. This is
incorrect.

Fix the panic that happens when single put/delete is watched.
2015-11-03 19:00:39 -08:00
94c6b6a93d Merge pull request #3801 from yichengq/fix-raft-timeout
raft: extend wait timeout in TestNodeAdvance
2015-11-03 18:29:47 -08:00
0de52414cd raft: extend wait timeout in TestNodeAdvance
This fixes the failure met in semaphore CI.
2015-11-03 16:57:18 -08:00
1f1d8e9282 Merge pull request #3800 from xiang90/watch_server
*: serve watch service
2015-11-03 16:32:29 -08:00
10de2e6dbe *: serve watch service
Implement watch service and hook it up
with grpc server in etcdmain.
2015-11-03 15:58:34 -08:00
70cb8b8391 Merge pull request #3799 from gyuho/nameing_in_metrics_watching
storage: apply same naming in metrics.go
2015-11-03 15:23:39 -08:00
bdc280c4a7 storage: apply same naming in metrics.go
This is PR following up with Xiang's https://github.com/coreos/etcd/pull/3795,
and to make the naming consistent with its interface change.
2015-11-03 15:19:18 -08:00
f6b097c0cc Merge pull request #3798 from xiang90/watch_new
*: add v3 watch service
2015-11-03 14:39:20 -08:00
c160085f44 *: add v3 watch service 2015-11-03 14:21:24 -08:00
154fc8e19c Merge pull request #3795 from xiang90/watch_stream
storage: add watchChan
2015-11-03 13:32:49 -08:00
a1129dd5a5 storage: support multiple watching per watcher
We want to support multiple watchings per one watcher chan. Then
we can have one single go routine to watch multiple keys/prefixs.
2015-11-03 12:36:11 -08:00
34e7611093 Merge pull request #3797 from gyuho/procfile_20151103
Procfile: delay proxy waiting for initial cluster
2015-11-03 10:24:48 -08:00
5e29449d61 Procfile: delay proxy waiting for initial cluster
This fixes #3647 by delaying proxy start by 3 seconds. Without this, proxy
starts at the same time as initial cluster and since the default proxy director
refresh interval is 30-second, if cluster is not ready at first trial, the
proxy misses to discover them and has to wait another 30-seconds, which delays
the proxying for first 30-second.
2015-11-03 10:22:48 -08:00
0eee88a3d9 etcdserver: use timeout transport as peer transport
This pairs with remote timeout listeners.

etcd uses timeout listener, and times out the accepted connections
if there is no activity. So the idle connections may time out easily.
Becaus timeout transport doesn't reuse connections, it prevents using
timeouted connection.

This fixes the problem that etcd fail to get version of peers.
2015-11-03 07:58:03 -08:00
fe165de1d1 Merge pull request #3794 from yichengq/fix-proxy-term
etcdmain: fix parsing discovery error
2015-11-02 17:33:47 -08:00
9757dcd3a2 etcdmain: fix parsing discovery error
The discovery error is wrapped into a struct now, and cannot be compared
to predefined errors. Correct the comparison behavior to fix the
problem.
2015-11-02 17:23:06 -08:00
4fd65ecd4c Merge pull request #3785 from yichengq/fix-block-test
storage: extend wait timeout for execution
2015-11-02 12:53:18 -08:00
a74dd4c47a Merge pull request #3790 from xiang90/etcd-top
add etcdtop
2015-11-02 12:02:05 -08:00
8f9d237d21 Merge pull request #3792 from wojtek-t/update_ugorji
Update dependency on ugorji/go/codec
2015-11-02 07:43:48 -08:00
65ae8784fb client: regenerate code to unmarshal key response
Regenerate code for unmarshaling key response with a new version of
ugorji/go/codec.
2015-11-02 12:06:32 +01:00
02eec7763d Godeps: update ugorji/go/codec dependency
Update ugorji/go/codec dependency to the newer version.
2015-11-02 12:03:49 +01:00
e1b2e7245b tools/etcd-top: add copyright header 2015-11-01 18:19:32 -08:00
c4f8fe96e8 travis: install libpcap 2015-11-01 18:16:20 -08:00
2bfe995fb8 Godeps: add dependency for etcd-top 2015-11-01 18:07:27 -08:00
00557e96af tools: add etcd-top 2015-11-01 18:07:27 -08:00
59b5dabc66 storage: extend wait timeout for execution
Extend timeout to pass always in traivs.
2015-10-30 17:44:31 -07:00
f787e7904b Merge pull request #3762 from jonboulle/auth
etcdserver: restructure auth.Store and auth.User
2015-10-30 16:49:28 -07:00
ee522025b3 etcdserver: restructure auth.Store and auth.User
This attempts to decouple password-related functions, which previously
existed both in the Store and User structs, by splitting them out into a
separate interface, PasswordStore.  This means that they can be more
easily swapped out during testing.

This also changes the relevant tests to use mock password functions
instead of the bcrypt-backed implementations; as a result, the tests are
much faster.

Before:
```
	github.com/coreos/etcd/etcdserver/auth		31.495s
	github.com/coreos/etcd/etcdserver/etcdhttp	91.205s
```

After:
```
	github.com/coreos/etcd/etcdserver/auth		1.207s
	github.com/coreos/etcd/etcdserver/etcdhttp	1.207s
```
2015-10-30 16:33:40 -07:00
2840260b3b Merge pull request #3781 from gyuho/doc_typo_20151029
Documentation: fix typo in proxy.md
2015-10-29 20:34:16 -07:00
294f03f85f Documentation: fix typo in proxy.md
This fixes some typos in proxy.md.

Thanks,
2015-10-29 20:30:50 -07:00
00b4880494 Update ROADMAP.md 2015-10-29 16:05:40 -07:00
42255748cd Update ROADMAP.md 2015-10-29 16:03:14 -07:00
1b3d9130c9 Merge pull request #3759 from yichengq/rafthttp-unreachable
rafthttp: mark unreachable on unexpected response
2015-10-29 15:12:23 -07:00
1944893ef8 Merge pull request #3776 from gyuho/etcdmain_doc
etcdmain: fix package description compatible with godoc.org
2015-10-29 12:36:11 -07:00
821c071f3f etcdmain: fix package description for godoc.org
This fixes package description for etcdmain that wasn't compatible with
godoc.org, by deleting the extra blank lines between comment and package name.
2015-10-29 12:28:52 -07:00
84d7825a77 rafthttp: stop masking errMemberRemoved in pipeline
It makes logic more straightforward and readable. Also, it makes the
handle method consistent with stream and snapshot sender.
2015-10-28 21:40:48 -07:00
908a011604 rafthttp: mark unreachable on unexpected response
In rafthttp, when making request to some endpoint, it may receive
response with unexpected status code and header. This indicates the endpoint
doesn't function correctly. It should mark the endpoint unreachable.
2015-10-28 21:40:11 -07:00
2fe6893d5d Merge pull request #3772 from xiang90/watcher_sep
storage: move watcher interface into watcher.go
2015-10-28 21:14:55 -07:00
f71bcfa8ce storage: move watcher interface into watcher.go 2015-10-28 21:10:58 -07:00
de99c9ed58 Merge pull request #3770 from yichengq/link-etcdctl
docs/libraries-and-tools: update the link of etcdctl
2015-10-28 14:07:33 -07:00
d6b4c7b67c pkg/cors: add authorization into Access-Control-Allow-Headers
This helps browser to send auth-related request to etcd server when
cors flag is set.
2015-10-28 13:58:04 -07:00
4f36897f8c Merge pull request #3767 from kamilhark/master
Added etcdsh command line tool to the list
2015-10-28 13:41:14 -07:00
ebde1d720e docs/libraries-and-tools: update the link of etcdctl
The old repo is deprecated, and we develop etcdctl in etcd repo now.
2015-10-28 13:37:28 -07:00
b5c176360e Merge pull request #3768 from yichengq/fix-publish-test
etcdserver: extend wait timeout in TestPublishRetry
2015-10-28 13:31:51 -07:00
695a5148cf Merge pull request #3769 from msoap/fix-docs
documentation: changed link to style doc
LGTM. Link accurate (old link was redir'd anyway).
Tiny fix, doc-only, so directly merging.
2015-10-28 13:13:37 -07:00
3dad5fffc0 documentation: changed link to style doc
Go-project has been moved from code.google.com to github.com
2015-10-28 21:49:28 +02:00
7d757bbc8a etcdserver: extend wait timeout in TestPublishRetry
It fixes the failure in semaphore CI:
```
--- FAIL: TestPublishRetry (0.00s)
		server_test.go:1108: len(action) = 1, want >= 2
```
2015-10-28 12:07:00 -07:00
ae18e6ea37 docs/libraries-and-tools: Added etcdsh command line tool to the list 2015-10-28 19:38:09 +01:00
099d8674c4 Merge pull request #3746 from yichengq/load-storage
etcdserver: fix recovering snapshot from disk
2015-10-27 14:42:41 -07:00
4b8ee2d66e storage: skip old entry in ConsistentWatchableStore
This avoids to apply the same entry twice when restoring from disk.
2015-10-26 23:26:06 -07:00
263b270708 etcdserver: commit v3 storage before releasing WAL
This ensures that v3 storage could always find the following log entries
when restart.
2015-10-26 21:06:08 -07:00
70f9407d2d Merge pull request #3758 from xiang90/race
*: fix various data races detected by race detector
2015-10-26 20:57:31 -07:00
ab4892ade2 Merge pull request #3749 from gyuho/etcdmain_flags_20151025
etcdmain: make flags and formats idential
2015-10-26 20:54:37 -07:00
a8e6e71bf9 *: fix various data races detected by race detector 2015-10-26 20:49:37 -07:00
306dd7183b Merge pull request #3757 from xiang90/race
rafthttp: fix data races detected by go race detector
2015-10-26 17:10:17 -07:00
336d177c82 rafthttp: fix data races detected by go race detector 2015-10-26 15:29:08 -07:00
4766227b76 Merge pull request #3750 from yichengq/rafthttp-continue
rafthttp: fix wrong return in pipeline.handle
2015-10-26 14:11:42 -07:00
4076dda101 rafthttp: fix wrong return in pipeline.handle
pipeline.handle is a long-living one, and should continue to receive
next message to send out when current message fails to send. So it
should `continue` instead of `return` here.
2015-10-26 14:05:19 -07:00
44bbc87698 Merge pull request #3756 from suryanathan/master
docs/libraries-and-tools: Update libraries-and-tools.md with etcdcpp
2015-10-26 13:52:42 -07:00
e4ada19996 docs/libraries-and-tools: Update libraries-and-tools.md with etcdcpp
Add a c++ language binding for API version 2.2.0
2015-10-26 16:44:17 -04:00
cc378585a9 Merge pull request #3755 from jonboulle/master
travis: only run unit tests
2015-10-26 13:36:18 -07:00
516be7a781 travis: only run unit tests
Travis has chronic problems successfully running the integration suite -
and we've successfully moved to Semaphore for that purpose - but can
still be useful as a fail-fast option for testing unit tests and formatting.
2015-10-26 12:47:15 -07:00
52782cf8ee etcdmain: make flags and formats idential
This makes flagsline and config.go identical in its flag description and some
punctuation conventions.
2015-10-25 06:31:37 -07:00
d44b79c3c9 Merge pull request #3748 from coreos/revert-3737-rafthttp-continue
Revert "rafthttp: fix wrong return in pipeline.handle"
2015-10-24 21:05:52 -07:00
5eda45ece6 Revert "rafthttp: fix wrong return in pipeline.handle" 2015-10-24 20:25:56 -07:00
dbba5bb373 Merge pull request #3737 from yichengq/rafthttp-continue
rafthttp: fix wrong return in pipeline.handle
2015-10-24 19:42:38 -07:00
7e38f05ceb Merge pull request #3742 from yichengq/save-index
etcdserver: save consistent index into v3 storage
2015-10-24 09:48:28 -07:00
15ed6d8268 etcdserver: save consistent index into v3 storage
This helps to recover consistent index when restart in the future.
2015-10-24 09:27:24 -07:00
f648d52afe rafthttp: fix wrong return in pipeline.handle
pipeline.handle is a long-living one, and should continue to receive
next message to send out when current message fails to send. So it
should `continue` instead of `return` here.
2015-10-23 17:00:03 -07:00
41cb39b68a storage: Get -> ConsistentIndex in ConsistentIndexGetter
To make the method name more specific in the context.
2015-10-23 16:40:55 -07:00
4f47b08cf6 Merge pull request #3744 from yichengq/fix-sem
raft: extend wait timeout in TestMultiNodeAdvance
2015-10-23 13:20:52 -07:00
bf3057e5bd raft: extend wait timeout in TestMultiNodeAdvance
This fixes the failure met in semaphore CI:

```
--- FAIL: TestMultiNodeAdvance-2 (0.01s)
		multinode_test.go:458: expect Ready after Advance, but there is
		no Ready available
```
2015-10-23 12:08:24 -07:00
01559fafeb Merge pull request #3741 from yichengq/receive-restore
etcdserver: restore KV snapshot when receiving snapshot
2015-10-23 09:24:17 -07:00
cacc0d6432 etcdserver: restore KV snapshot when receiving snapshot
When a slow follower receives the snapshot sent from the leader, it
should rename the snapshot file to the default KV file path, and
restore KV snapshot.

Have tested it manually and it works pretty well.
2015-10-23 08:43:26 -07:00
d33c26c20a Merge pull request #3730 from yichengq/storage-consistent
storage: add consistentWatchableStore
2015-10-23 08:15:04 -07:00
4fb4bc3ca8 storage: add consistentWatchableStore
consistentWatchableStore maintains an index that is always consistent
with the latest txn. The index could be used to indicate the progress
of the store so far when recovery.
2015-10-22 22:54:51 -07:00
ae62a77de6 Merge pull request #3729 from xiang90/mem_bench
doc: add benchmark doc for new storage pkg
2015-10-22 10:54:43 -07:00
e3cedeeb12 doc: add benchmark doc for new storage pkg 2015-10-22 13:53:03 -04:00
2feccd3fa4 Merge pull request #3733 from yichengq/fix-wait-timeout
pkg/transport: extend wait timeout for write
2015-10-22 13:07:14 -04:00
d3ebecdddd pkg/transport: extend wait timeout for write
This helps the test to pass safely in semaphore CI.

Based on my manual testing, it may take at most 500ms to return
error in semaphore CI, so I set 1s as a safe value.
2015-10-21 18:27:21 -07:00
8b08fff1e9 Merge pull request #3731 from yichengq/storage-kv
storage: fix WatchableKV interface and refine comment
2015-10-21 17:27:24 -07:00
01b163e77d Merge pull request #3588 from gyuho/storage/watchable_store.go-use-map-for-unsynced
storage/watchable_store.go: use map for unsynced
2015-10-21 16:50:15 -07:00
44cecb8624 Merge pull request #3732 from yichengq/config-header
docs/configuration: fix heading hierarchy
2015-10-21 15:50:38 -07:00
f73d0ed1d9 storage: use map for watchable store unsynced
This is for `TODO: use map to reduce cancel cost`.
I switched slice to map, and benchmark results show
that map implementation performs better, as follows:

```
[1]:
benchmark                                   old ns/op     new ns/op     delta
BenchmarkWatchableStoreUnsyncedCancel       215212        1307          -99.39%
BenchmarkWatchableStoreUnsyncedCancel-2     120453        710           -99.41%
BenchmarkWatchableStoreUnsyncedCancel-4     120765        748           -99.38%
BenchmarkWatchableStoreUnsyncedCancel-8     121391        719           -99.41%

benchmark                                   old allocs     new allocs     delta
BenchmarkWatchableStoreUnsyncedCancel       0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-2     0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-4     0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-8     0              0              +0.00%

benchmark                                   old bytes     new bytes     delta
BenchmarkWatchableStoreUnsyncedCancel       200           1             -99.50%
BenchmarkWatchableStoreUnsyncedCancel-2     138           0             -100.00%
BenchmarkWatchableStoreUnsyncedCancel-4     138           0             -100.00%
BenchmarkWatchableStoreUnsyncedCancel-8     139           0             -100.00%

[2]:
benchmark                                   old ns/op     new ns/op     delta
BenchmarkWatchableStoreUnsyncedCancel       212550        1117          -99.47%
BenchmarkWatchableStoreUnsyncedCancel-2     120927        691           -99.43%
BenchmarkWatchableStoreUnsyncedCancel-4     120752        699           -99.42%
BenchmarkWatchableStoreUnsyncedCancel-8     121012        688           -99.43%

benchmark                                   old allocs     new allocs     delta
BenchmarkWatchableStoreUnsyncedCancel       0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-2     0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-4     0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-8     0              0              +0.00%

benchmark                                   old bytes     new bytes     delta
BenchmarkWatchableStoreUnsyncedCancel       197           1             -99.49%
BenchmarkWatchableStoreUnsyncedCancel-2     138           0             -100.00%
BenchmarkWatchableStoreUnsyncedCancel-4     138           0             -100.00%
BenchmarkWatchableStoreUnsyncedCancel-8     139           0             -100.00%

[3]:
benchmark                                   old ns/op     new ns/op     delta
BenchmarkWatchableStoreUnsyncedCancel       214268        1183          -99.45%
BenchmarkWatchableStoreUnsyncedCancel-2     120763        759           -99.37%
BenchmarkWatchableStoreUnsyncedCancel-4     120321        708           -99.41%
BenchmarkWatchableStoreUnsyncedCancel-8     121628        680           -99.44%

benchmark                                   old allocs     new allocs     delta
BenchmarkWatchableStoreUnsyncedCancel       0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-2     0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-4     0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-8     0              0              +0.00%

benchmark                                   old bytes     new bytes     delta
BenchmarkWatchableStoreUnsyncedCancel       200           1             -99.50%
BenchmarkWatchableStoreUnsyncedCancel-2     139           0             -100.00%
BenchmarkWatchableStoreUnsyncedCancel-4     138           0             -100.00%
BenchmarkWatchableStoreUnsyncedCancel-8     139           0             -100.00%

[4]:
benchmark                                   old ns/op     new ns/op     delta
BenchmarkWatchableStoreUnsyncedCancel       208332        1089          -99.48%
BenchmarkWatchableStoreUnsyncedCancel-2     121011        691           -99.43%
BenchmarkWatchableStoreUnsyncedCancel-4     120678        681           -99.44%
BenchmarkWatchableStoreUnsyncedCancel-8     121303        721           -99.41%

benchmark                                   old allocs     new allocs     delta
BenchmarkWatchableStoreUnsyncedCancel       0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-2     0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-4     0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-8     0              0              +0.00%

benchmark                                   old bytes     new bytes     delta
BenchmarkWatchableStoreUnsyncedCancel       194           1             -99.48%
BenchmarkWatchableStoreUnsyncedCancel-2     139           0             -100.00%
BenchmarkWatchableStoreUnsyncedCancel-4     139           0             -100.00%
BenchmarkWatchableStoreUnsyncedCancel-8     139           0             -100.00%

[5]:
benchmark                                   old ns/op     new ns/op     delta
BenchmarkWatchableStoreUnsyncedCancel       211900        1097          -99.48%
BenchmarkWatchableStoreUnsyncedCancel-2     121795        753           -99.38%
BenchmarkWatchableStoreUnsyncedCancel-4     123182        700           -99.43%
BenchmarkWatchableStoreUnsyncedCancel-8     122820        688           -99.44%

benchmark                                   old allocs     new allocs     delta
BenchmarkWatchableStoreUnsyncedCancel       0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-2     0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-4     0              0              +0.00%
BenchmarkWatchableStoreUnsyncedCancel-8     0              0              +0.00%

benchmark                                   old bytes     new bytes     delta
BenchmarkWatchableStoreUnsyncedCancel       198           1             -99.49%
BenchmarkWatchableStoreUnsyncedCancel-2     140           0             -100.00%
BenchmarkWatchableStoreUnsyncedCancel-4     141           0             -100.00%
BenchmarkWatchableStoreUnsyncedCancel-8     141           0             -100.00%
```
2015-10-21 15:30:15 -07:00
f95d18f766 docs/configuration: fix heading hierarchy
to make it consistent with other sections in the doc.
2015-10-21 15:23:48 -07:00
027c073d55 storage: refine Watch comment in WatchableKV
Explain explicitly how these arguments are used.
2015-10-21 14:47:52 -07:00
56b7584418 Merge pull request #3725 from joshix/hdinghier-mulligan
Documentation: Fix heading hierarchy.
2015-10-21 13:52:57 -07:00
2673e657e6 storage: fix WatchableKV interface
We delete endRev from the watch functionality, so the interface needs
to be fixed.
2015-10-21 11:50:25 -07:00
35eb26ef5d Merge pull request #3726 from yichengq/watch-store
storage: add store field in watchableStore
2015-10-21 11:07:45 -07:00
0f7374ce89 storage: KV field -> store field in watchableStore
We need to access the underlying store to use its RangeEvents function.
It is not good to use unnecessary type conversion.

The underlying store is also needed for further store upon
watchableStore.
2015-10-20 19:23:20 -07:00
8d3ed0176c Merge pull request #3727 from yichengq/govet
raft: fix malformed example name
2015-10-20 16:51:47 -07:00
01806c3e80 raft: fix malformed example name
It is reported by latest govet:
```
gopath/src/github.com/coreos/etcd/raft/example_test.go:26: Example_Node
has malformed example suffix: Node
```
2015-10-20 16:40:01 -07:00
98bdeab53b Documentation: Fix heading hierarchy.
Correct the hierarchy of Markdown symbols in document headings.
2015-10-20 15:26:49 -07:00
704bff0c77 Merge pull request #3724 from coreos/philips-patch-1
README: fix language for release binaries
2015-10-20 14:22:02 -07:00
5b5b0ef060 README: attempt to make it even clearer 2015-10-20 14:17:33 -07:00
b38e21a9e9 README: fix language for release binaries
Address confusion on where to find stuff and make it easier to find with keywords for various operating systems.
2015-10-20 14:07:40 -07:00
9635d8d94c Merge pull request #3720 from yichengq/clean-streamAppV1
rafthttp: deprecate streamTypeMsgApp and remove msgApp stream sent restriction due to streamTypeMsgApp
2015-10-20 10:37:51 -07:00
de669be6d6 Merge pull request #3683 from yichengq/raft-block
etcdserver: fix raft state machine may block
2015-10-20 09:44:34 -07:00
ab5df57ecf etcdserver: fix raft state machine may block
When snapshot store requests raft snapshot from etcdserver apply loop,
it may block on the channel for some time, or wait some time for KV to
snapshot. This is unexpected because raft state machine should be unblocked.

Even worse, this block may lead to deadlock:
1. raft state machine waits on getting snapshot from raft memory storage
2. raft memory storage waits snapshot store to get snapshot
3. snapshot store requests raft snapshot from apply loop
4. apply loop is applying entries, and waits raftNode loop to finish
messages sending
5. raftNode loop waits peer loop in Transport to send out messages
6. peer loop in Transport waits for raft state machine to process message

Fix it by changing the logic of getSnap to be asynchronously creation.
2015-10-20 09:19:34 -07:00
b61eaf3335 rafthttp: msgApp{Reader/Writer} -> msgAppV2{Reader/Writer}
To make what it serves more clear.
2015-10-20 08:28:06 -07:00
5060b2f322 rafthttp: send all MsgApp on stream msgAppV2
For stream msgAppV2, as long as the message is MsgApp type, it should be sent
through stream msgAppV2.
2015-10-20 08:23:36 -07:00
33231fccdd rafthttp: fix wrong stream name returned by pick
msgAppWriter uses streamAppV2 type, and it should return the correct name.
2015-10-20 08:17:06 -07:00
f725f6a552 rafthttp: deprecate streamTypeMsgApp
streamTypeMsgApp is only used in etcd 2.0. etcd 2.3 should not talk to
etcd 2.0, either send or receive requests. So I deprecate streamTypeMsgApp
and its related stuffs from rafthttp package.

updating term is only used from streamTypeMsgApp, so it is removed too.
2015-10-20 08:15:54 -07:00
eb7bce893e Merge pull request #3721 from mitake/servevars
etcdserver: don't allow methods other than GET in /debug/vars
2015-10-20 08:01:38 -07:00
1b0c65c299 etcdserver: don't allow methods other than GET in /debug/vars
Currently, /debug/vars seems to allow all types of methods e.g. PUT,
POST, etc. However, this path is a readonly stuff so it should allow
GET only.
2015-10-20 17:19:42 +09:00
7dcb99b60e Merge pull request #3656 from endocode/kayrus/client_doc
Added example on how to get node's value
2015-10-19 20:41:12 -07:00
e5082fce54 Merge pull request #3718 from gyuho/gyuho_README
README: fix typo
2015-10-19 17:14:46 -07:00
7d326087f9 README: fix typo
It looks like a typo. Or is it elided sentence?
Thanks,
2015-10-19 17:03:40 -07:00
4e9f137d1b Merge pull request #3716 from yichengq/add-sem-badge
README: add semaphore CI status badge into README
2015-10-19 16:25:21 -07:00
6ebd62a869 README: add semaphore CI status badge into README 2015-10-19 16:08:40 -07:00
32dd4d5de3 Merge pull request #3657 from xiang90/fix_remove
etcdserver: skip updating attr if the member does not exist
2015-10-19 13:35:57 -07:00
776e9fb7be Merge pull request #3703 from xiang90/bolt
storage/backend: avoid creating new bolt.tx during a batchTx
2015-10-19 10:30:57 -07:00
afb35e366d client: added example on how to get node's value 2015-10-19 10:31:05 +02:00
79c263b2ec Merge pull request #3707 from xiang90/CI
pkg/transport: longer timeout for slow CI
2015-10-18 17:22:15 -07:00
7c6e2deb66 Merge pull request #3708 from xiang90/travis
travis: drop go-nyet
2015-10-18 16:43:53 -07:00
559b76f401 travis: drop go-nyet 2015-10-18 16:41:57 -07:00
3c1ecf70cf pkg/transport: longer timeout for slow CI 2015-10-18 16:32:18 -07:00
5372e11727 Merge pull request #3704 from xiang90/rafthttp
clean up rafthttp pkg: round1
2015-10-18 10:00:26 -07:00
427a154aae rafthttp: various clean up 2015-10-18 09:49:18 -07:00
7d3af5e15f rafthttp: rename message.go -> message_codec.go 2015-10-18 09:49:11 -07:00
e87cd0c17b rafthttp: move new funcs to right place 2015-10-18 09:48:59 -07:00
f08d750b0b Merge pull request #3697 from mqliang/cluster-health
etcdctl: fix health check condition
2015-10-18 09:26:05 -07:00
478fab6aca rafthttp: rename NewHandler to newPipelineHandler 2015-10-17 22:33:28 -07:00
080c11d14e rafthttp: make ConnReadLimitByte private and add comment 2015-10-17 22:20:36 -07:00
5efdd7bc6d storage/backend: avoid creating new bolt.tx during a batchTx 2015-10-17 21:31:34 -07:00
b2d92dedae etcdctl:fix health check condition 2015-10-18 08:22:13 +08:00
d07c9b00e5 Merge pull request #3701 from xiang90/rm_end_watcher
storage: remove the endRev of watcher
2015-10-17 16:04:27 -07:00
6556bf1643 storage: remove the endRev of watcher 2015-10-17 15:59:49 -07:00
c1e4e647eb snap: use Histogram for snap metrics 2015-10-17 12:57:18 -07:00
d90a47656e etcdserver: use Histogram for proposal_durations 2015-10-17 12:48:25 -07:00
1c7f52d931 wal: use Histogram for syncDuration 2015-10-17 12:45:43 -07:00
f78a11d468 Merge pull request #3694 from philips/fix-configuration-headers
Documentation: configuration docs headers
2015-10-16 12:39:10 -07:00
22d8ca4c9a Documentation: configuration docs headers
The configuration docs are indented weird compared to our standards.
This makes the sidebar here not work right:
https://coreos.com/etcd/docs/latest/configuration.html
2015-10-16 12:32:57 -07:00
fd07e02604 Merge pull request #3691 from gyuho/documentation_20151015
raft/documentation: clarify progress's subjects.
2015-10-15 20:02:00 -07:00
1716d5858f raft/documentation: clarify progress's subjects.
If I understand correctly, `progress` represents the states of follower. For
me, some comments weren't clear because it was missing the subjects of
`progress`. This adds more clarification on who is doing what. Please let me
know if I misunderstood anything. Thanks,
2015-10-15 19:15:08 -07:00
9ce79dbbc3 Merge pull request #3685 from gyuho/etcdctl_mk_command_2
etcdctl: fix mk command with PrevNoExist
2015-10-15 12:13:54 -07:00
df34d67e98 Merge pull request #3689 from ccding/patch-1
raft/doc: fix misuse of `for' loop in docs
2015-10-15 09:20:05 -07:00
362df8e470 raft/doc: fix misuse of `for' loop in docs 2015-10-15 11:13:30 -05:00
1dab7e8084 etcdctl/command: mk command with PrevNoExist
This attempts to fix #3676. `PrevNoExist` checks if the key previously exists
and if so, it returns an error, which is how `mk` command is supposed to work.
The previous code ignores the previous key and overwrites with the later value.

/cc @yichengq
2015-10-15 09:05:17 -07:00
c2e49b5622 Merge pull request #3687 from ccding/patch-1
raft/doc: fix typos
2015-10-15 07:52:43 -07:00
f1f92f0fa3 raft/doc: fix typos 2015-10-15 02:17:34 -05:00
afd74dfeb7 Merge pull request #3611 from mitake/etcdctl-timeout
etcdctl: use a context with -total-timeout in simple commands
2015-10-14 16:13:34 -07:00
f78ccbbd3f Merge pull request #3681 from yichengq/godep-update
Godeps: update prometheus dependency
2015-10-14 11:44:49 -07:00
d807c895b8 Godeps: update prometheus dependency
prometheus updates its directory layout
(https://github.com/prometheus/client_golang#where-is-model-extraction-and-text)
and makes Godeps restore/save unable to work.

Remove all prometheus dependency manually and godep save again to fix
this problem.
2015-10-14 09:58:36 -07:00
aeb6ef5d8a Merge pull request #3680 from gyuho/Documentation_20151014
Documentation: typos in discovery, faq, security
2015-10-14 08:50:02 -07:00
0598de2e25 Documentation: typos in discovery, faq, security
This just fixes some typos from my reading Documentation.

Thanks,

Documentation: security
2015-10-14 08:48:01 -07:00
d2b40c1c98 Merge pull request #3666 from yichengq/transport-snap
rafthttp: support sending v3 snapshot message
2015-10-13 23:58:02 -07:00
1f21ccf166 rafthttp: support sending v3 snapshot message
Use snapshotSender to send v3 snapshot message. It puts raft snapshot
message and v3 snapshot into request body, then sends it to the target peer.
When it receives http.StatusNoContent, it knows the message has been
received and processed successfully.

As receiver, snapHandler saves v3 snapshot and then processes the raft snapshot
message, then respond with http.StatusNoContent.
2015-10-13 23:11:28 -07:00
6afd8e4fd9 ROADMAP: fix v3 API issues link 2015-10-12 20:56:20 -07:00
70dc205500 Merge pull request #3665 from raoofm/patch-2
hack: bench to use Content Type as value written was always empty
2015-10-12 11:35:34 -07:00
90e8dcd9bf hack: benchmarking to use Content Type
hack: benchmarking to use Content Type: application/x-www-form-urlencoded

boom sends PUT request with Content-Type: text/html, and this cannot be parsed by etcd. It should use Content-Type: application/x-www-form-urlencoded. Post this fix the official etcd benchmarks should be updated as the keysize was not a factor as the value being set was always empty.
2015-10-12 10:03:09 -04:00
df7074911e Merge pull request #3664 from yichengq/transport-more
rafthttp: build transport inside pkg instead of passed-in
2015-10-11 22:00:05 -07:00
207c92b627 rafthttp: build transport inside pkg instead of passed-in
rafthttp has different requirements for connections created by the
transport for different usage, and this is hard to achieve when giving
one http.RoundTripper. Pass into pkg the data needed to build transport
now, and let rafthttp build its own transports.
2015-10-11 21:42:37 -07:00
988a09eb20 Merge pull request #3663 from yichengq/transport-rt
pkg/transport: pass dial timeout to NewTransport
2015-10-11 10:12:09 -07:00
9673eb625a pkg/transport: pass dial timeout to NewTransport
So we could set dial timeout for new transport, which makes it
customizable according to max RTT.
2015-10-11 10:09:25 -07:00
017f5f4670 Merge pull request #3662 from yichengq/transport
rafthttp: expose struct to set configuration
2015-10-11 09:35:15 -07:00
233e717e2f rafthttp: expose struct to set configuration
transport takes too many arguments and the new function is unable to
read. Change the way to set fields in transport struct directly.
2015-10-11 09:02:16 -07:00
9534b11ad2 Merge pull request #3660 from gyuho/Documentation_typos_20151009
Documentation: fix typos
2015-10-09 16:10:49 -07:00
d05d6f8bbb Documentation: fix typos
I found some typos. Please let me know if you have any feedback.

Thanks,

Documentation: fix metrics.md typo

Documentation: trim blank lines in metrics.md
2015-10-09 15:56:58 -07:00
ce45159767 Merge pull request #3655 from wojtek-t/update_dependency
Update dependency on ugorji/go/codec
2015-10-09 10:23:47 -07:00
4eb598be06 client: regenerate code to unmarshal key response
Regenerate code for unmarshaling key response with a new version of
ugorji/go/codec
2015-10-09 10:59:42 +02:00
8ebbec8e05 Godeps: update ugorji/go/codec dependency
Update ugorji/go/codec dependency to the newer version (a bunch of fixed were made).
2015-10-09 10:59:42 +02:00
eadfd138a4 Merge pull request #3658 from mqliang/patch-2
docs/api.md: fix documentation
2015-10-08 19:51:54 -07:00
8c580ffe2d docs/api.md: fix documentation
Fix documentation
2015-10-09 10:41:12 +08:00
98e30ca7c2 etcdserver: skip updating attr if the member does not exist 2015-10-08 14:07:16 -07:00
f74ff9b867 Merge pull request #3644 from mitake/test-race
etcdserver, test: don't access testing.T in time.AfterFunc()'s own go…
2015-10-07 08:34:58 -07:00
dc394a0a99 Merge pull request #3649 from kkaneda/kkaneda/comment_fix
raft: fix a description of MemoryStorage.Compact
2015-10-06 21:51:20 -07:00
ebd8cb04c1 raft: fix a description of MemoryStorage.Compact
The parameter name is compactIndex, not i.
2015-10-06 21:49:33 -07:00
68dd3ee621 etcdserver, test: don't access testing.T in time.AfterFunc()'s own goroutine
time.AfterFunc() creates its own goroutine and calls the callback
function in the goroutine. It can cause datarace like the problem
fixed in the commit de1a16e0f1 . This
commit also fixes the potential dataraces of tests in
etcdserver/server_test.go .
2015-10-06 11:37:08 +09:00
21179d929f Merge pull request #3616 from yichengq/storage-txn
storage: hold batchTx lock during KV txn
2015-10-05 17:12:52 -07:00
4f2ada3f1e Merge pull request #3643 from xiang90/metrics_storage
storage: add metrics for db total size
2015-10-05 17:11:00 -07:00
0aa2f1192a storage: add metrics for db total size 2015-10-05 16:56:30 -07:00
522ee6ab3a Merge pull request #3635 from yichengq/parse-ipv6
pkg/types: fix unwanted unescape in NewURLsMap
2015-10-05 15:30:51 -07:00
699e37562e Merge pull request #3637 from yichengq/run-snapshot
etcdserver: get existing snapshot instead of requesting one
2015-10-05 14:57:03 -07:00
e117f36e48 pkg/types: fix unwanted unescape in NewURLsMap
We use url.ParseQuery to parse names-to-urls string, but it has side
effect that unescape the string. If the initial-cluster string has ipv6
which contains `%25`, it will unescape it to `%` and make further url
parse failed.

Fix it by modifiying the parse process.

Go1.4 doesn't support literal IPv6 address w/ zone in
URI(https://github.com/golang/go/issues/6530), so we only enable tests
in Go1.5+.
2015-10-05 14:54:17 -07:00
8c94ae0ee3 etcdserver: get existing snapshot instead of requesting one
This fixes the problem that proposal cannot be applied.

When start the etcdserver.run loop, it expects to get the latest
existing snapshot. It should not attempt to request one because the loop
is the entity to create the snapshot.
2015-10-05 14:32:16 -07:00
ba949ae2be Merge pull request #3640 from xiang90/watch_metrics
storage: add metrics for watchers
2015-10-05 11:46:50 -07:00
09157d4f1a storage: add metrics for watchers 2015-10-05 11:32:56 -07:00
432b1bc230 Merge pull request #3638 from gyuho/documentation_proxy
Documentation: proxy.md typo, line-breaks
2015-10-05 07:57:22 -07:00
f2dae5a0d2 Documentation: proxy.md typo, line-breaks
1. I found a little typo (easily -> easy)
2. If you go to https://coreos.com/etcd/docs/2.0.9/proxy.html,
   the proxy flag command is out of width of the web-page. Can
   we have line-breaks between flags to make the command easier
   to read?

Thanks for the great documentation!
2015-10-04 12:25:25 -07:00
c97dda766e storage: hold batchTx lock during KV txn
One txn is treated as atomic, and might contain multiple Put/Delete/Range
operations. For now, between these operations, we might call forecCommit
to sync the change to disk, or backend may commit it in background.
Thus the snapshot state might contains an unfinished multiple objects
transaction, which is dangerous if database is restored from the snapshot.

This PR makes KV txn hold batchTx lock during the process and avoids
commit to happen.
2015-10-03 16:01:05 -07:00
581cc5cff4 Merge pull request #3608 from yichengq/storage-snapshot
storage: update KV.Snapshot function
2015-10-03 15:32:14 -07:00
36f4303fc3 storage/etcdserver: update KV.Snapshot function
When using Snapshot function, it is expected:
1. know the size of snapshot before writing data
2. split snapshot-ready phase and write-data phase. so we could cut
snapshot first and write data later.

Update its interface to fit the requirement of etcdserver.
2015-10-03 10:15:23 -07:00
8c0db94fef Merge pull request #3631 from yichengq/create-snapshot
etcdserver: support to create raft snapshot at apply loop
2015-10-03 10:03:27 -07:00
675d4306b0 Merge pull request #3634 from yichengq/fix-cluster-output
etcdserver: print out correct restored cluster info
2015-10-02 16:23:33 -07:00
18c568bc82 etcdserver: print out correct restored cluster info
Before this PR, it always prints nil because cluster info has not been
covered when print:

```
2015-10-02 14:00:24.353631 I | etcdserver: loaded cluster information
from store: <nil>
```
2015-10-02 16:11:32 -07:00
69ca0b8475 Merge pull request #3633 from xiang90/systemd_readiness
etcdmain: print out error and suggestion for fixing notify issue
2015-10-02 13:56:16 -07:00
51043830d4 etcdmain: print out error and suggestion for fixing notify issue 2015-10-02 13:39:41 -07:00
bfe9502f4f etcdserver: support to create raft snapshot at apply loop
and snapStore could trigger it to create the latest raft snapshot.
2015-10-02 13:17:56 -07:00
f8a4d1f01b Merge pull request #3607 from xiang90/doc_name
doc: emphasize name should be unique
2015-10-02 12:23:06 -07:00
2733e3f543 doc: emphasize name should be unique 2015-10-02 09:58:20 -07:00
f093559b1d Merge pull request #3632 from mickep76/master
docs/libraries-and-tools: add etcd-rest rest api daemon
2015-10-02 09:49:59 -07:00
4835a411c7 docs/libraries-and-tools: add etcd-rest rest api daemon 2015-10-02 14:55:57 +02:00
ccce61bda9 Merge pull request #3614 from yichengq/snapshot-store
etcdserver: add snapshotStore and raftStorage
2015-10-01 19:35:34 -07:00
f47cbf3073 Merge pull request #3627 from jelmer/typofix
Fix typo: boostrapping -> bootstrapping.
2015-10-01 19:02:47 -07:00
2276328720 etcdserver: add snapshotStore and raftStorage
snapshotStore is the store of snapshot, and it supports to get latest snapshot
and save incoming snapshot.

raftStorage supports to get latest snapshot when v3demo is open.
2015-10-01 19:00:59 -07:00
d70975e54c Documentation/configuration.md: Fix typo.
boostrapping -> bootstrapping
2015-10-01 20:03:16 +00:00
715fdfb669 Merge pull request #3093 from mwitkow-io/feature/httpd_metrics
add `events` metrics in etcdhttp.
2015-10-01 12:10:58 -07:00
6e9943a037 Merge pull request #3629 from ccding/master
raft: fix typo in doc
2015-10-01 10:11:12 -07:00
b2edf1d24a raft: fix typo in doc 2015-10-01 11:21:23 -05:00
1b2dc1c796 metrics: add events metrics in etcdhttp. 2015-10-01 08:11:42 +01:00
46e5444d93 Merge pull request #3625 from yichengq/fix-race
pkg/transport: fix a data race in TestReadWriteTimeoutDialer
2015-09-30 17:50:48 -07:00
de1a16e0f1 pkg/transport: fix a data race in TestReadWriteTimeoutDialer
Accessing test.T async will cause data race.

Change to use select to coordinate the access of test.T.
2015-09-30 17:29:24 -07:00
036ea58a77 Documentation: 04 snapshot: add example with fleet 2015-09-30 16:35:28 -07:00
7ba352d9ca etcdmain: print usage in stderr when flag.Parse fail
This fits the requirement of stderr.

I still let `etcd --version` and `etcd --help` print out to stdout
because when users ask explicitly for version/help docs, they expect to see
the doc in stdout.

Ref:
http://www.jstorimer.com/blogs/workingwithcode/7766119-when-to-use-stderr-instead-of-stdout
2015-09-30 14:19:39 -07:00
b043635868 Documentation: fix-up the kubernetes github URL 2015-09-30 10:58:33 -07:00
533e728b64 Merge pull request #3609 from yichengq/raft-snapshot
raft: kill TODO about behavior when snapshot fails
2015-09-29 19:32:31 -07:00
4c82b481a5 raft: improve behavior when snapshot fails
etcd is going to support incremental snapshot, and we design to let it
send at most one snapshot out at first stage. So when one snapshot is in
flight, snapshot request will return error.

When failing to get snapshot when sending MsgSnap, raft prints out
related log and abort sending this message.
2015-09-29 19:15:15 -07:00
a535cf2cad Merge pull request #3610 from yichengq/load-storage
etcdserver: restore v3 storage when restart
2015-09-29 11:58:38 -07:00
49d262185d Merge pull request #3590 from yichengq/discovery-log
etcdmain: improve log when join discovery fails
2015-09-29 08:02:18 -07:00
33a0df3e33 etcdctl: use a context with -total-timeout in simple commands
Like the commit 8ebc933111, this commit lets simple etcdctl commands
use a context with timeout value passed via -total-timeout.

This commit doesn't change complex commands like watch,
cluster-health, and import because it is not obvious that using the
context in the commands is good or not.
2015-09-29 17:23:01 +09:00
5d906a0acc etcdserver: restore v3 storage when restart
To load the previous data.
2015-09-29 00:14:27 -07:00
939aa96a34 etcdmain: improve log when join discovery fails
Before this PR, the log is

```
2015/09/1 13:18:31 etcdmain: client: etcd cluster is unavailable or
misconfigured
```

It is quite hard for people to understand what happens.

Now we print out the exact reason for the failure, and explains the way
to handle it.
2015-09-28 23:23:50 -07:00
783884a04e Merge pull request #3606 from kkaneda/kkaneda/tiny_fix
raft: remove an obsolete TODO comment on 4MB maxMsgSize hard coding
2015-09-28 21:44:45 -07:00
f602767e50 raft: remove an obsolete TODO comment on 4MB maxMsgSize hard coding
The TODO comment was added by 7571b2cd, and it was addressed by d9b5b56c.
2015-09-28 21:31:12 -07:00
6c05a01ec6 Merge pull request #3604 from gyuho/replace_netutil_BasicAuth
etcdhttp/auth: BasicAuth method in standard pkg
2015-09-28 15:55:46 -07:00
6264a41e22 ectd/Getting-etcd: update README to require Go1.4+
Notice `For those wanting to try the very latest version,`
2015-09-28 15:35:09 -07:00
e16f81838b etcdhttp/auth: BasicAuth method in standard pkg
I created a new PR from https://github.com/coreos/etcd/pull/3598.
This is for `TODO: use the standard lib BasicAuth method when we move to
Go 1.4.` [1]. `BasicAuth` method got into Go standard package a year ago. [2]

---
1. https://github.com/coreos/etcd/blob/master/pkg/netutil/netutil.go#L126-L138
2. https://codereview.appspot.com/76540043/
2015-09-28 14:02:55 -07:00
7410698761 Merge pull request #3530 from mitake/etcdctl-timeout-v2
etcdctl: use user specified timeout value for entire command execution
2015-09-28 09:45:02 -07:00
8ebc933111 etcdctl: use user specified timeout value for entire command execution
etcdctl should be capable to use a user specified timeout value for
total command execution, not only per request timeout. This commit
adds a new option --total-timeout to the command. The value passed via
this option is used as a timeout value of entire command execution.

Fixes coreos#3517
2015-09-28 10:31:46 +09:00
c645ac23c0 docs: fix link 2015-09-26 17:43:33 -07:00
49d52eaf1e Merge pull request #3596 from xiang90/json_header
etcdhttp: add Content-Type: application/json header to version handler
2015-09-25 15:27:29 -07:00
1226838381 etcdhttp: add Content-Type: application/json header to version handler 2015-09-25 15:14:13 -07:00
c9be719d92 Merge pull request #3579 from gyuho/etcdserver/etcdhttp/httptypes/errors.go-WriteTo-returns-error
httptypes: WriteTo to return error
2015-09-25 14:31:48 -07:00
93edabf85f Merge pull request #3594 from yichengq/exit
etcdmain: exit after print out ErrDuplicateID
2015-09-25 14:28:45 -07:00
dc9a75df1c etcdmain: exit after print out ErrDuplicateID
etcd should exit after printing log for unhandlable error.
2015-09-25 14:10:50 -07:00
60a641762b Merge pull request #3593 from xiang90/fix_race
pkg/transport: fix a data race in TestWriteReadTimeoutListener
2015-09-25 10:16:17 -07:00
5d033c22af pkg/transport: fix a data race in TestWriteReadTimeoutListener 2015-09-25 10:02:37 -07:00
dff702b2b8 Merge pull request #3564 from gouyang/master
Improve proxy log for retrying an unavailable endpoint
2015-09-25 10:02:15 -07:00
85f4475f62 httptypes/errors: HTTPError.WriteTo returns error
Squashing all commits into this one
(from https://github.com/coreos/etcd/pull/357).

Thanks,
2015-09-25 08:06:26 -07:00
e35eeeae42 proxy: improve log for retrying an unavailable endpoint
Fixes #3541

Signed-off-by: Guohua ouyang <guohuaouyang@gmail.com>
2015-09-25 07:36:49 +08:00
9de7f24301 Merge pull request #3554 from mitake/reconfig-doc
doc: add a description of -strict-reconfig-check
2015-09-24 08:07:32 -07:00
78791f81a6 doc: add a description of -strict-reconfig-check 2015-09-24 11:44:55 +09:00
0813a0f2d1 Merge pull request #3585 from xiang90/fix_hash
storage: fix hash by iterating kv
2015-09-23 11:39:21 -07:00
385e17583f storage: fix hash by iterating kv 2015-09-23 11:28:33 -07:00
370ce37d32 Merge pull request #3584 from mickep76/master
docs/libraries-and-tools: add etcd-export tool
2015-09-23 09:32:35 -07:00
c1db1338c9 docs/libraries-and-tools: add etcd-export tool 2015-09-23 18:29:11 +02:00
d6db4e6d6b Merge pull request #3577 from gyuho/storage/watchable_store.go-defer-fix
storage/watchable_store: defer to Unlock s.mu
2015-09-23 07:37:29 -07:00
4113509828 storage/watchable_store: defer to Unlock s.mu
New PR from https://github.com/coreos/etcd/pull/3575.
This add `defer` to `s.mu`. Current code does not `Unlock`
in the correct scope, I think.

(Sorry, I accidentally deleted my fork so the changes
might not sound continuous from my previous pull requests.)
2015-09-22 23:25:07 -07:00
89acdd6245 Merge pull request #3555 from xiang90/proxy_doc
doc: add proxy promotion doc
2015-09-22 12:59:40 -07:00
932bb76cbb Merge pull request #3570 from yichengq/extend-timeout
integration: extend request timeout
2015-09-22 10:17:13 -07:00
eba8a2ed90 Merge pull request #3566 from xiang90/error_msg
etcdsever: mismatch error uses the same format as the corresponding flag
2015-09-22 07:41:46 -07:00
13cfb4284f Merge pull request #3573 from TheHippo/patch-1
docs/security: fixed command typo
2015-09-22 07:41:30 -07:00
2540a3fb7e etcdsever: mismatch error uses the same format as the corresponding flags 2015-09-21 19:32:10 -07:00
94f3297299 docs/security: fixed command typo
`-peer-client-cert-atuh` should be `-peer-client-cert-auth`
2015-09-22 03:39:29 +02:00
305a0d7ab9 integration: extend request timeout
Extend request timeout to give etcd cluster enough time to return
response.
2015-09-21 16:50:22 -07:00
ea3dbfed60 Merge pull request #3408 from MSamman/extend-auth-api
etcdserver: extend auth api
2015-09-21 11:51:19 -07:00
999b2c6ec2 doc: add proxy promotion doc 2015-09-21 11:47:37 -07:00
6188933c81 Merge pull request #3556 from xiang90/better_error_logging
etcdmain: better logging when user forget to set initial flags
2015-09-21 10:52:34 -07:00
3b70bf87c3 etcdmain: better logging when user forget to set initial flags 2015-09-21 10:43:26 -07:00
574d1b0d46 Merge pull request #3563 from dnaeon/fixes
Fix etcd/client API example
2015-09-21 10:06:41 -07:00
d6459b8b84 client: Fix API example 2015-09-21 19:51:29 +03:00
6ae1f6c6e4 etcdserver: extend auth api
allow recursive query on users and roles to get more detail

Fixes #3278
2015-09-21 00:51:18 -07:00
f3d2b5831c Merge pull request #3558 from yichengq/watch
storage: add tests for RangeEvents and its underlying functions
2015-09-20 23:58:41 -07:00
cbddb8670a Merge pull request #3561 from ceh/raft-doc-typo
raft: fix Node doc typo
2015-09-20 21:52:34 -07:00
b9f22cb69b raft: fix Node doc typo 2015-09-21 06:13:33 +02:00
d72914c36f storage: clarify comment for store.RangeEvents and fix related bugs
Change to the function:
1. specify the meaning of startRev and endRev parameters
2. specify the meaning of returned nextRev

Moreover, it adds unit tests for the function.
2015-09-19 23:17:03 -07:00
5709b66dfb storage: add unit test for index.RangeEvents 2015-09-19 23:08:24 -07:00
87b5143b15 storage: fix missing continue in keyIndex.since
It should continue to skip following operations.

The test from rev14 to rev0 fails if it doesn't call continue and append
all revisions of the same main rev to the list.
2015-09-19 23:01:18 -07:00
158d6e0e03 storage: fix calculating generation in keyIndex.since
It should skip last empty generation when the key is just tombstoned.

The rev15 and rev16 in the test fails if it doesn't skip last empty generation
and find previous generations.
2015-09-19 22:58:45 -07:00
06180be154 Merge pull request #3533 from xiang90/proxy
proxy: expose proxy configuration
2015-09-18 14:18:06 -07:00
ac29432aab proxy: add a test for configHandler 2015-09-18 13:43:54 -07:00
0f9b2046ef Merge pull request #3547 from bdarnell/multinode-node-ids
raft: Allow per-group nodeIDs in MultiNode.
2015-09-18 13:29:07 -07:00
b7baaa6bc8 raft: Allow per-group nodeIDs in MultiNode.
This feature is motivated by
https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/replica_tombstone.md
which requires a change to the way CockroachDB constructs its node IDs.
2015-09-18 15:36:36 -04:00
be80d11948 storage: enhance test for keyIndex.Get and keyIndex.Compact
It covers the case that one key is set multiple times in one main
revision now.
2015-09-17 18:26:17 -07:00
cedad49dcf Merge pull request #3543 from mitake/reconfig-remove
etcdserver: forbid removing started member if quorum cannot be preserved in strict reconfig mode
2015-09-17 18:22:53 -07:00
f8859a980d etcdserver: forbid removing started member if quorum cannot be preserved in strict reconfig mode
Like the commit 6974fc63ed, this commit lets etcdserver forbid
removing started member if quorum cannot be preserved after
reconfiguration if the option -strict-reconfig-check is passed to
etcd. The removal can cause deadlock if unstarted members have wrong
peer URLs.
2015-09-18 10:09:57 +09:00
c4b3ad72d9 Merge pull request #3544 from xiang90/bench
v3benchmark: add put benchmark
2015-09-17 15:10:13 -07:00
f69582e1a2 v3benchmark: add put benchmark 2015-09-17 14:48:07 -07:00
97b67fdbfc Merge pull request #3548 from yichengq/travis
storage/backend: extend wait timeout for commit to finish
2015-09-16 14:22:46 -07:00
f7efbe8b14 storage/backend: extend wait timeout for commit to finish
It needs to take more time on travis. Fix:

```
--- FAIL: TestBackendBatchIntervalCommit (0.01s)
		backend_test.go:113: bucket test does not exit
```
2015-09-16 14:14:51 -07:00
ec4142576e Merge pull request #3534 from xiang90/grpc_err
etcdserver: better v3 api error handling
2015-09-16 12:32:28 -07:00
804d80387d Merge pull request #3546 from gae123/patch-1
doc: update admin_guide.md for the recent Go1.5 default MAXPROCS change
2015-09-16 10:44:38 -07:00
7fb0eb8f56 doc: update admin_guide.md for the recent Go1.5 default MAXPROCS change 2015-09-16 10:43:40 -07:00
ce47161ae0 Merge pull request #3540 from xiang90/bench
Godep: add cheggaaa dependency
2015-09-15 16:27:07 -07:00
4628d08879 Godep: add cheggaaa dependency 2015-09-15 16:24:31 -07:00
3a2700141e Merge pull request #3539 from xiang90/bench
godep: use github.com/cheggaaa/pb
2015-09-15 16:12:34 -07:00
38dd680f2e godep: use github.com/cheggaaa/pb 2015-09-15 16:08:07 -07:00
8bb50635ce Merge pull request #3538 from xiang90/bench
benchmarkv3: refactoring the main logic
2015-09-15 15:58:32 -07:00
4deb12fbbb benchmarkv3: refactoring the main logic 2015-09-15 15:57:38 -07:00
3221b6787e Merge pull request #3537 from jonboulle/master
*: add missing license headers + test
2015-09-15 14:19:17 -07:00
108f97d63e test: add license header check 2015-09-15 14:09:01 -07:00
7848ac3979 *: add missing license headers 2015-09-15 14:09:01 -07:00
867954f3ad Merge pull request #3535 from xiang90/rev
storage: add rev into kv interface
2015-09-15 12:54:29 -07:00
6d1f0ce89f storage: add rev into kv interface 2015-09-15 12:11:00 -07:00
94f4069a25 etcdserver: better v3 api error handling 2015-09-15 11:20:06 -07:00
e079f87410 proxy: expose proxy configuration 2015-09-15 10:27:51 -07:00
c082488e23 Merge pull request #3507 from yichengq/watch
storage: support basic watch
2015-09-15 00:04:36 -07:00
ec43e0a4c3 storage: introduce WatchableKV and watch feature
WatchableKV is an interface upon KV, and supports watch feature.
2015-09-14 23:53:03 -07:00
34bfac99c4 Merge pull request #3529 from yichengq/snapshot
etcdserver: rename db file into a formal directory
2015-09-14 23:43:17 -07:00
352cd768c6 etcdserver: fix shadow declaration 2015-09-14 23:25:16 -07:00
05c74bd890 etcdserver: rename db file into a formal directory
and rename it to a formal name
2015-09-14 22:41:40 -07:00
51f1ee055e Merge pull request #3526 from yichengq/snapshot
etcdserver: forbid to unset v3 demo once used
2015-09-14 21:36:39 -07:00
1f0fb3d9aa etcdserver: forbid to unset v3 demo once used
After enabling v3 demo, it may change the underlying data organization
for v3 store. So we forbid to unset --experimental-v3demo once it has
been used.
2015-09-14 21:27:11 -07:00
b1c2d7e526 Merge pull request #3528 from xiang90/compact
*: support v3 compaction
2015-09-14 20:04:50 -07:00
94f784826a *: support v3 compaction 2015-09-14 19:59:36 -07:00
e0d8923f7b Merge pull request #3524 from xiang90/grpc_error
etcdserver: use gRPC error instead of error message in header
2015-09-14 16:38:44 -07:00
7183387110 etcdserver: use gRPC error instead of error message in header 2015-09-14 16:11:13 -07:00
d04382c30e Merge pull request #3525 from gyuho/master
etcdserver, store: fix grammars in comments (a->an existing)
2015-09-14 13:47:49 -07:00
c2dcf7431e etcdserver, store: fix grammars in comments (a->an existing)
I found some grammatical errors in comments.

This pull request was submitted https://github.com/coreos/etcd/pull/3513.
I am resubmitting following the correct guidlines.
2015-09-14 13:41:13 -07:00
1fc122741d Merge pull request #3521 from raoofm/patch-3
doc: faq.md change flag --peers to --endpoint
2015-09-14 09:43:41 -07:00
c7b4c67436 Merge pull request #3514 from xiang90/v3_raft
support clustered v3 api
2015-09-14 09:35:02 -07:00
d685135832 doc: faq.md change flag --peers to --endpoint
doc: faq.md change flag --peers to --endpoint

Changing the flag to --endpoint and mentioning that --peers is deprecated.
2015-09-14 12:22:06 -04:00
451cce4a90 Merge pull request #3516 from xiang90/hash_improved
storage: support hash state
2015-09-13 21:46:12 -07:00
714b5e0b08 storage: support hash state 2015-09-13 21:34:58 -07:00
cdaa263346 Merge pull request #3506 from philips/improve-tocommit-error
raft: improve panic error message
2015-09-13 17:46:53 -07:00
f8fd2c10d6 Merge pull request #3449 from yichengq/cleanup-max-election
Documentation/tuning: cleanup paragraph on max election
2015-09-13 16:55:16 -07:00
95bb6d7584 Merge pull request #3508 from amarshall/patch-3
readme: Use SVG image for build status badge
2015-09-13 15:21:58 -07:00
40e0a33fcd Merge pull request #3511 from xiang90/v3_raft
Procfile: add a v3DemoProcfile
2015-09-13 08:43:14 -07:00
4c81615cef etcdserver: initial support for cluster-wide v3 request 2015-09-13 08:32:01 -07:00
600456f4ba etcdserverpb: update proto file for raftInternalRequest
We needs to assign each raftInternalRequest an ID for getting
the response after it goes through raft.

We also needs an empty response for error case.
2015-09-13 08:28:10 -07:00
ac7253f28e Procfile: add a v3DemoProcfile 2015-09-12 23:08:56 -07:00
662b4966d0 Merge pull request #3510 from xiang90/v3_raft
etcdmain: support gRPC addr flag
2015-09-12 22:58:08 -07:00
a0cfcf2dd7 etcdmain: support gRPC addr flag 2015-09-12 22:52:51 -07:00
35f1531576 Merge pull request #3509 from xiang90/v3_raft
etcdctlv3: support endpoint flag
2015-09-12 22:51:36 -07:00
121d2b9e9d etcdctlv3: support endpoint flag 2015-09-12 22:46:43 -07:00
0894294074 readme: Use SVG image for build status badge
More accessible, better scaling.
2015-09-13 01:12:11 -04:00
0ca800fbac Merge pull request #3479 from mitake/membership
etcdserver: avoid deadlock caused by adding members with wrong peer URLs
2015-09-12 22:09:13 -07:00
dad32646eb etcdserver: enhance test cases for isReadyToAddNewMember
- a case of a cluster with even number members
 - a case of an empty cluster
2015-09-13 12:30:10 +09:00
d9cf752060 etcdserver: add test for isReadyToAddNewMember
Also fixed check for special case of one-member cluster
2015-09-13 11:16:08 +09:00
6974fc63ed etcdserver: avoid deadlock caused by adding members with wrong peer URLs
Current membership changing functionality of etcd seems to have a
problem which can cause deadlock.

How to produce:
 1. construct N node cluster
 2. add N new nodes with etcdctl member add, without starting the new members

What happens:
After finishing add N nodes, a total number of the cluster becomes 2 *
N and a quorum number of the cluster becomes N + 1. It means
membership change requires at least N + 1 nodes because Raft treats
membership information in its log like other ordinal log append
requests.

Assume the peer URLs of the added nodes are wrong because of miss
operation or bugs in wrapping program which launch etcd. In such a
case, both of adding and removing members are impossible because the
quorum isn't preserved. Of course ordinal requests cannot be
served. The cluster would seem to be deadlock.

Of course, the best practice of adding new nodes is adding one node
and let the node start one by one. However, the effect of this problem
is so serious. I think preventing the problem forcibly would be
valuable.

Solution:
This patch lets etcd forbid adding a new node if the operation changes
quorum and the number of changed quorum is larger than a number of
running nodes. If etcd is launched with a newly added option
-strict-reconfig-check, the checking logic is activated. If the option
isn't passed, default behavior of reconfig is kept.

Fixes https://github.com/coreos/etcd/issues/3477
2015-09-13 09:31:53 +09:00
68d4ec3e13 raft: improve panic error message
Give a human being some insight into how we might have gotten to this
state based on feedback from #3504.
2015-09-12 12:17:02 -07:00
d4e19d1afb Merge pull request #3501 from yichengq/update-peers
docs/admin_guide: use ETCDCTL_ENDPOINT
2015-09-12 08:31:47 -07:00
e9512f8c5f docs/admin_guide: use ETCDCTL_ENDPOINT
because ETCDCTL_PEERS is not prefered.
2015-09-11 19:38:55 -07:00
28a371471a Merge pull request #3500 from yichengq/fix-ETCD
libraries-and-tools.md: correct project name to etcd
2015-09-11 19:34:15 -07:00
4e71954111 libraries-and-tools.md: correct project name to etcd
etcd is the official name of the project.
2015-09-11 19:31:40 -07:00
a528cb6f5d Merge pull request #3495 from rekby/patch-2
libraries-and-tools.md: add etcddir
2015-09-11 19:30:03 -07:00
f8f702b3f8 Merge pull request #3497 from jonboulle/master
docs: add official client to libraries-and-tools
2015-09-11 15:17:30 -07:00
fd82f0b8d5 docs: add official client to libraries-and-tools 2015-09-11 15:16:02 -07:00
136efd3ba9 libraries-and-tools.md: add etcddir 2015-09-11 21:04:56 +03:00
c5c3ae4790 Merge pull request #3486 from yichengq/readme
README: warn that master branch is unstable
2015-09-10 19:20:35 -07:00
56d61d995a Merge pull request #3487 from onlyjob/master
Minor spelling corrections (codespell).
2015-09-10 17:46:29 -07:00
b2f4a5f587 *: fix spelling issues (codespell).
Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
2015-09-11 10:22:29 +10:00
bd5f924b0f README: warn that master branch is unstable
Avoid users building from master branch for stable binaries.
2015-09-10 14:27:10 -07:00
1de63deca4 Merge pull request #3483 from xiang90/update_roadmap
roadmap.md: update roadmap for 2.3
2015-09-10 13:32:30 -07:00
f51c2f471b Merge pull request #3482 from yichengq/client
client: add Nodes type to faciliate sorting
2015-09-10 12:29:12 -07:00
07bd9f65d3 roadmap.md: update roadmap for 2.3 2015-09-10 12:24:48 -07:00
2f558e56d2 client: add Nodes to codecgen and regenerate 2015-09-10 11:51:59 -07:00
eb51901830 client: add Nodes type to faciliate sorting
This helps users to sort easily.
2015-09-10 11:03:12 -07:00
db0511e28c *: bump to v2.2.0+git 2015-09-10 10:03:07 -07:00
e4561dd8cf *: bump to v2.2.0 2015-09-10 10:02:45 -07:00
6e7725cd51 Merge pull request #3478 from endocode/kayrus/typo_fix
doc: member id typo fixed
2015-09-10 00:11:26 -07:00
37392ad223 doc: member id typo fixed 2015-09-10 08:47:45 +02:00
9b032c6a00 Merge pull request #3473 from MrLawes/master
doc: fix bad url in using a directory TTL section
2015-09-09 18:57:09 -07:00
1c058e9706 doc: fix bad url in using a directory TTL section 2015-09-10 09:23:10 +08:00
f3085d2ea4 Merge pull request #3459 from yichengq/release-doc
docs/dev: add release doc
2015-09-09 17:46:10 -07:00
b70e6fc677 docs/dev: add release doc
It documents the standard way to release etcd today. Maintainer should
follow this doc to cut release, and update it in time to fit current
situation.
2015-09-09 16:42:31 -07:00
c34cf04c27 Merge pull request #3448 from yichengq/release-script
scripts: add release.sh
2015-09-09 13:54:15 -07:00
bdd8774169 Merge pull request #3204 from endocode/kayrus/recovery
Improved "disaster restore" doc, added "member update" command descri…
2015-09-09 12:23:51 -07:00
19ad634673 doc: improved "disaster restore" doc, added "member update" command description 2015-09-09 20:07:31 +02:00
7d4cd7c76a scripts: add release.sh
It could build all binaries and images for the given version.
2015-09-09 09:50:41 -07:00
af0474f2e3 Merge pull request #3465 from raoofm/patch-1
etcdmain: Proxy doesnt specify - listening on http or https
2015-09-08 14:38:55 -07:00
2de1c36061 etcdmain: Proxy doesnt specify - listening on http or https
etcdmain: Proxy doesnt specify - listening on http or https

Fixes #3464
2015-09-08 17:19:23 -04:00
ccdd10c757 Merge pull request #3463 from yichengq/update-roadmap
roadmap: remove 2.2 section
2015-09-08 13:55:50 -07:00
c837f0526f roadmap: remove 2.2 section
We have finished all of them.
2015-09-08 13:43:39 -07:00
d8e6e217fd Merge pull request #3461 from xiang90/doc
doc: remove one limitation in upgrade doc
2015-09-08 13:29:43 -07:00
3689ea3071 doc: remove one limitation in upgrade doc 2015-09-08 13:28:23 -07:00
a44da0b62a Merge pull request #3451 from raoofm/patch-1
discovery: log error only if both ssl and non-ssl srv lookups fail
2015-09-06 20:54:43 -07:00
9a2809f0b5 discovery: log error only if both ssl and non-ssl srv lookups fail
discovery: log error only if both ssl and non-ssl srv lookups fail
Earlier we were logging as soon as one of the lookups failed.

Fixes #3414
2015-09-06 23:44:19 -04:00
48a4d2ccba Documentation/tuning: cleanup paragraph on max election
- Use one sentence per line for easier diffing
- Walkthrough the thought process and cleanup the grammar
- Move below the other sections

Original author: @philips
2015-09-06 00:38:03 -07:00
184337568d scripts/build-docker: build docker in image-docker dir
The docker build command will use whatever directory contains the
Dockerfile as the build context (including all of its subdirectories).
And the <src> path of ADD must be inside the context of the build.
So change it to build in a specific directory for clean and fast.
2015-09-06 00:17:41 -07:00
15d1db9bf8 scripts/build-aci: support BINARYDIR and BUILDDIR
This makes it more configurable, and is ready for overall release script.
2015-09-06 00:17:41 -07:00
6b70fa72fe scripts: build-release -> build-binary
This makes the functionality of the script more clear, and always use
bash to run the script because it has bash-specific grammar.
2015-09-06 00:16:51 -07:00
cf6cb82caa scripts/build-docker: stop creating scratch image
Scratch image has become docker's reserved image.
2015-09-06 00:16:08 -07:00
a1b01c266a scripts/build-aci: fix the way to check executability
Or it may treat runnable command as unexecutable.
2015-09-06 00:15:31 -07:00
b9646b5734 Merge pull request #3447 from xiang90/txn
etcdctlv3: fix txn command
2015-09-05 18:21:11 -07:00
1532f7585b etcdctlv3: fix txn command 2015-09-05 16:08:15 -07:00
dab0871acb Merge pull request #3446 from xiang90/v3
etcdserver: refactor v3demo do
2015-09-05 15:41:00 -07:00
95d5556445 etcdserver: refactor v3demo do 2015-09-05 15:31:28 -07:00
d5ab71a4e8 Merge pull request #3445 from xiang90/api_doc
doc: add monitoring section to admin doc
2015-09-05 08:27:11 -07:00
13b3c64c10 doc: add monitoring section to admin doc 2015-09-05 08:25:35 -07:00
51d0630a8e Merge pull request #3440 from yichengq/memory-bench
docs/benchmark: add 2.2.0-rc memory usage benchmark
2015-09-04 20:23:56 -07:00
91b5b247e9 docs/benchmark: add 2.2.0-rc memory usage benchmark
It records the memory usage for different average value size, and
records the data size limitation.
2015-09-04 18:27:49 -07:00
106d918dd5 Merge pull request #3444 from xiang90/doc
etcdctl: suggest endpoint over peer
2015-09-04 13:22:03 -07:00
322aab133d etcdctl: suggest endpoint over peer 2015-09-04 13:16:33 -07:00
9fa05ad8a0 Merge pull request #3443 from xiang90/test
test: now raft has no shadow issue
2015-09-04 11:31:44 -07:00
39580479b5 Merge pull request #3442 from xiang90/b
etcdctl: prepare for health endpoint change
2015-09-04 11:30:44 -07:00
a6e67a6dec test: now raft has no shadow issue
We can test raft pkg now!
2015-09-04 10:52:14 -07:00
778f8d8fea Merge pull request #3434 from xiang90/index_revision
*: v3api index->revision
2015-09-04 10:48:59 -07:00
3f18ded10a *: v3api index->revision 2015-09-04 10:41:20 -07:00
5a5f15de39 Merge pull request #3438 from yichengq/storage-test
storage: add mock tests for store struct
2015-09-04 10:26:08 -07:00
04539c6240 etcdctl: prepare for health endpoint change
We made a mistake on the health endpoint by returning a string "true".
We have to make the etcdctl works for the next version of etcd which
will correct the mistake on the server side.

It is too late to change the server side right now since we already
released a version of etcdctl that only understands "true".
2015-09-04 10:20:24 -07:00
215f27c2f5 storage: add mock tests for store struct 2015-09-04 08:53:49 -07:00
8ca76a789b Merge pull request #3439 from akolb1/godep_all_fixes
Godep: fixed missing dependencies
2015-09-03 22:20:48 -07:00
2782418923 Godep: fixed missing dependencies 2015-09-04 04:51:44 +00:00
5ae2eb4731 storage: avoid one extra round of wait
It could exit early if it knows that there is no more keys.
2015-09-03 19:12:27 -07:00
9175df7c71 storage: correct revision for range when deleteRange
to make it logically reasonable.
2015-09-03 19:12:27 -07:00
797a4796d9 storage: remove check for DELETE type KeyValue
kvindex always returns kvs that exist at given revision, so there is no
need to check for whether the KeyValue range from backend is DELETE type.
2015-09-03 19:12:27 -07:00
00e31f13a6 storage: remove unnecessary rev parameter 2015-09-03 19:12:27 -07:00
2f2b084ab5 Merge pull request #3436 from xiang90/remove_consistent_token
*: replace consistent token with revision in v3 api
2015-09-03 17:16:07 -07:00
254d641ff9 Merge pull request #3429 from xiang90/upgrade_doc
doc: add upgrade to 2.2 doc
2015-09-03 15:47:10 -07:00
2ac9af4924 *: replace consistent token with revision in v3 api 2015-09-03 15:41:33 -07:00
243fe519a9 Merge pull request #3435 from xiang90/gogoproto
*: update gogoproto
2015-09-03 15:35:48 -07:00
ef7cf058a2 *: update gogoproto 2015-09-03 15:32:25 -07:00
356aba7595 doc: add upgrade to 2.2 doc 2015-09-03 11:48:30 -07:00
ae2b43b588 Merge pull request #3433 from tamird/proto-import-path
*: regenerate proto to use local import path
2015-09-03 10:52:37 -07:00
45390b9fb8 *: regenerate proto to use local import path
Using Go-style import paths in protos is not idiomatic. Normally, this
detail would be internal to etcd, but the path from which gogoproto
is imported affects downstream consumers (e.g. cockroachdb).

In cockroach, we want to avoid including `$GOPATH/src` in our protoc
include path for various reasons. This patch puts etcd on the same
convention, which allows this for cockroach.

More information: https://github.com/cockroachdb/cockroach/pull/2339#discussion_r38663417

This commit also regenerates all the protos, which seem to have
drifted a tiny bit.
2015-09-03 13:38:28 -04:00
84d1527df6 Merge pull request #3432 from coreos/robszumski-patch-1
docs: insert whitespace
2015-09-03 09:56:57 -07:00
49e7e6eb9f docs: insert whitespace
Fixes the rendering of this page on https://coreos.com/etcd/docs/2.1.0/proxy.html
2015-09-03 09:50:07 -07:00
1eaf169057 Merge pull request #3395 from yichengq/backend-test
storage/backend: add unit tests for backend and batchTx
2015-09-03 07:23:38 -07:00
44fd734038 storage/backend: add unit tests for backend and batchTx 2015-09-02 16:57:13 -07:00
16e9e4b3d5 Merge pull request #3412 from yichengq/etcdctl-sync
etcdctl: better logging for sync process
2015-09-02 16:49:00 -07:00
8e040efed9 etcdctl: log more about sync process
Users don't even know that etcdctl is doing sync and fails on sync
process. So we add more logs for sync process.
2015-09-02 16:10:25 -07:00
3a8db488ca Merge pull request #3415 from yichengq/better-err
etcdctl/command: print more details about ErrNoEndpoint
2015-09-02 10:11:45 -07:00
41cc16481f Merge pull request #3418 from AdoHe/fix_build_script_error
build: fix build error on ubuntu
2015-09-01 22:44:23 -07:00
9665cda7c1 build: fix build error on ubuntu 2015-09-02 13:28:55 +08:00
484a115813 Merge pull request #3424 from akolb1/bolt_solaris1
Godeps: boltdb dependency missing solaris support
2015-09-01 16:19:23 -07:00
ecbc44fb63 Godeps: boltdb dependency missing solaris support 2015-09-01 23:17:36 +00:00
423e3bbbd8 etcdctl/cluster_health: provide better message for empty client urls
It skips sync when init client, and prints out unreachable messagen and
points to notice when checking health of etcd members one by one.
2015-09-01 14:42:19 -07:00
aa0c8fea55 Merge pull request #3321 from yichengq/doc-tls-setup
docs/security: link cfssl example
2015-09-01 14:28:40 -07:00
6caae58814 docs/security: recommend cfssl instead of etcd-ca
This provides a more general and stable way for users to set TLS cluster.
2015-09-01 14:07:26 -07:00
d412eaa3a2 Merge pull request #3308 from yichengq/go-codec
Use ugorji codec for unmarshalling key responses in client
2015-09-01 14:04:38 -07:00
53b8175d3f Merge pull request #3421 from xiang90/3411
etcdmain: proxy does not need to belong to the discovered cluster
2015-09-01 13:49:31 -07:00
7957677cf2 etcdmain: proxy does not need to belong to the discovered cluster 2015-09-01 11:24:02 -07:00
a94118893c Merge pull request #3413 from xiang90/snapshot_dir
*: support wal dir
2015-09-01 10:03:50 -07:00
d94e712d91 *: support wal dir 2015-09-01 09:54:27 -07:00
85b6c51a23 Merge pull request #3420 from yichengq/wait-more
storage: extend timeout to wait for put complete
2015-09-01 09:25:46 -07:00
a21166c3aa storage: extend timeout to wait for put complete
travis is sometimes slow, and it could fail to complete the put in 10ms.
2015-09-01 09:03:03 -07:00
8ac981e1ee Merge pull request #3416 from yichengq/get-cluster-timeout
etcdserver: add timeout param on getClusterFromRemotePeers
2015-09-01 09:00:19 -07:00
f3bfcb9dee etcdserver: add timeout param on getClusterFromRemotePeers
It sets 10s timeout for public GetClusterFromRemotePeers.

This helps the following cases to work well in high latency scenario:

1. proxy sync members from the cluster
2. newly-joined member sync members from the cluster

Besides 10s request timeout, the request is also controlled by dial
timeout and read connection timeout.
2015-09-01 08:49:01 -07:00
1fabc48968 Merge pull request #3404 from bdarnell/multinode-propose-panic
raft: A removed node can no longer be leader.
2015-08-31 20:06:34 -07:00
4f20e01f60 raft: Ignore proposals if not a current member.
Fixes another panic in MultiNode.Propose.
2015-08-31 20:31:14 -04:00
c2caa4ae3b etcdctl/command: print more details about ErrNoEndpoint
This commit prints more details if getting ErrNoEndpoint when sync with
cluster. This helps users to know what happens.
2015-08-31 16:28:43 -07:00
4b9b0cbcc1 storage: add newBackend and newBatchTx
This is for ease of testing.
2015-08-31 13:25:10 -07:00
57b39aca4e Merge pull request #3403 from xiang90/doc
doc: add 0.4.9 to 2.2 migration guide
2015-08-31 11:28:25 -07:00
3c1f80bdff Merge pull request #3401 from xiang90/more_metrics
more on storage metrics
2015-08-31 09:55:29 -07:00
406bb6749e doc: add 0.4.9 to 2.2 migration guide 2015-08-31 09:55:12 -07:00
bc71aab07a Merge pull request #3409 from xiang90/fix_force_new
etcdserver: ignore confChangeUpdateNode in getIDs
2015-08-31 09:44:10 -07:00
1bcaa9f4a1 etcdserver: ignore confChangeUpdateNode in getIDs 2015-08-31 09:36:39 -07:00
aaa7dfc14d Merge pull request #3407 from MSamman/fix-build-warning
build: fixed build warning
2015-08-31 07:47:23 -07:00
dd4317db43 build: fixed build warning
to clear warning and ensure git sha linkage works in the future

Fixes #3406
2015-08-30 15:05:56 -07:00
b9632e0f8d storage: register txnCounter 2015-08-28 15:17:16 -07:00
dd443be41b storage: report total number of keys 2015-08-28 15:16:53 -07:00
d2cb732c7b test: activate test on storage/backend 2015-08-28 13:52:31 -07:00
054fab84ee storage/backend: remove startc var
This makes start logic cleaner.
2015-08-28 13:52:31 -07:00
fca98c9071 Merge pull request #3398 from xiang90/storage_metrics
storage: add initial metrics for kv
2015-08-28 13:50:44 -07:00
b5838edb93 storage: add initial metrics for kv 2015-08-28 13:41:42 -07:00
6cbaaa715c Merge pull request #3396 from bdarnell/multinode-propose-panic
raft: Fix a nil-pointer panic in MultiNode.Propose.
2015-08-28 12:34:49 -07:00
cba7c6a180 *: bump to v2.2.0-rc.0+git 2015-08-28 10:26:56 -07:00
dc3e027288 *: bump to v2.2.0-rc.0 2015-08-28 10:26:32 -07:00
b40e077047 Merge pull request #3388 from sckott/docfix-tuning
fix docs, change tuning link in api.md from section to file
2015-08-28 09:23:58 -07:00
05924b330a raft: Fix a nil-pointer panic in MultiNode.Propose. 2015-08-28 11:17:59 +02:00
f04884f74d storage/backend: fix off-by-one error for pending var
Or it may commit until batchLimit + 1.
2015-08-27 22:51:32 -07:00
7ed929fb3d storage/backend: fix limit doesn't effect in range 2015-08-27 22:51:32 -07:00
37d9354aa2 Merge pull request #3394 from yichengq/bench-2.2
adjust file and README in docs/benchmark
2015-08-27 21:09:39 -07:00
9d78d84270 Merge pull request #3390 from xiang90/ctl_peer
etcdctl: suggest endpoint over peers flag
2015-08-27 21:03:39 -07:00
8d8033df55 etcdctl: suggest endpoint over peers flag 2015-08-27 18:52:17 -07:00
753a079700 docs/benchmark: add benchmark result links in README 2015-08-27 17:08:49 -07:00
425afa66ea docs/benchmarks: update bench version for more accuracy 2015-08-27 17:08:30 -07:00
f68e4a1a5d Merge pull request #3392 from yichengq/bench-2.2
docs/benchmark: update etcd 2.2 bench
2015-08-27 16:58:04 -07:00
605f0ce730 docs/benchmark: update etcd 2.2 bench
This benchmark is for etcd 2.2 rc after fixing several performance
downgrade bugs.
2015-08-27 16:52:55 -07:00
b0192118dd doc: change tuning link in api.md from section to file 2015-08-27 15:04:07 -07:00
1124a06860 Merge pull request #3387 from yichengq/fix-quorum
doc: correct calculation of fault tolerance of an etcd cluster in adm…
2015-08-27 14:48:39 -07:00
bc2b8856d7 doc: correct calculation of fault tolerance of an etcd cluster in admin_guide.md
doc: correct calculation of fault tolerance of an etcd cluster in admin_guide.md
2015-08-27 14:30:12 -07:00
df83af944b Merge pull request #3384 from yichengq/fix-shadow
test: use go vet shadow feature instead of go-nyet
2015-08-27 14:27:57 -07:00
92cd24d5bd *: fix govet shadow check failure 2015-08-27 14:15:30 -07:00
b2d33e6dcb Merge pull request #3382 from xiang90/env
pkg/flags: print out evn usage information
2015-08-27 13:36:55 -07:00
ccdb850e1e test: use go vet shadow feature instead of go-nyet
Use official support instead of home-made one.
2015-08-27 13:29:12 -07:00
4ac4648b5b Merge pull request #3383 from cognusion/fixes2
Test Fixes: Take 2
2015-08-27 13:22:19 -07:00
327632014e cors: Removed new(?) header from test, resolving failure
"X-Content-Type-Options" was being autoadded, but none of the
test maps took it into account. I saw that "Content-Type" was
also being deleted, so I figured that was the best solution
for this as well.
2015-08-27 15:23:14 -04:00
19a28c8efd storage: Fixed backend test
./backend_test.go:23: multiple-value batchTx.UnsafeRange() in single-value context
2015-08-27 15:20:29 -04:00
32372e1d70 raft: Fixed a test misassumption
network_test.go:56: total = 59.22354ms, want > 50ms
59 is > 50, but the equation added 10 to the right side
2015-08-27 15:15:34 -04:00
c8f5e03b75 pkg/flags: print out evn usage information 2015-08-27 12:08:31 -07:00
25c87f13fd Merge pull request #3354 from mx2323/faq
add faq documentation
2015-08-26 16:36:04 -07:00
8f3ea5ebed doc: add faq documentation 2015-08-26 16:34:52 -07:00
59a5a7e309 Merge pull request #3368 from yichengq/storage-test
add unit tests for storage
2015-08-26 15:32:02 -07:00
0d38c13990 storage: use temp path to handle test file 2015-08-26 15:01:41 -07:00
2d01eb4e11 storage: add tests for kvstore_compaction 2015-08-26 15:01:13 -07:00
f38778160d Merge pull request #3376 from yichengq/connection-down
etcdserver: specify request timeout error due to connection down
2015-08-26 13:09:30 -07:00
0813139140 storage: add more tests for index 2015-08-26 12:53:30 -07:00
3723f01b48 storage: add more unit tests for keyIndex 2015-08-26 12:53:30 -07:00
ad8a291dc1 storage: return error when tombstone on new generation
It is not allowed to put tombstone on an empty generation.
2015-08-26 12:53:30 -07:00
ffa87f9678 storage: fix the comment in generation.walk 2015-08-26 12:53:30 -07:00
8f6bf029f8 etcdserver: specify request timeout error due to connection lost
It specifies request timeout error possibly caused by connection lost,
and print out better log for user to understand.

It handles two cases:
1. the leader cannot connect to majority of cluster.
2. the connection between follower and leader is down for a while,
and it losts proposals.

log format:
```
20:04:19 etcd3 | 2015-08-25 20:04:19.368126 E | etcdhttp: etcdserver:
request timed out, possibly due to connection lost
20:04:19 etcd3 | 2015-08-25 20:04:19.368227 E | etcdhttp: etcdserver:
request timed out, possibly due to connection lost
```
2015-08-26 12:38:37 -07:00
76db9747f8 Merge pull request #3377 from yichengq/tls-info-string
pkg/transport: print ClientCertAuth in TLSInfo.String()
2015-08-25 22:45:10 -07:00
45bb88069b Merge pull request #3378 from yichengq/set-late
etcdmain: check error before assigning peer transport
2015-08-25 22:38:36 -07:00
58455a2ae4 etcdmain: check error before assigning peer transport
Or it may panic when new transport fails, e.g., TLS info is invalid.
2015-08-25 22:04:26 -07:00
57e88465bf pkg/transport: print ClientCertAuth in TLSInfo.String()
It is good to print it in debug output:

```
21:56:12 etcd1 | 2015-08-25 21:56:12.162406 I | etcdmain: peerTLS: cert
= certs/etcd1.pem, key = certs/etcd1-key.pem, ca = , trusted-ca =
certs/ca.pem, client-cert-auth = true
```
2015-08-25 21:53:52 -07:00
6250fed8a8 Merge pull request #3096 from philips/tls-info-debug
pkg/transport: include debug output for trusted-ca
2015-08-25 20:08:19 -07:00
008f988f6b Merge pull request #3375 from xiang90/doc
doc: add evn variable name to configuration.md
2015-08-25 14:48:35 -07:00
2b58da1699 Merge pull request #3374 from yichengq/gomaxprocs
etcdmain: change default GOMAXPROCS when compiling in go1.5
2015-08-25 14:48:00 -07:00
35a0459cc8 doc: add evn variable name to configuration.md 2015-08-25 14:35:15 -07:00
32ab3f6931 Merge pull request #3372 from xiang90/doc
improve clustering.md doc
2015-08-25 14:04:30 -07:00
c30c85898e doc: add explanation for client urls 2015-08-25 13:46:27 -07:00
2ac9a329ab etcdmain: stop setting GOMAXPROCS explicitly
We always want to use GOMAXPROCS() as the way go parses it. When in go1.4, we
want to expose GOMAXPROCS value, so we set GOMAXPROCS explicitly as the
way go 1.4 does and print it out.

But it becomes a problem when go 1.5 changes the way to set GOMAXPROCS.

Fix the problem by stop setting GOMAXPROCS and get its value directly.

Due to this change, it sets default GOMAXPROCS to the
number of CPUs available when compiling in go 1.5, which matches how go 1.5 works:
https://docs.google.com/document/d/1At2Ls5_fhJQ59kDK2DFVhFu3g5mATSXqqV5QrxinasI/edit

This is a behavior change in etcd 2.2.
2015-08-25 13:38:16 -07:00
a4285ef5c9 Merge pull request #3367 from MSamman/master
etcdserver: handle malformed basic auth
2015-08-25 13:12:48 -07:00
e2e002f94e etcdserver: handle malformed basic auth
return insufficient credentials if basic auth header is malformed

Fixes #3280
2015-08-25 12:37:24 -07:00
7bd558b2e0 Merge pull request #3373 from ecnahc515/add_report_bugs_contributing
Contributing: Link to reporting bugs doc
2015-08-25 12:17:06 -07:00
ad843341a9 Contributing: Link to reporting bugs doc 2015-08-25 12:15:03 -07:00
f56c5455f3 doc: mention reconfiguration design in clustering.md 2015-08-25 11:22:08 -07:00
986f354694 Merge pull request #3371 from xiang90/bolt
Godeps: update bolt dependency
2015-08-25 11:17:14 -07:00
e8f40b0412 storage/backend: add commitAndStop
After the upgrade of boltdb, db.Close waits for all txn to finish.
CommitAndStop commits the current txn and stop creating new ones.
2015-08-25 10:57:25 -07:00
8738a88fae Godeps: update bolt dependency 2015-08-25 10:39:29 -07:00
2d06f6b371 Merge pull request #3362 from yichengq/rafthttp-cancel
rafthttp: always cancel in-flight request when stop streamReader
2015-08-25 09:26:46 -07:00
61a75b3d48 rafthttp: always cancel in-flight request when pipeline.send
This fits the way for go1.5 to cancel request.
2015-08-25 09:07:49 -07:00
27b9963959 client: always cancel in-flight request when do request
This fits the way for go1.5 to cancel request.
2015-08-25 09:04:58 -07:00
ece39c9462 proxy: always cancel in-flight request
This fits the way for go1.5 to cancel request.
2015-08-25 08:59:59 -07:00
6fc638673c rafthttp: return err if stopped before setting cancel in dial()
The original workflow may fail to cancel if stop() cancels the finished
request just before dial() assigning a new cancel. This commit checks
streamReader status before setting cancel to avoid this problem.

It is tested at travis for 300 times. go 1.5 always works well, while
go 1.4 fails to stop once.
2015-08-25 08:59:12 -07:00
fc95ec0cc6 rafthttp: always cancel in-flight request when stop streamReader
This problem is totally fixed at 1.5.

go1.5 adds a Request.Cancel channel, which allows for "race free"
cancellation
(8b4278ffb7).
Our implementation relies on it to always cancel in-flight request.
2015-08-25 08:54:13 -07:00
0132b091d2 Merge pull request #3360 from yichengq/bench-3
*: add initial read benchmark for etcd v3
2015-08-25 07:58:30 -07:00
3632a1b9b1 *: add initial read benchmark for etcd v3
It includes the initial read benchmark for etcd v3.

This is the first step to give some rough thoughts. I haven't digged
deeper to answer some questions, including why its performance is not
better than HTTP + json, why one put will cause performance downgrade.
2015-08-25 07:50:18 -07:00
e3ef1d363a Merge pull request #3366 from xiang90/v3_proto
update v3 proto and doc
2015-08-24 11:22:29 -07:00
0cb45aee64 rfc: update v3 proto 2015-08-24 11:00:51 -07:00
1cccbb5ebd etcdserverpb: add comments for compaction 2015-08-24 10:52:54 -07:00
3a60d490d1 storagepb: fix comment location 2015-08-24 10:42:16 -07:00
4a5b94478e etcdserverpb: update comment for txn request 2015-08-24 10:40:05 -07:00
98ceb3cdbd etcdserverpb: add more field into rangeResponse 2015-08-24 10:33:20 -07:00
c7f10ed975 Merge pull request #3361 from yichengq/no-log
integration: only print critical log
2015-08-24 09:44:13 -07:00
3702be476b integration: only print critical log
This limits the logs printed out in integration test, so it will not
have log flood and help us read fatal log in travis.
2015-08-23 21:22:21 -07:00
514c4371a9 Merge pull request #3359 from yichengq/storage-test
functional tests for storage package and some related fixes
2015-08-23 21:12:36 -07:00
1e2b0acf6d test: activate test for storage package 2015-08-23 20:59:06 -07:00
9c0c314425 storage: add functional tests for the package
It adds and reorganize tests to construct functional tests.
2015-08-23 20:59:06 -07:00
9960651c3f storage: let range work in the process of txn
range should work in the process of txn to help check the status during the
txn.
2015-08-23 20:59:06 -07:00
6d97dcaf3f storage: ensure that desired compaction is persisted
It needs to persist the desired compaction, so it won't forget the compaction
if it crashes later.
2015-08-23 20:59:06 -07:00
353f10ca2b storage: reject to compact on future rev
Compaction on future rev is unreasonable.
2015-08-23 20:59:06 -07:00
47b243be5d storage: let TxnDeleteRange return rev if no error
If it doesn't return error, it should return valid rev.
2015-08-23 20:59:06 -07:00
62f7481b19 storage: keyIndex.get returns err when key is tombstoned
Before this commit, it will return wrong create index, mod index.

It lets findGeneration return error when rev is at the gap of two
generations. This leads to the change of compact() code.
2015-08-23 20:59:02 -07:00
3b2fa9f1de storage: fix TestKeyIndexCompact
It fails to pass before.
2015-08-23 17:22:49 -07:00
97b211c8ba Merge pull request #3357 from ccding/master
go vet
2015-08-22 10:29:29 -07:00
c09b667d57 *: fix go vet reported issues 2015-08-22 12:19:02 -05:00
044b23c3ca Merge pull request #3356 from xiang90/travis
*: test gofmt with -s and fix reported issues
2015-08-21 18:59:51 -07:00
6b23a8131f *: test gofmt with -s and fix reported issues 2015-08-21 18:52:16 -07:00
301b7f57c0 Merge pull request #3355 from yichengq/health-var
etcdctl/cluster_health: set health var when checked healthy
2015-08-21 15:37:15 -07:00
224755855d etcdctl/cluster_health: set health var when checked healthy
This was a typo.
2015-08-21 15:27:35 -07:00
84b614c508 Merge pull request #3342 from xiang90/travis
travis: test for go 1.5 build
2015-08-21 14:49:00 -07:00
1dcc145aef client: fix test 2015-08-21 14:36:29 -07:00
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
3c1e6b54b3 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 12:09:17 -07:00
1c334979cd 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 12:08:17 -07:00
7b871aab41 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 11:58:37 -07:00
b1192e5c48 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 10:15:08 -07:00
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
8ea3d157c5 Revert "Revert "Treat URLs have same IP address as same""
This reverts commit 3153e635d5.

Conflicts:
	etcdserver/config.go
2015-08-21 09:41:13 -07:00
07af0b3e5b Merge pull request #3346 from xiang90/auth_skip
etcdserver/auth: cache auth enable result
2015-08-20 23:32:29 -07:00
11a689d063 etcdserver/auth: cache auth enable result 2015-08-20 23:05:00 -07:00
e8e507b29b Merge pull request #3348 from xiang90/l
use limited listener from golang
2015-08-20 22:44:51 -07:00
ff37cc455c pkg/transport: remove home-grown limitedListener 2015-08-20 20:03:27 -07:00
92634356c1 *: use limitedListener from golang 2015-08-20 20:02:35 -07:00
da9a12b97c Merge pull request #3344 from xiang90/startup_version
etcdmain: print out version information on startup
2015-08-20 15:10:25 -07:00
6b77c146ec etcdmain: print out version information on startup 2015-08-20 14:50:16 -07:00
31395d257c travis: test for go 1.5 build 2015-08-20 11:39:41 -07:00
7cf9770e12 Merge pull request #3340 from xiang90/fix_perallocate
pkg/fileutil: treat not support error as nil error in preallocate
2015-08-20 11:38:03 -07:00
3ca5482251 pkg/fileutil: treat not support error as nil error in preallocate 2015-08-20 11:15:02 -07:00
4a6d6b0052 Merge pull request #3338 from spacejam/master
Reversion->Revision
2015-08-20 10:16:31 -07:00
acd7a92f03 storage: reversion -> revision 2015-08-20 08:39:07 -07:00
e1dfcec0ab Merge pull request #3327 from yichengq/bench-2.2
docs/benchmarks: add benchmark result for 2.2
2015-08-20 00:18:32 -07:00
807de81172 docs/benchmarks: add benchmark result for 2.2
And it analyzes the reason for performance changes.
2015-08-19 23:59:33 -07:00
795e962403 Merge pull request #3334 from mitake/snap-marsharing-prometheus
snap: export durations of marsharing cost during snapshot save
2015-08-19 20:59:04 -07:00
7a6d33620f snap: export durations of marshalling cost during snapshot save
Currently, total duration of snapshot saving is exported for
prometheus. For more detailed analysis, this commit let etcd export
durations of marshalling for prometheus.
2015-08-20 12:47:07 +09:00
46a2ae77a1 hack/benchmark: add script for benchmark
This is for etcd benchmark.
2015-08-19 20:37:27 -07:00
b0303e948c Merge pull request #3323 from xiang90/cl_health
etcdctl: use health endpoint to greatly simplify health checking
2015-08-19 17:15:52 -07:00
568d1c6783 etcdctl: use health endpoint to greatly simplify health checking 2015-08-19 11:47:08 -07:00
60387dc408 Merge pull request #3320 from yichengq/doc-rtt
docs: document how to set heartbeat interval and election timeout
2015-08-19 11:08:05 -07:00
28b61acd9e Merge pull request #3324 from xiang90/raft_logging
raft: downgrade the logging around snapshot to debugf
2015-08-18 17:18:08 -07:00
d01b6cd639 Merge pull request #3326 from elimisteve/master
client: fixed typo in WatcherOptions docs
2015-08-18 16:49:43 -07:00
952827157a client: fixed typo in WatcherOptions docs
specifices -> specifies
2015-08-18 16:43:09 -07:00
b3d2a621ab Merge pull request #3325 from elimisteve/master
client: spelling error in docs (occured -> occurred)
2015-08-18 16:35:13 -07:00
69fc796926 client: spelling error in docs (occured -> occurred) 2015-08-18 16:26:52 -07:00
50c1db3fbf raft: downgrade the logging around snapshot to debugf
Snapshot related logging is spamming when leader trying to
sync a failed peer.
2015-08-18 15:43:53 -07:00
7082d3a765 docs: document how to set heartbeat interval and election timeout
It gives more details about how to set heartbeat interval and election
timeout correctly based on RTT.
2015-08-18 13:54:44 -07:00
28cec1128d Merge pull request #3322 from philips/use-proxy-as-default-endpoint
Procfile: use proxy as default
2015-08-18 12:38:51 -07:00
087061e434 Merge pull request #3303 from yichengq/auth-path
use canonical path for auth
2015-08-18 12:06:48 -07:00
4778d780a8 pkg/pathutil: change copyright for path.go
The file only contains the function that is borrowed from std http lib,
so we use their copyright.
2015-08-18 11:48:22 -07:00
9106675fd4 Procfile: use proxy as default
I think it makes sense to make the proxy listen on the default port so
we can give the proxy more testing by default. Also, this should make it
easy to kill a single etcd member and test that etcdctl still works,
etc.

However, I have hit a bug: the proxy takes several seconds
2015-08-18 09:42:13 -07:00
fab3feab66 etcdctl/role: reject non-canonical permission path
Non-canonical permission path is useless because the path received
by auth is always canonical, which is due to our ServeMux always
redirects request to canonical path().

This helps users to detect path permission setting error early.

Ref: http://godoc.org/net/http#ServeMux
2015-08-18 08:59:53 -07:00
b5ec7f543a client: use canonical url path in request
The main change is that it keeps the trailing slash. This helps
auth feature to judge path permission accurately.
2015-08-18 08:59:48 -07:00
927d5f3d26 Merge pull request #3301 from yichengq/ca-file
etcdmain: update -ca-file description
2015-08-17 23:36:33 -07:00
c0747a7b8b etcdmain: update -ca-file description
so people could deprecate old flags and use new flags much easier.
2015-08-17 22:36:04 -07:00
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
dfc6b4436f Merge pull request #3315 from xiang90/key_err
etcdhttp:write etcderror for all errors in keyhandler
2015-08-17 16:54:12 -07:00
ffae601af5 etcdmain: calculate dial timeout for peer transport
This helps peer communication in globally-deployed cluster.
2015-08-17 16:52:53 -07:00
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
c7fbc01ef1 Merge pull request #3314 from sebschrader/proxy-loop
Warn about proxy loops with incorrect advertise-client-urls
2015-08-17 16:04:00 -07:00
d487cf6b63 etcdhttp:write etcderror for all errors in keyhandler 2015-08-17 15:51:29 -07:00
f70950ff93 docs: warn about proxy loops with incorrect advertise-client-urls 2015-08-18 00:42:48 +02:00
c530385d6d Merge pull request #3313 from yichengq/internal-timeout
etcdserver: use ReqTimeout only
2015-08-17 15:05:46 -07:00
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
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
87f061bab2 *: key handler should write auth error as etcd error 2015-08-17 14:45:45 -07:00
ba3a9b5f92 Merge pull request #3309 from xiang90/enforce
etcdserver: add version enforcement when setting cluster version
2015-08-17 12:41:04 -07:00
15e03d801f etcdserver: add version enforcement when setting cluster version 2015-08-17 11:12:39 -07:00
f615f9a999 Merge pull request #3305 from xiang90/c_v
*: only print out major.minor version for cluster version
2015-08-17 09:40:01 -07:00
7083828ae3 Godeps: import github.com/ugorji/go/codec 2015-08-16 18:13:44 -07:00
a364af72af client: use ugorij/go/codec to unmarshal key response
This change speeds up response unmarshal ~2x:

```
BenchmarkSmallResponseUnmarshal	   20000	     75243 ns/op
BenchmarkManySmallResponseUnmarshal	     200	   6629661 ns/op
BenchmarkMediumResponseUnmarshal	    1000	   1359041 ns/op
BenchmarkLargeResponseUnmarshal	      20	  61600978 ns/op
```
2015-08-16 18:08:54 -07:00
95d100e957 client: add response unmarshal benchmark
The benchmark result:

```
BenchmarkSmallResponseUnmarshal	  10000	   164524 ns/op
BenchmarkManySmallResponseUnmarshal	    100	 13916636 ns/op
BenchmarkMediumResponseUnmarshal	   1000	  1974295 ns/op
BenchmarkLargeResponseUnmarshal	     20	 80462001 ns/op
ok		github.com/coreos/etcd/client	7.777s
```
2015-08-16 16:44:50 -07:00
d95c7d8a94 Merge pull request #3307 from ian-kelling/master
documentation: fix misspelled word
2015-08-15 18:53:58 -07:00
8dd44465c3 documentation: fix misspelled word 2015-08-15 17:56:17 -07:00
f199a484af *: only print out major.minor version for cluster version 2015-08-15 08:30:06 -07:00
bbcb38189c Merge pull request #3302 from xiang90/v
etcdserver: better version detection log output
2015-08-14 16:14:55 -07:00
0076ab154b etcdserver: better version detection log output
Fix https://github.com/coreos/etcd/issues/3288
2015-08-14 16:08:33 -07:00
dd56b7e05e Merge pull request #3299 from xiang90/txn
initial support for txn
2015-08-14 16:05:16 -07:00
5cd109949a etcdctl: support txn 2015-08-14 15:58:38 -07:00
9233fff48f etcdserver: support txn 2015-08-14 11:45:31 -07:00
46865fa5a5 etcdserverpb: update proto 2015-08-14 11:45:07 -07:00
d448593bbc Merge pull request #3295 from yichengq/err-example
client: fix clusterError typo in README
2015-08-14 09:35:31 -07:00
5eed141d54 client: fix clusterError typo in README
It helps users to use client better.
2015-08-13 16:38:41 -07:00
fefb273389 *: bump to v2.2.0-alpha.1+git 2015-08-13 16:01:31 -07:00
201bb4b3d8 *: bump to v2.2.0-alpha.1 2015-08-13 16:01:09 -07:00
3cc4957d98 Merge pull request #3293 from yichengq/improve-err
etcdserver: improve error message when timeout due to leader fail
2015-08-13 15:58:48 -07:00
c229e6e655 etcdserver: improve error message when timeout due to leader fail 2015-08-13 15:46:21 -07:00
394894e03e Merge pull request #3291 from yichengq/auth-cap
etcdhttp: add auth capability in 2.2
2015-08-13 15:01:59 -07:00
ceb27b1c48 etcdhttp: add auth capability in 2.2 2015-08-13 14:49:10 -07:00
a17288558e Merge pull request #3289 from yichengq/marshal
etcdserver: go back to marshal request in 2.1 way
2015-08-13 14:20:24 -07:00
334bdd1c26 Merge pull request #3153 from gtank/tls-setup
hack: TLS setup using cfssl
2015-08-13 13:53:14 -07:00
959feb70d1 Merge pull request #3275 from xiang90/sort
improve in order key generation
2015-08-13 13:51:19 -07:00
a7b9bff939 store: add 0 as padding for better lexicographic sorting. 2015-08-13 13:42:37 -07:00
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
003d096138 Merge pull request #3286 from yichengq/fit-2.2
*: update MinClusterVersion and supportedStream map
2015-08-13 13:31:37 -07:00
c9cca6a93b *: update MinClusterVersion and supportedStream map 2015-08-13 13:05:14 -07:00
846b1fdbcd Merge pull request #3287 from xiang90/update_roadmap
Update roadmap
2015-08-13 13:00:01 -07:00
329647ab62 roadmap: update roadmap 2015-08-13 12:56:23 -07:00
6a64051245 roadmap: remove 2.1 milestone 2015-08-13 12:51:58 -07:00
80005af5b2 Merge pull request #3285 from yichengq/bump-capnslog
godeps: bump capnslog to 42a8c3b1a6f917bb8346ef738f32712a7ca0ede7
2015-08-13 11:49:38 -07:00
d66ede7186 godeps: bump capnslog to 42a8c3b1a6f917bb8346ef738f32712a7ca0ede7 2015-08-13 11:32:45 -07:00
a46943548a *: bump to v2.2.0-alpha.0+git 2015-08-13 10:21:36 -07:00
ab5a69cb18 *: bump to v2.2.0-alpha.0 2015-08-13 10:20:05 -07:00
976ce93539 Merge pull request #3277 from yichengq/better-log
etcdserver: specify timeout caused by leader election
2015-08-12 17:02:27 -07:00
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
ddfe343e77 Merge pull request #3271 from yichengq/doc-discovery
docs: add discovery protocol doc
2015-08-12 13:51:32 -07:00
a45f0ede56 docs: add discovery protocol doc
This document talks about the technical details of discovery service
protocol. It helps users to learn about how discovery service works and
what behavior to expect.
2015-08-12 13:15:21 -07:00
7bd9d9aede Merge pull request #3273 from polvi/kube-hack
add etcd on k8s example
2015-08-12 22:13:15 +03:00
cfb3522b63 add etcd on k8s example 2015-08-12 22:12:00 +03:00
f468d8b51a Merge pull request #3270 from xiang90/better_err
Better error message for etcdctl
2015-08-12 10:27:42 -07:00
7e04a79fb4 etcdctl: print out better error information 2015-08-12 10:09:56 -07:00
5d06d4ec44 client: print url as string 2015-08-12 10:09:40 -07:00
e894756144 Merge pull request #3190 from yichengq/adjust-prop-timeout
etcdserver: adjust proposal timeout based on config
2015-08-12 09:41:25 -07:00
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
18ecc297bc Merge pull request #3254 from es-chow/log-group
set groupID in multinode as log context so it can be logged
2015-08-12 08:05:50 -07:00
cc362ccdad raft: set logger to raft so log context such as multinode groupID can be logged 2015-08-12 22:56:00 +08:00
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
042afcf2a3 Merge pull request #3266 from yichengq/client-readme
client: clean up README
2015-08-11 16:21:13 -07:00
7d618c46ad client: clean up README
Address rob's comments about sentences in README.
2015-08-11 15:33:56 -07:00
18a1c95f22 Merge pull request #3263 from xiang90/ctl_tr
etcdctl: add per request timeout
2015-08-11 14:17:12 -07:00
dceacacd49 Merge pull request #3194 from yichengq/client-readme
client: add README
2015-08-11 13:35:54 -07:00
e36c499d0f etcdctl: add per request timeout 2015-08-11 13:33:50 -07:00
8a7cf56e13 client: add README
It describes some basic usage and caveat of etcd/client package.

Write it together with Xiang.
2015-08-11 12:07:24 -07:00
83efc08137 Merge pull request #3262 from yichengq/client-deadline
client: return context.DeadlineExceeded instead of ClusterError
2015-08-11 10:42:29 -07:00
a1ef699aeb client: return context.DeadlineExceeded instead of ClusterError
This is done to match user expectation to see context.DeadlineExceeded
when it reaches deadline.
2015-08-11 10:18:38 -07:00
1fe52e1ec3 Merge pull request #3245 from yichengq/client_timeout
client: set timeout for each request
2015-08-11 10:10:42 -07:00
f4c29a5f55 client: support to set timeout for each request
Add HeaderTimeout field in Config, so users could set timeout for each request.
Before this, one hanged request may block the call for long time. After
this, if the network is good, the user could set short timeout and expect
that API call can attempt next available endpoint quickly.
2015-08-11 10:01:05 -07:00
a718329ad3 Merge pull request #3248 from xiang90/v3
initial v3 demo
2015-08-10 13:59:03 -07:00
fb5e1ac548 Merge pull request #3256 from xiang90/update_log
update logger
2015-08-10 13:54:28 -07:00
6c58333969 etcdmain: use default formatter
The default formatter would use syslog style when running
under init system, and would use pretty format otherwise.
2015-08-10 13:38:22 -07:00
48e36bbb84 Godep: update capnslog dependency 2015-08-10 13:38:00 -07:00
b0ea4ab3b1 doc: link to v3 api doc 2015-08-10 11:22:55 -07:00
c32919e6d1 *: rename v3etcdctl to etcdctlv3 2015-08-10 11:21:37 -07:00
c1e0b19f9f *: better flag 2015-08-10 09:53:17 -07:00
48b1cd54f3 Merge pull request #3243 from xiang90/conf
doc: add runtime reconfiguration design doc
2015-08-09 10:56:51 -07:00
89bf5824c2 Merge pull request #3159 from sofuture/master
use /usr/bin/env to find bash
2015-08-09 10:56:12 -07:00
601801ced5 doc: add runtime reconfiguration design doc 2015-08-09 10:55:34 -07:00
45f3a0c547 Merge pull request #3249 from philips/get-etcd-running-under-arm64
Get etcd running under arm64
2015-08-08 20:32:33 -07:00
1239e1ce6f test, scripts: use /usr/bin/env to find bash
use /usr/bin/env to find bash

add set -e back into scripts it was removed from
2015-08-08 20:52:53 -06:00
1b894c6b0b 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-08 18:11:41 -07:00
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
9ff7075ce8 etcdserver: use v3server interface 2015-08-08 10:39:04 -07:00
523567bcc7 v3etcdctl: initial v3 ctl support 2015-08-08 05:58:58 -07:00
f004b4dac7 *: etcdserver supports v3 demo 2015-08-08 05:58:29 -07:00
82afadbcc6 etcdserverpb: update proto 2015-08-08 05:31:35 -07:00
668a8a8367 Merge pull request #3242 from xiang90/typo
*: fix typos vaild->valid
2015-08-07 10:58:39 -07:00
845c51fedd *: fix typos vaild->valid 2015-08-07 10:57:11 -07:00
f0a5874473 Merge pull request #3241 from yichengq/sync-pin
client: Sync() pin the endpoint when member list doesn't change
2015-08-07 10:24:29 -07:00
0ab16db728 client: Sync() pin the endpoint when member list doesn't change
This helps client to pin the same endpoint as long as cluster doesn't change.
2015-08-07 10:08:28 -07:00
d7adcc3e65 Merge pull request #3239 from xiang90/improve_probing
rafthttp: use customized transport for probing
2015-08-07 09:37:32 -07:00
b6580a9591 rafthttp: use customized transport for probing
We need to support TLS verification when probing.
2015-08-06 16:20:44 -07:00
d2363afd52 Merge pull request #3240 from xiang90/fix_log
etcdmain: fix path printing
2015-08-06 15:56:14 -07:00
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
1b572ae2dd etcdmain: fix path printing 2015-08-06 15:53:24 -07:00
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
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
b9c6b64d61 Merge pull request #3216 from yichengq/cancel-err
client: return context canceled error correctly
2015-08-06 15:04:49 -07:00
b965c4b415 Merge pull request #3217 from yichengq/update-migrate-example
update commands used in admin_guide.md
2015-08-06 15:00:04 -07:00
78af793338 client: return context canceled error correctly
If the body is closed to stop watching, it will ignore the error from
reading body and return context error.

Before this PR, the cancel when watching always returns error `read tcp
127.0.0.1:57824: use of closed network connection`. After this PR, it
will return expected context canceled error.
2015-08-06 14:52:04 -07:00
b04bb3e0ea Merge pull request #3229 from xiang90/f_cerr
client: return context.Canceled error when user cancels the request
2015-08-06 14:41:19 -07:00
25ad71fbac Merge pull request #3225 from yichengq/client-record-err
client: return correct error for 50x response
2015-08-06 14:40:38 -07:00
7314310aed Merge pull request #3233 from xiang90/srv_discovery
better dns discovery error and doc
2015-08-06 14:35:22 -07:00
cfeaf3d172 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
```
2015-08-06 14:25:03 -07:00
e9f05e8959 doc: explain srv error 2015-08-06 14:24:58 -07:00
2c2249dadc Merge pull request #3219 from yichengq/limit-listener
etcdmain: stop accepting client conns when it reachs limit
2015-08-06 12:17:49 -07:00
97923ca3fc etcdmain: close client conns when it exceeds limit
This solves the problem that etcd may fatal because its critical path
cannot get file descriptor resource when the number of clients is too
big. The PR lets the client listener close client connections
immediately after they are accepted when
the file descriptor usage in the process reaches some pre-set limit, so
it ensures that the internal critical path could always get file
descriptor when it needs.

When there are tons to clients connecting to the server, the original
behavior is like this:

```
2015/08/4 16:42:08 etcdserver: cannot monitor file descriptor usage
(open /proc/self/fd: too many open files)
2015/08/4 16:42:33 etcdserver: failed to purge snap file open
default2.etcd/member/snap: too many open files
[halted]
```

Current behavior is like this:

```
2015/08/6 19:05:25 transport: accept error: closing connection,
exceed file descriptor usage limitation (fd limit=874)
2015/08/6 19:05:25 transport: accept error: closing connection,
exceed file descriptor usage limitation (fd limit=874)
2015/08/6 19:05:26 transport: accept error: closing connection,
exceed file descriptor usage limitation (fd limit=874)
2015/08/6 19:05:27 transport: accept error: closing connection,
exceed file descriptor usage limitation (fd limit=874)
2015/08/6 19:05:28 transport: accept error: closing connection,
exceed file descriptor usage limitation (fd limit=874)
2015/08/6 19:05:28 etcdserver: 80% of the file descriptor limit is
used [used = 873, limit = 1024]
```

It is available at linux system today because pkg/runtime only has linux
support.
2015-08-06 12:03:20 -07:00
203e0f178b etcdmian: better error for srv discovery failure 2015-08-06 11:38:53 -07:00
01c286ccb6 Merge pull request #3231 from xiang90/fallocate
pkg/fileutil: support perallocate
2015-08-06 10:25:28 -07:00
39a4b6a5e5 pkg/fileutil: support perallocate 2015-08-06 10:10:58 -07:00
9a8607fce1 Merge pull request #3187 from yichengq/client-keep-sync
client: add KeepSync function
2015-08-06 00:16:28 -07:00
c53b3016ae client: add AutoSync function
AutoSync provides the way for client to syncing member list from
etcd cluster automatically.
2015-08-05 13:22:56 -07:00
807a6f209e docs/admin_guide: decouple example from CoreOS specific details
This makes the example commands general, while keeping it easy to
understand. It also fixes some name mismatch.
2015-08-05 11:33:46 -07:00
f38187bbdb client: return context.Canceled error when user cancels the request 2015-08-05 09:52:30 -07:00
ff0b8723c7 Merge pull request #2688 from xiang90/versioning
etcdserver: internal request union
2015-08-05 09:27:32 -07:00
58503817ec etcdserver: internal request union 2015-08-05 07:47:10 -07:00
487639b2d8 Merge pull request #3222 from mitake/wal-log-error
wal: log errors in wal.Close()
2015-08-04 23:19:45 -07:00
9cbeffc720 Merge pull request #3224 from xiang90/fix_ls
etcdctl: ls takes / as default key arg
2015-08-04 23:15:29 -07:00
ba76e27875 wal: log errors in wal.Close()
This patch adds error logging in wal.Close() if unlocking and
destroying fail. Though it is hard to handling the errors, logging
would be helpful for trouble shooting.
2015-08-05 15:03:45 +09:00
9527a97720 etcdctl: ls takes / as default key arg 2015-08-04 22:56:55 -07:00
718a42f408 Merge pull request #3210 from xiang90/probing
monitoring connectivity between peers
2015-08-04 16:56:31 -07:00
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
0650170a1b Merge pull request #3196 from eyakubovich/fix-watch-timeout
client: handle watch timing out elegantly
2015-08-04 13:52:42 -07:00
1e048b5c24 rafthttp: cleanup prober when stopping the transport 2015-08-04 17:42:51 +08:00
709718ed97 godeps: update probing pkg 2015-08-04 17:40:39 +08:00
0fc764200d rafthttp: monitor connection 2015-08-04 17:39:40 +08:00
ff5c3469c1 Merge pull request #3197 from xiang90/health
etcdctl: cluster-health supports forever flag
2015-08-03 20:48:06 -07:00
6312e22b1d client: handle empty watch responses elegantly
Even though current etcd does not time out
watches, the client could be running against
an old etcd version or the server may close
polling connection for other reasons.
This patch ignores successful (as in 200)
responses with emtpy bodies instead
of producing JSON errors.
2015-08-03 11:47:21 -07:00
306085db5f Godeps: add probing dependency 2015-08-03 09:07:43 +08:00
f7f00b0af6 etcdctl: cluster-health supports forever flag
cluster-health command supports checking the cluster health
forever.
2015-08-01 22:29:08 +08:00
3da1df2648 Merge pull request #3207 from xiang90/rm_migration
*: remove migration related stuff from 2.2
2015-08-01 19:47:17 +08:00
2b8abeb093 *: remove migration related stuff from 2.2 2015-08-01 19:37:20 +08:00
eee1c8b8ee Merge pull request #3200 from xiang90/d_doc
doc: unique names must be specified when using public discovery service
2015-08-01 07:34:25 +08:00
8bd9554338 Merge pull request #3202 from yichengq/fix-etcdctl-watch
etcdctl: fix watch -after-index parsing
2015-07-31 14:41:45 -07:00
4a89b3f8f3 Merge pull request #3116 from offscale/master
build: implemented build shell-script for Windows
2015-07-31 11:55:42 -07:00
05b2d06788 Merge pull request #3199 from xiang90/sdnotify
etcdmain: support sdnotify for readiness
2015-07-31 19:04:35 +08:00
4a0d8ee4bd build: implemented build shell-script for Windows 2015-07-31 17:43:47 +10:00
0cbac56fa2 etcdmain: support sdnotify for readiness 2015-07-31 13:33:18 +08:00
beeecc32b0 doc: unique names must be specified when using public discovery service 2015-07-31 09:12:44 +08:00
c1c5c7c99c Merge pull request #3091 from barakmich/client_auth_cov
etcdhttp: Improve test coverage surrounding auth
2015-07-30 17:00:49 -04:00
dd1a8fe330 etcdhttp: Improve test coverage surrounding auth 2015-07-30 14:21:08 -04:00
147885078c etcdctl: fix watch -after-index parsing
It uses -after-index incorrectly now:

```
$ ./bin/etcdctl --debug watch -after-index 31 foo
Cluster-Endpoints: http://localhost:2379, http://localhost:4001
cURL Command: curl -X GET
http://localhost:2379/v2/keys/foo?recursive=false&wait=true&waitIndex=33
```

After this PR:

```
$ ./bin/etcdctl --debug watch -after-index 31 foo
Cluster-Endpoints: http://localhost:2379, http://localhost:4001
cURL Command: curl -X GET
http://localhost:2379/v2/keys/foo?recursive=false&wait=true&waitIndex=32
```
2015-07-30 11:15:43 -07:00
219ed1695b Merge pull request #3178 from yichengq/refactor-cluster-health
etcdctl: refactor the way to check cluster health
2015-07-29 18:16:26 -07:00
80b794dccc Merge pull request #3185 from xiang90/add_debug_endpoint
etcdhttp: add config/local/debug endpoint
2015-07-30 08:46:07 +08:00
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
e62a3b8a62 Merge pull request #2891 from glensc/patch-1
build: use posix shell
2015-07-29 17:15:57 -07:00
ff945c7404 Merge pull request #3181 from xiang90/2.2-client-error
client: return cluster error if the etcd cluster is not avaliable
2015-07-30 08:08:09 +08:00
f1aaa7a9e3 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-07-29 17:06:55 -07:00
a47e661fff discovery: print out detailed cluster error 2015-07-29 23:06:57 +08:00
5fa8652241 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.
2015-07-29 22:55:15 +08:00
6b8b507312 Merge pull request #3176 from yichengq/reject-high-election
etcdmain: reject unreasonably high values of -election-timeout
2015-07-28 10:33:58 -07:00
ec214030d0 etcdmain: reject unreasonably high values of -election-timeout
This helps users to detect setting problem early.
2015-07-28 10:07:57 -07:00
edfec45bf5 hack: TLS setup using cfssl
this demonstrates basic TLS setup with cfssl. it's much easier than other
available tools.
2015-07-27 14:51:17 -07:00
7831a30e46 Merge pull request #3180 from shafreeck/master
Update libraries-and-tools.md
2015-07-27 14:45:31 -07:00
6184e271a4 Merge pull request #3164 from yichengq/pin-endpoint
client: pin itself to an endpoint that given
2015-07-27 14:35:51 -07:00
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
ea2347a40f client: pin itself to an endpoint that given
1. When reset endpoints, client will choose a random endpoint to pin.
2. If the pinned endpoint is healthy, client will keep using it.
3. If the pinned endpoint becomes unhealthy, client will attempt other
endpoints and update its pin.
2015-07-27 13:36:53 -07:00
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
5e3dc31e6f Merge pull request #3150 from gouyang/master
pkg/mflag: add modified flag package
2015-07-24 15:26:07 -07:00
a7eef376b7 Merge pull request #3183 from xiang90/txn
*: tnx -> txn
2015-07-25 01:48:06 +08:00
53a77fa519 *: tnx -> txn 2015-07-24 23:21:09 +08:00
c9769ee966 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-07-24 21:29:21 +08:00
e75446ca27 docs: add cetcd into libraries-and-tools.md 2015-07-24 12:08:39 +00:00
b407f72766 Merge pull request #3166 from yichengq/publish-timeout
etcdserver: rename defaultPublishRetryInterval -> defaultPublishTimeout
2015-07-23 10:30:41 -07:00
b7892b20c1 etcdserver: rename defaultPublishRetryInterval -> defaultPublishTimeout
This makes code more readable and reasonable.
2015-07-23 10:09:28 -07:00
58bc617dd0 Merge pull request #3175 from xiang90/2.2-ctl-bug
etcdctl: fix exec watch command
2015-07-23 14:37:38 +08:00
448ca20cdc etcdctl: fix exec watch command
The previous flag parsing has a small issue. It uses
`recursive == true` and `after-index == 0` to determine
if user specifies the sub flags. This is incorrect since
user can specify `after-index = 0`. Then the flag parsing
would be confused.

This commit explicitly find the `--` in the remaining args
and determine the key and cmdArgs accordingly.
2015-07-23 13:13:15 +08:00
43f4b99d52 Merge pull request #3174 from xiang90/2.2_submit_bug
doc: add reporting bug doc
2015-07-23 13:08:35 +08:00
1b5e41e3f4 doc: add reporting bug doc 2015-07-23 12:55:38 +08:00
93002caca5 Merge pull request #3165 from yichengq/client-quorum
client: add Quorum option in getOption
2015-07-22 16:54:14 -07:00
b20b87893f client: add Quorum option in getOption 2015-07-22 15:19:34 -07:00
6be02ff5ec etcdmian: fix initialization confilct
Fix #3142

Ignore flags if etcd is already initialized.
2015-07-21 12:53:21 -07:00
24db661401 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-07-21 12:53:21 -07:00
604709cad7 etcdctl: update -peers to default to use schema
Change its default value from `127.0.0.1:4001,127.0.0.1:2379` to
`http://127.0.0.1:4001,http://127.0.0.1:2379`

Adding HTTP schema makes its format consistent with etcd's xxx-urls
flags.
2015-07-21 12:53:21 -07:00
d9c27138fa discovery: return bad discovery endpoint error 2015-07-21 12:53:21 -07:00
d2dac0fe59 client: consume json error and return ErrInvaildJSON
The default JSON error is not very readable. We let client
consume the error and return a more understandable error in
the context of etcd.

Fix #3120
2015-07-21 12:53:21 -07:00
6317abf7e4 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-07-21 12:53:21 -07:00
43437e21f9 etcdctl: added domain discovery flag
provided a domain, will look up SRV records for etcd endpoints

Fixes #2636
2015-07-21 12:53:21 -07:00
dc3f7f5d90 *: detect duplicate name for discovery bootstrap 2015-07-21 12:53:20 -07:00
b8279b3591 types: add len func for urlmaps 2015-07-21 12:53:20 -07:00
ee82ee05b4 etcdctl: support member update command 2015-07-21 12:53:20 -07:00
6e3769d39e client: add member update 2015-07-21 12:53:20 -07:00
9f9661f513 etcdctl: print out key and action when watching recursively 2015-07-21 12:53:20 -07:00
87ef0f0b3e godep: remove go-etcd dependency 2015-07-21 12:53:20 -07:00
071ad9f72b etcdctl: health use etcd/client 2015-07-21 12:53:20 -07:00
0b1ddce889 etcdctl: import snap use etcd/client 2015-07-21 12:53:20 -07:00
adeb101e04 etcdctl: remove old stuff 2015-07-21 12:53:20 -07:00
759c156e3e etcdctl: exec_watch use etcd/client 2015-07-21 12:53:20 -07:00
5b01b3877f etcdctl: watch use etcd/client 2015-07-21 12:53:20 -07:00
b20c06348d etcdctl: ls use etcd/client 2015-07-21 12:53:19 -07:00
ae1669de26 etcdctl: updatedir use etcd/client 2015-07-21 12:53:19 -07:00
f12ae45c6a etcdctl: update use etcd/client 2015-07-21 12:53:19 -07:00
58b19a7c1e etcdctl: rmdir use etcd/client 2015-07-21 12:53:19 -07:00
9d7a8dd2b0 etcdctl: mk use etcd/client 2015-07-21 12:53:19 -07:00
61befc7ce6 etcdctl: minor cleanup 2015-07-21 12:53:19 -07:00
e3fcc450cf etcdctl: make rm use etcd/client 2015-07-21 12:53:19 -07:00
9d9c3a7180 etcdctl: make setdir/mkdir use etcd/client 2015-07-21 12:53:19 -07:00
db4b18aee3 etcdctl: make set command use etcd/client 2015-07-21 12:53:19 -07:00
e9478ba630 etcdctl: make get command use etcd/client 2015-07-21 12:53:19 -07:00
147b14cfc0 *: bump to v2.1.1+git 2015-07-21 10:43:49 -07:00
6335fdc595 *: bump to v2.1.1 2015-07-21 10:41:26 -07:00
ca540b23dc Merge pull request #3158 from yichengq/exp-auth
docs: add experimental notice on auth doc
2015-07-21 10:24:11 -07:00
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
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
d373645b8c docs: glibc NSS module for resolving names in etcd 2015-07-21 10:33:23 +10:00
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
d52cb2e5d9 docs: add watch command and correct the example 2015-07-20 14:49:01 -07:00
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
7d38115cb2 Merge pull request #3148 from yichengq/update-contact
Update contact section in README.md
2015-07-16 15:01:54 -07:00
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
9b962c8350 README: let roadmap point to ROADMAP.md 2015-07-16 12:58:13 -07:00
c1aed32920 README: update irc channel to #etcd 2015-07-16 12:52:26 -07:00
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
452a327334 documentation: Add authentication walkthrough with etcdctl. Fixes #2949 2015-07-15 15:54:26 -04:00
ebbb0caff0 Merge pull request #3136 from yichengq/fix-proxy-doc
docs: fix wrong proxy command
2015-07-15 11:30:07 -07:00
d0e976ad4b docs: fix wrong proxy command 2015-07-15 08:37:10 -07:00
d0e3e2c992 Merge pull request #3131 from yichengq/remove-header-timeout
discovery: remove ResponseHeaderTimeout when discovery
2015-07-15 07:50:36 +08:00
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
f52db1c08e docs: add back original example w/index=prevIndex 2015-07-13 23:04:39 -07:00
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
953a59d554 Merge pull request #3127 from yanana/emend-error-message
etcdmain: emend configuration error message
2015-07-14 13:46:08 +08:00
d7276d6ace etcdmain: emend configuration error message
etcd shows an odd message on configuration error like this (partially):
```
... discovery or bootstrap flags are setChoose one of ...
                                      ^^^^^^^^^
```
This commit fixes the message format problem.
2015-07-14 14:42:49 +09:00
d80f4c8aa2 Merge pull request #3125 from yichengq/doc-tuning
docs: update tuning.md to match today's situation
2015-07-13 16:52:11 -07:00
8b7c600009 docs: update tuning.md to match today's situation
1. etcd requires that election-timeout >= 5 * heartbeat-interval
2. etcd doesn't have flag -snapshot
2015-07-13 16:35:30 -07:00
7a520bb80b Merge pull request #3121 from yichengq/extend-schedule
pkg/testutil: extend wait schedule time to 10ms
2015-07-13 15:23:36 -07:00
1624235bb3 pkg/testutil: extend wait schedule time to 10ms
Waiting 3ms is not long enough for schedule to work well. The test suite
may fail once per 200 times in travis due to this. Extend this to 10ms
to ensure schedule could work. Now it could run 1000 times successfully
in travis.
2015-07-13 09:05:40 -07:00
5be545b872 Merge pull request #3077 from yichengq/fix-test-sync
etcdserver: init raft internal var early
2015-07-10 14:44:52 -07:00
c7a949349e Merge pull request #3113 from xiang90/fix_proxy_bt
etcdmain: proxy ignores discovery if it is initialized
2015-07-10 14:12:45 -06:00
dedabddcb3 etcdmain: proxy ignores discovery if it is initialized 2015-07-10 12:52:24 -07:00
61e9b99edb Merge pull request #2417 from kelseyhightower/improve-etcdctl-ls-command-help
etcdctl: update the ls subcommand help to match behavior
2015-07-09 11:33:19 -06:00
4631b727c0 Merge pull request #3105 from xiang90/rd
doc: add rolling upgrade doc for 2.1
2015-07-09 11:27:05 -06:00
11452585bb doc: add rolling upgrade doc for 2.1 2015-07-07 13:20:41 -07:00
8ab388fa56 Merge pull request #3001 from mwitkow-io/feature/rich_metrics
Etcd Rich Metrics
2015-07-07 08:12:06 -07:00
7bca757d09 *: add metrics to store and proxy. 2015-07-07 16:01:51 +01:00
573f62f7a5 Merge pull request #3101 from yichengq/check-err
integration: always check error for function calls
2015-07-06 18:10:31 -07:00
e7ed7a7b7a integration: always check error for function calls 2015-07-06 17:44:36 -07:00
121ff4684c Merge pull request #3097 from philips/tls-churn-faq
Documentation/security: add FAQ about peer TLS and etcd 2.0.x
2015-07-04 15:30:42 -07:00
83fe8187f4 Documentation/security: add FAQ about peer TLS and etcd 2.0.x
etcd 2.0.x TLS can appear not to work on smaller machines with less
horse-power or lots of other work going on. Document the timeout
workaround.
2015-07-04 15:28:47 -07:00
09b9c30beb pkg/transport: include debug output for trusted-ca
since --peer-ca-file is deprecated we need to update the debug output

before:

```
$ etcd ... --peer-cert-file infra1.crt -peer-key-file
 infra1.key.insecure -peer-trusted-ca-file ca.crt --client-cert-auth
etcdmain: peerTLS: cert = infra1.crt, key = infra1.key.insecure, ca =
```

after:

```
$ etcd ... --peer-cert-file infra1.crt -peer-key-file
 infra1.key.insecure -peer-trusted-ca-file ca.crt --client-cert-auth
etcdmain: peerTLS: cert = infra1.crt, key = infra1.key.insecure, ca = , trusted-ca = ca.crt
```
2015-07-04 14:28:18 -07:00
cbe00e4415 Merge pull request #2967 from webner/feature/proxy-config
proxy: added endpoint refresh and timeout configuration values
2015-07-03 11:51:15 -07:00
954e416bf6 proxy: fixed director.go formatting 2015-07-03 14:11:40 +02:00
883bb47dcf Merge pull request #3074 from xiang90/storage_restore
storage: correctly restore create and ver
2015-06-30 09:20:19 -07:00
eff67afc60 Merge pull request #3081 from xiang90/storage_fix
storage: fix small issues
2015-06-29 22:05:46 -07:00
585e74a1b1 Merge pull request #3080 from xiang90/rpc
add gRPC etcd service
2015-06-29 22:04:47 -07:00
f8b947a00b storage: fix small issues 2015-06-29 22:02:21 -07:00
2fb8347d36 etcdserver: add rpc proto 2015-06-29 20:00:09 -07:00
436bacd77a *: introduce grpc dependency 2015-06-29 18:59:00 -07:00
718cb18ca2 Merge pull request #3079 from xiang90/gogo
*: resolve proto warnings
2015-06-29 18:50:49 -07:00
581ef05bab *: resolve proto warnings 2015-06-29 18:39:46 -07:00
621b43bacb Merge pull request #3078 from xiang90/gogo
update gogoprotobuf dependency
2015-06-29 16:59:08 -07:00
13f44e4b79 *: update generated proto code 2015-06-29 16:45:25 -07:00
59b479e59b godep: update gogo version 2015-06-29 16:08:04 -07:00
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
235aef5365 *: bump to v2.1.0-rc.0+git 2015-06-29 14:02:40 -07:00
00c32ef022 *: bump to v2.1.0-rc.0 2015-06-29 14:02:39 -07:00
9884c9d977 Merge pull request #3075 from yichengq/fix-windows
Godeps/capnslog: bump to 99f6e6b8f8ea30b0f82769c1411691c44a66d015
2015-06-29 14:02:16 -07:00
207b67c72a Godeps/capnslog: bump to 99f6e6b8f8ea30b0f82769c1411691c44a66d015
It fixes windows building problem.
2015-06-29 13:47:21 -07:00
433f2ee1bc storage: correctly restore create and ver
Add a restore func to correctly restore create reversion and
version of keys for the index.
2015-06-29 13:44:43 -07:00
8d3e3ff25a Merge pull request #3073 from xiang90/storage_ver
storage: save version
2015-06-29 13:19:02 -07:00
ccca2b04da storage: save version 2015-06-29 13:15:09 -07:00
bd84e678e6 Merge pull request #3061 from yichengq/fix-stream-test
rafthttp: fix TestStream uses outdated stream
2015-06-29 11:15:29 -07:00
f421eaeff7 Merge pull request #3071 from yichengq/rename-rafthttp-metrics
rafthttp: message_sent_latency metrics: channel -> sendingType
2015-06-29 10:58:36 -07:00
e01d53b853 Merge pull request #2979 from xiang90/fix_sendapp
raft: fix panic in send app
2015-06-29 10:49:04 -07:00
28342ae097 rafthttp: avoid TestStream to use outdated stream
The original test code before fb4b0b5cf0
doesn't work because reader side may update the
stream, while writer side writes message to the old stream and fails.

This PR removes unnecessary call to set term, and avoids this problem to
happen on term > 1 in the future.
2015-06-29 10:46:54 -07:00
2afa6688ab Merge pull request #3069 from yichengq/init-term
rafthttp: support to init term when adding peer
2015-06-29 10:45:53 -07:00
606876154d rafthttp: message_sent_latency metrics: channel -> sendingType
Better naming.
2015-06-29 10:44:40 -07:00
4430a80c0f Merge pull request #3063 from yichengq/fix-create-root
etcdserver/auth: fix return value when creating root user
2015-06-29 10:29:23 -07:00
bb287fa22e Merge pull request #3051 from yichengq/doc-rafthttp-metrics
docs: doc metrics used in rafthttp package
2015-06-29 10:22:50 -07:00
fb4b0b5cf0 rafthttp: support to init term when adding peer
So it doesn't need to build term-0 stream with the remote first, then update it.
2015-06-29 10:20:48 -07:00
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
c069119abe Merge pull request #3067 from xiang90/storage_created_mod
storage: save created index and modified index
2015-06-27 23:11:05 -07:00
fcdd9779e9 docs: explain label in rafthttp metrics 2015-06-26 15:51:39 -07:00
4581064060 storage: save created index and modified index 2015-06-26 12:10:26 -07:00
3e455ed104 Merge pull request #3062 from yichengq/fix-auth-doc
docs: fix typos in auth_api.md
2015-06-25 17:54:05 -07:00
9c695dce25 docs: fix typos in auth_api.md 2015-06-25 17:37:16 -07:00
acca9cc3a9 Merge pull request #3047 from barakmich/auth_cov
auth: improve test coverage
2015-06-25 14:47:22 -04:00
39c10d1fe4 auth: improve test coverage 2015-06-25 14:25:08 -04:00
3d4642c2c4 Merge pull request #3059 from yichengq/fix-wait-stress-test
pkg/wait: extend timeout to check closed channel
2015-06-25 11:16:54 -07:00
35d0839909 Merge pull request #3057 from yichengq/fix-snap-test
etcdserver: fix TestTriggerSnap
2015-06-25 10:51:36 -07:00
a347e1ecf5 Merge pull request #3058 from yichengq/fix-purge
pkg/fileutil: fix TestPurgeFile
2015-06-25 10:50:36 -07:00
eea7f28be4 pkg/wait: extend timeout to check closed channel
It is possible to trigger the time.After case if the timer went off
between time.After setting the timer for its channel and the time that
select looked at the channel. So it needs to be longer.

refer: https://groups.google.com/forum/#!topic/golang-nuts/1tjcV80ccq8
2015-06-25 10:43:12 -07:00
4c8408f92f docs: doc metrics used in rafthttp package 2015-06-25 10:38:36 -07:00
107263ef9f pkg/fileutil: fix TestPurgeFile
It needs to wait longer for file to be detected and removed sometimes.
2015-06-25 10:09:20 -07:00
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
2ace10626d Merge pull request #3050 from yichengq/doc-bench-tool
docs/benchmarks: doc benchmark tool
2015-06-25 08:15:02 -07:00
ca2ea1bc7d Merge pull request #3048 from ecnahc515/documentation_improvements
Documentation: Refer back between name and initial-cluster options
2015-06-24 15:22:46 -07:00
0949cc06e6 docs/benchmarks: doc benchmark tool 2015-06-24 15:11:08 -07:00
ea2c203aee Documentation: Refer back between name and initial-cluster options 2015-06-24 14:10:42 -07:00
44fda7985a Merge pull request #3046 from xiang90/metrics
refactor metrics
2015-06-24 13:58:28 -07:00
9aeb181d75 snap: add namespace and subsystem fields for metrics 2015-06-24 13:46:43 -07:00
c221844d6b Merge pull request #3024 from xiang90/fix_discovery
discovery: add timeouts for discovery client
2015-06-24 13:44:21 -07:00
52c2a5731f etcdserver: fix typo in metrics.go 2015-06-24 12:42:40 -07:00
b3cb5f9e4e Merge pull request #3043 from xiang90/update_auth_doc
auth: update the auth doc
2015-06-23 23:19:02 -07:00
96c0c7a202 Merge pull request #3044 from xiang90/fix_auth_update_role
auth: do not allow update root role
2015-06-23 22:43:28 -07:00
030d1bbf2d auth: do not allow update root role 2015-06-23 20:15:08 -07:00
403fad14ae auth: update the auth doc 2015-06-23 20:02:48 -07:00
c0b5cc6c52 Merge pull request #3041 from xiang90/auth_u
etcdhttp: improve user endpoint validation
2015-06-23 15:58:03 -07:00
94f8152487 Merge pull request #3042 from yichengq/fix-addr-in-use
integration: fix bind-addr-in-use
2015-06-23 15:57:50 -07:00
88b69a5979 Merge pull request #3030 from yichengq/fix-fallback-case
etcdmain: fix the check in fallback-to-proxy case
2015-06-23 14:48:45 -07:00
8e79fd85cb integration: fix bind-addr-in-use
The bug happens when restarted member wants to listen on its original
port, but finds out that it has been occupied by some client.

Use well-known port instead of ephemeral port, so client cannot occupy
the listen port anymore.
2015-06-23 14:47:21 -07:00
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
2d426b518a Merge pull request #3035 from yichengq/update-term
rafthttp: update term when AddPeer
2015-06-23 14:05:37 -07:00
37933cffa4 Merge pull request #3040 from xiang90/fix_auth
Fix auth
2015-06-23 13:47:25 -07:00
cf050ee21d Merge pull request #2943 from yichengq/fix-client-test
client: fix TestSimpleHTTPClientDoCancelContextResponseBodyClosed
2015-06-23 13:43:07 -07:00
e25e368321 rafthttp: update term when AddPeer
Update term when AddPeer, or the term in peer will not be updated until
the term is changed. This fixes the log flood happended when the v2.1
follower applies the snapshot from v2.0 leader:

```
rafthttp: cannot attach out of data stream server [0 / 17]
```
or
```
rafthttp: server streaming to 6e3bd23ae5f1eae0 at term 0 has been
stopped
```
2015-06-23 13:42:21 -07:00
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
36c5fd6265 etcdmain: fix the check in fallback-to-proxy case
advertise-client-urls has to be set if listen-client-urls is set when
fallbacking to proxy, which breaks the behavior. Loosen the check to fix
it.
2015-06-23 13:08:56 -07:00
bc61056912 etcdhttp: use correct http status const when writing http error 2015-06-23 12:40:30 -07:00
4f47a6ebfb Merge pull request #3032 from xiang90/refactor_update_role
auth: refactor updateRole
2015-06-23 11:17:45 -07:00
240e121792 Merge pull request #3039 from xiang90/update_auth
doc: update auth_api.md
2015-06-23 11:12:47 -07:00
aaf802f321 doc: update auth_api.md 2015-06-23 11:08:04 -07:00
ad7124599d Merge pull request #3033 from barakmich/strip_pass
etcdhttp: Always strip password hash when returning users
2015-06-22 18:39:50 -07:00
7f7e2cc79d Merge pull request #3034 from philips/replace-maximal-with-maximum
*: docs and code %s%maximal%maximum%g
2015-06-22 16:24:01 -07:00
740187f199 *: docs and code %s%maximal%maximum%g
maximum is a more common word, use it instead
2015-06-22 16:06:57 -07:00
028a1d6dd4 Merge pull request #2994 from webner/feature/cancel-proxy-request
proxy: handle canceled proxy request gracefully
2015-06-22 16:06:05 -07:00
d5a0e3ac6a etcdhttp: Always strip password hash when returning users 2015-06-22 18:39:16 -04:00
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
462baedcd4 Merge pull request #3031 from xiang90/fix_auth
auth: do not allow to grant duplicate role or revoke ungranted role
2015-06-22 15:13:26 -07:00
3f82e7b116 auth: do not allow to grant duplicate role or revoke ungranted role to a user 2015-06-22 15:11:09 -07:00
51a65599dd Merge pull request #3021 from xiang90/auth_err
etcdserver: use correct http status code for auth error
2015-06-22 14:58:33 -04:00
c39aad0e92 etcdserver: use correct http status code for auth error 2015-06-22 09:28:47 -07:00
3e4479b0cd Merge pull request #3022 from xiang90/aut_type
etcdhttp: fix the response type for auth
2015-06-21 15:06:35 -07:00
ebd4102578 Merge pull request #3026 from xiang90/better_logging
etcdserver: better log message for url mismatch
2015-06-19 19:39:33 -07:00
d295d21349 etcdserver: better log message for url mismatch 2015-06-19 19:36:26 -07:00
1381b44adf discovery: add timeouts for discovery client 2015-06-19 16:50:44 -07:00
cad757efa0 etcdhttp: fix the response type for auth 2015-06-19 15:19:00 -07:00
b26b827780 Merge pull request #3020 from xiang90/auth_doc
auth: minor fix for user section
2015-06-19 15:08:51 -07:00
b1dbab2b6b auth: minor fix for user section 2015-06-19 14:30:04 -07:00
9f984ea6ae Merge pull request #3015 from xiang90/auth_doc
doc: move enable section to the top in auth_api.md
2015-06-19 14:13:19 -07:00
4f0f57b322 doc: move enable section to the top in auth_api.md 2015-06-19 14:08:29 -07:00
7ee4fb6181 Merge pull request #3011 from philips/fixup-discovery-info-output
discovery: fixup logline
2015-06-19 13:25:08 -04:00
e71dc2e565 discovery: fixup logline
before:

```
discovery: duringcluster status checkconnection tohttps://discovery.etcd.iotimed out, retrying in2s
```

after:

```
discovery: cluster status check: connection to https://discovery.etcd.io timed out, retrying in 2s
```
2015-06-19 13:19:09 -04:00
a6e6186477 proxy: always set requestClosed flag when client closes the connection prematurely 2015-06-19 08:45:45 +02:00
5787fabe5f Merge pull request #3008 from yichengq/storage-index-test
storage: add range and tombstone test for index
2015-06-18 19:29:31 -07:00
b20598eea0 storage: add range and tombstone test for index 2015-06-18 18:05:37 -07:00
1a7a5fd45d Merge pull request #3006 from yichengq/storage-kvstore-test
storage: remove unnecessary ForceCommit in kvstore.Close
2015-06-18 13:57:27 -07:00
9f2e4c8a57 storage: remove unnecessary ForceCommit in kvstore.Close
s.b.Close will commit pending ops, so there is no need to FroceCommit
it in kvstore.Close()
2015-06-18 13:36:23 -07:00
789e2f3426 Merge pull request #3003 from yichengq/storage-kvstore-test
storage: add restore test and fix some bug
2015-06-18 12:19:05 -07:00
7cba42fb73 storage: wait for compact goroutine to exit before close backend
If backend is closed, the operations on backend in compact
goroutine will panic. So this PR waits for compact goroutine to exit
before close backend.

This fixes the TestWorkflow failure too.
2015-06-18 12:18:39 -07:00
5e31854afd proxy: use atomic operations for requestCanceled flag 2015-06-18 20:56:28 +02:00
864ce5f946 proxy: handle canceled proxy request gracefully
when a client of the proxy server cancels a request the proxy should not
set the endpoint state to unavailable
2015-06-18 20:52:52 +02:00
148394f66f storage: fix schedule compaction bug in recover process
It uses wrong schedule compaction reversion before.
2015-06-18 11:11:37 -07:00
26a09d8479 storage: enhance TestRestore and kill TODO 2015-06-18 10:37:12 -07:00
0ef53ee500 Merge pull request #2999 from yichengq/storage-rev-test
storage: add reversion test
2015-06-18 07:39:18 -07:00
74fbf9d6a7 storage: add reversion test 2015-06-17 18:06:42 -07:00
06ca914429 Merge pull request #2998 from yichengq/storage-kvstore-test
storage: add kv range test
2015-06-17 17:49:55 -07:00
80a59f00b7 storage: fix limit mismatch in Range func 2015-06-17 17:43:08 -07:00
93f477944b storage: return ErrFutureRev if rev is a future one 2015-06-17 17:42:43 -07:00
94924d04db storage: add TestRangeBadRev 2015-06-17 16:22:28 -07:00
9ad5e1e64f storage: kill TODO in TestRange 2015-06-17 15:58:28 -07:00
05228729a3 Merge pull request #2996 from yichengq/storage-workflow-test
storage: add TestWorkflow
2015-06-17 15:05:12 -07:00
500894dfe5 storage: add TestWorkflow 2015-06-17 14:38:21 -07:00
7b1a93e1ef storage: put storage info keys into information bucket
They used to be in key bucket, and make recover failed because they
cannot be parsed as normal key.
2015-06-17 14:37:29 -07:00
d0f6432b51 *: bump to v2.1.0-alpha.1+git 2015-06-16 22:02:00 -07:00
c4a5088bbc *: bump to v2.1.0-alpha.1 2015-06-16 22:00:17 -07:00
2efbc76689 Merge pull request #2993 from xiang90/md
doc: add doc for metrics feature
2015-06-16 14:22:16 -07:00
c599e81d46 doc: add proposal into glossary.md 2015-06-16 14:19:18 -07:00
5c1d4544fc doc: add doc for metrics feature 2015-06-16 14:18:22 -07:00
cdcae2d6a5 Merge pull request #2991 from barakmich/security_rename
*: Rename `security` to `auth`
2015-06-16 14:41:34 -04:00
7716bdf981 client: fix TestSimpleHTTPClientDoCancelContextResponseBodyClosed
This fixes the bug that the test may hang forever because RoundTrip is
blocked. fixes #2449
2015-06-16 11:29:54 -07:00
aeeae25d87 proxy: documentation for disabling the proxy timeout 2015-06-16 12:18:16 +02:00
5854d0e8a9 proxy: removed unused refreshInterval variable in director structure 2015-06-16 12:17:08 +02:00
64ec8af91b *: Rename security to auth 2015-06-15 18:18:50 -04:00
b4022899eb raft: fix panic in send app
sendApp accesses the storage several times. Perviously, we
assume that the storage will not be modified during the read
opeartions. The assumption is not true since the storage can
be compacted between the read operations. If a compaction
causes a read entries error, we should not painc. Instead, we
can simply retry the sendApp logic until succeed.
2015-06-15 14:23:33 -07:00
e20b487904 Merge pull request #2978 from xiang90/fix_backup
*:fix point-in-time backup
2015-06-15 13:19:29 -07:00
f59da0e453 *:fix point-in-time backup
Backup process should be able to read all WALs until io.EOF to
generate a point-in-time backup.

Our WAL file is append-only. And the backup process will lock all
files before start reading, which can prevent the gc routine from
removing any files in the middle.
2015-06-15 11:12:28 -07:00
b69d52e5ac Merge pull request #2988 from xiang90/raft-doc
raft: fix usage section of doc
2015-06-15 10:39:40 -07:00
2f0169c3ab raft: fix usage section of doc
We recently added a config struct to start raft. Update
our doc accordingly.
2015-06-15 10:26:10 -07:00
5618adff99 Merge pull request #2977 from nikfoundas/patch-1
docs: add etcd-viewer into libraries-and-tools.md
2015-06-14 08:53:06 -07:00
3fc8d48421 Merge pull request #2982 from aybabtme/etcdserver/wrong-log-func
etcdserver: use Infof to print formatted argument
2015-06-14 06:53:20 -07:00
270487d340 etcdserver: use Infof to print formatted argument 2015-06-14 20:22:21 +07:00
dadbc03171 docs: add etcd-viewer into libraries-and-tools.md
I've been working on this project for a few weeks and I believe it has some features that could assist maintaining etcd registries. Please check it out and I hope you would like to include it in your list of etcd tools.
Kind regards,
Nikos
2015-06-14 02:25:42 +03:00
1264dbe24d proxy: added endpoint refresh and timeout configuration values
the default dial timeout was set to 30 seconds this made the proxy a pain to use
in failure scenarios.

fixes 2862
2015-06-13 09:42:18 +02:00
8e7fa9e201 Merge pull request #2976 from yichengq/fix-lock-test
pkg/fileutil: wait longer for relock
2015-06-12 15:20:18 -07:00
7723b91c06 pkg/fileutil: wait longer for relock
multiple cpu running makes it slower, so it waits longer for relock.
2015-06-12 15:17:28 -07:00
219d304291 Merge pull request #2968 from yichengq/fix-stream-reader-init
rafthttp: always init streamReader before return from newPeer
2015-06-12 14:51:05 -07:00
288cce0d76 Merge pull request #2975 from yichengq/fix-purge-test
pkg/fileutil: wait longer before checking purge results
2015-06-12 14:38:55 -07:00
7ff1fa36f2 rafthttp: always init streamReader before return from newPeer
Or etcd will panic if someone calls `setTerm()`, which uses streamReader
internally, before streamReader is inited.
2015-06-12 14:38:14 -07:00
75f91bab5c pkg/fileutil: wait longer before checking purge results
multiple cpu running may be slower than single cpu running, so it may
take longer time to remove files.
Increase from 5ms to 20ms to give it enough time.
2015-06-12 14:36:15 -07:00
684c721307 Merge pull request #2970 from yichengq/fix-stream-test
rafthttp: use buffered channel as recv/prop chan
2015-06-12 14:34:52 -07:00
dccec11bb4 Merge pull request #2973 from yichengq/fix-recv-log
rafthttp: fix the misformat logging line, and rename internal var for more clarity
2015-06-12 14:27:17 -07:00
36f75cf062 rafthttp: use buffered channel as recv/prop chan
So it ensures that the message will not be discarded because the receive
side has not been ready, which happens easily in multiple core test.

Use log.fatal instead of log.error. The test exits when there is
something wrong because the error may affect following test cases.
2015-06-12 14:25:11 -07:00
2f05b24d6d rafthttp: {from, to} -> {local, remote} in stream
{from, to} nameings are confused when it both dials and receives
messages from the remote. Change it to {local, remote} for better
clarity.
2015-06-12 14:17:30 -07:00
bcc1aadea9 rafthttp: fix the misformat logging line
before:
```
2015/06/12 20:06:19 rafthttp: dropped MsgApp from %!s(uint64=2) since
receiving buffer is full
```

after:
```
2015/06/12 13:51:38 rafthttp: dropped MsgProp from 2 since receiving
buffer is full
```
2015-06-12 14:12:49 -07:00
ae42371ee2 Merge pull request #2965 from yichengq/fix-issue2904
integration: fix TestIssue2904 in multiple cores
2015-06-12 13:53:00 -07:00
b98aa3a9e0 Merge pull request #2972 from yichengq/test-longer
test: extend integration timeout to 10m
2015-06-12 13:42:54 -07:00
768cb437bc test: extend integration timeout to 10m
We test with `-cpu 1,2,4` now, and it takes longer time.
2015-06-12 13:41:35 -07:00
796d99c390 integration: fix TestIssue2904 when multiple cores
Do not wait for the cluster view of removed member to match with
expected view, since removed member does not apply entries after it is
removed.
2015-06-12 10:20:27 -07:00
ea3c7d1d31 Merge pull request #2960 from yichengq/fix-drop-flood
rafthttp: pretty print message drop info
2015-06-12 09:23:23 -07:00
0de0e4b77c rafthttp: pretty print message drop info 2015-06-12 09:14:53 -07:00
e46fa0a213 Merge pull request #2957 from yichengq/fix-pipeline-test
rafthttp: fix TestStopBlockedPipeline
2015-06-12 08:03:12 -07:00
c21cc5b39b rafthttp: fix TestStopBlockedPipeline
Refactor the fake cancel implementation.

The old one may cancel other in-flight message in random, which leaves
the original target message blocked forever.
2015-06-12 07:55:12 -07:00
29dca49cb5 rafthttp: wait 1ms before enabling cancel
CancelRequest only effects on in-flight request, so we need to wait
for Do(request) called before enabling cancel.
2015-06-12 07:55:06 -07:00
d8e1950d4e Merge pull request #2963 from xiang90/fix_discovery_error
etcdmain: exit if discovery fails
2015-06-11 16:11:59 -07:00
6c8b32d316 etcdmain: exit if discovery fails
Fix #2919

If discovery fails, etcd will hang there and does nothing. This
commit fixes the problem.
2015-06-11 15:45:00 -07:00
3e706c745c Merge pull request #2953 from yichengq/etcdmain-plog
etcdmain: var log -> plog
2015-06-11 15:30:18 -07:00
1c19eb47b5 Merge pull request #2956 from xiang90/log
all pkgs use leveled log
2015-06-11 15:29:44 -07:00
2c5ab7ff8b discovery: fix infoln -> info 2015-06-11 14:22:14 -07:00
8ad7ed321e *:godep log pkg 2015-06-11 14:22:14 -07:00
2373fd8426 wal: fix the left logging using default log 2015-06-11 14:22:14 -07:00
2db8b53c4b discovery: use leveled log 2015-06-11 14:22:14 -07:00
f013a627a4 etcdserver/stats: use leveled log 2015-06-11 14:22:14 -07:00
cf7cb2b8a9 etcdserver/security: use leveled log 2015-06-11 14:22:14 -07:00
2f795e42d0 httptypes: use leveled log 2015-06-11 14:19:53 -07:00
4b5dbeff9b pkg/pbutil: use leveled log 2015-06-11 14:19:53 -07:00
865a5ffc61 pkg/osutil: use leveled log 2015-06-11 14:19:53 -07:00
a45f53986f pkg/netutil: use leveled log 2015-06-11 14:19:52 -07:00
69819d334a pkg/flags: use leveled log 2015-06-11 14:19:52 -07:00
7bf0479e66 Merge pull request #2882 from barakmich/security_client_new
*: Add security/authorization to etcd/client and etcdctl
2015-06-11 13:40:32 -04:00
1764837783 etcdmain: clean up plog.Printf
Put it into different log levels.
2015-06-11 10:24:02 -07:00
ecdf0a8146 Merge pull request #2959 from yichengq/fix-update-member
rafthttp: fix TestUpdateMember
2015-06-11 10:02:13 -07:00
1af2b4cad7 rafthttp: fix TestUpdateMember
Before this PR, it may error like this:

```
--- FAIL: TestUpdateMember-2 (0.00s)
		server_test.go:950: action =
		[{ApplyConfChange:ConfChangeUpdateNode []}
{ProposeConfChange:ConfChangeUpdateNode []}], want
[{ProposeConfChange:ConfChangeUpdateNode []}
{ApplyConfChange:ConfChangeUpdateNode []}]
```

This fixes the test by recording the proposal event in time.
2015-06-11 09:45:34 -07:00
cd629c9b44 Merge pull request #2939 from yichengq/fix-update-attr
etcdserver: allow to update attributes of removed member
2015-06-10 16:53:39 -07:00
8725e69cf7 etcdserver: allow to update attributes of removed member
There exist the possiblity to update attributes of removed member in
reasonable workflow:
1. start member A
2. leader receives the proposal to remove member A
2. member A sends the proposal of update its attribute to the leader
3. leader commits the two proposals
So etcdserver should allow to update attributes of removed member.
2015-06-10 16:52:18 -07:00
743ac73b11 Merge pull request #2954 from xiang90/fix_test
proxy: fix test
2015-06-10 16:44:58 -07:00
ed1c5a73d1 Merge pull request #2951 from yichengq/fix-proxy-acurls
etcdmain: fix that advertise-client-urls is required in proxy mode
2015-06-10 16:42:06 -07:00
612ecbc89d proxy: fix test 2015-06-10 16:31:42 -07:00
cf7c83b304 etcdmain: fix that advertise-client-urls is required in proxy mode
etcd proxy doesn't need to set advertise-client-urls because the flag is
not used.
2015-06-10 16:22:32 -07:00
5a9c2851a7 etcdmain: var log -> plog
So the variable name doesn't mess up with standard package name.
2015-06-10 16:19:06 -07:00
0a3a2720a1 Merge pull request #2923 from yichengq/rafthttp-status
rafthttp: pretty print connection error
2015-06-10 16:17:07 -07:00
f64a8214f7 Merge pull request #2952 from xiang90/fileutil
fileutil: use leveled logging
2015-06-10 16:01:24 -07:00
dc87454487 fileutil: return on error and send it to error chan 2015-06-10 15:59:24 -07:00
e2c2f098bc fileutil: use leveled logging 2015-06-10 15:57:59 -07:00
d92c89516b rafthttp: fix capnslog package name 2015-06-10 15:43:54 -07:00
1dbe72bb74 rafthttp: pretty print connection error
1. print out the status change of connection with peer
2. only print the first error for repeated ones
2015-06-10 15:43:49 -07:00
30db41e031 Procfile: use -listen-client-urls instead of -bind-addr
-bind-addr is etcd 0.4 flag, and we should deprecate it.

Moreover, this makes Procfile fit the workflow we mention in the doc,
which helps ourselves find the problem first.
2015-06-10 15:13:33 -07:00
37f9534109 Merge pull request #2950 from xiang90/test_cpu
test: run with cpu = 1,2,4
2015-06-10 15:09:45 -07:00
4e79abcfeb Merge pull request #2944 from yichengq/fix-2procs
pkg/testutil: ForceGosched -> WaitSchedule
2015-06-10 14:44:32 -07:00
018fb8e6d9 pkg/testutil: ForceGosched -> WaitSchedule
ForceGosched() performs bad when GOMAXPROCS>1. When GOMAXPROCS=1, it
could promise that other goroutines run long enough
because it always yield the processor to other goroutines. But it cannot
yield processor to goroutine running on other processors. So when
GOMAXPROCS>1, the yield may finish when goroutine on the other
processor just runs for little time.

Here is a test to confirm the case:

```
package main

import (
	"fmt"
	"runtime"
	"testing"
)

func ForceGosched() {
	// possibility enough to sched up to 10 go routines.
	for i := 0; i < 10000; i++ {
		runtime.Gosched()
	}
}

var d int

func loop(c chan struct{}) {
	for {
		select {
		case <-c:
			for i := 0; i < 1000; i++ {
				fmt.Sprintf("come to time %d", i)
			}
			d++
		}
	}
}

func TestLoop(t *testing.T) {
	c := make(chan struct{}, 1)
	go loop(c)
	c <- struct{}{}
	ForceGosched()
	if d != 1 {
		t.Fatal("d is not incremented")
	}
}
```

`go test -v -race` runs well, but `GOMAXPROCS=2 go test -v -race` fails.

Change the functionality to waiting for schedule to happen.
2015-06-10 14:37:41 -07:00
2d21904cfd test: run with cpu = 1,2,4 2015-06-10 14:26:17 -07:00
a4d1a5a6e5 *: Add security/auth support to etcdctl and etcd/client
add godep for speakeasy and auth entry parsing
add security_user to client
add role to client
add role commands
add auth support to etcdclient and etcdctl(member/user)
add enable/disable to etcdctl
better error messages, read/write/readwrite
Bump go-etcd to include codec changes, add new dependency
verify the error for revoke/add if nothing changed, remove security-merging prefix
2015-06-10 16:58:10 -04:00
97709b202d Merge pull request #2930 from xiang90/storage_restore
storage: initial snapshot and restore
2015-06-10 11:38:57 -07:00
ba9a46aa02 storage: initial snapshot and restore
Snapshot takes an io.Writer and writes the entire backend data to
the given writer. Snapshot writes a consistent view and does not
block other storage operations.

Restore restores the in-memory states (index and book keeping) of
the storage from the backend data.
2015-06-10 11:32:10 -07:00
1403783326 Merge pull request #2911 from yichengq/rafthttp-plog
rafthttp: use leveled logger
2015-06-09 16:16:33 -07:00
f1e995b070 rafthttp: use leveled logger 2015-06-09 16:15:02 -07:00
19ef3a0982 Merge pull request #2934 from xiang90/etcdserver_log
etcdserver: use leveled logging
2015-06-09 15:53:52 -07:00
e0f9796653 etcdserver: use leveled logging
Leveled logging for etcdserver pkg.
2015-06-09 13:53:07 -07:00
9fbd2599ad Merge pull request #2940 from yichengq/improve-raft-loop
etcdserver: stop raft loop when receiving stop signal
2015-06-09 11:24:53 -07:00
0814966ca2 etcdserver: stop raft loop when receiving stop signal
When it waits for apply to be done, it should stop the loop if it
receives stop signal.

This helps to print out panic information. Before this PR, if the panic
happens when server loop is applying entries, server loop will wait for
raft loop to stop forever.
2015-06-09 11:11:53 -07:00
ebb767765e Merge pull request #2941 from bakins/http-log
Simple debug HTTP request logging
2015-06-09 10:52:13 -07:00
d8a836e618 Simple debug HTTP request logging 2015-06-09 13:40:37 -04:00
1ff86556b7 Merge pull request #2937 from xiang90/http_log
etcdhttp: use leveled logging
2015-06-09 09:35:17 -07:00
0adeee2965 etcdhttp: use leveled logging 2015-06-09 09:26:57 -07:00
3390f38bba Merge pull request #2925 from yichengq/doc-gomaxprocs
docs: document cpu cores deployment
2015-06-08 13:49:28 -07:00
471cf82905 docs: document maximal OS threads 2015-06-08 12:00:33 -07:00
e0d5116683 Merge pull request #2926 from xiang90/raft_log
raft: make the repeated log message under bad path debug level
2015-06-08 10:57:12 -07:00
1279e495f0 raft: make the repeated log message under bad path debug level 2015-06-05 17:29:24 -07:00
05b55d9d75 Merge pull request #2921 from xiang90/fix_watch_cancel
client: fix cancel watch
2015-06-05 15:46:16 -07:00
15ac4f08f8 client: fix cancel watch
ioutil.ReadAll is a blocking call, we need to wait cancelation
during the call.
2015-06-05 15:40:43 -07:00
976ac65c86 Merge pull request #2894 from xiang90/refactor_keyIndex
Storage initial compaction
2015-06-05 12:38:11 -07:00
511f323424 Merge pull request #2916 from luan/build-script-git-fallback
Unexpected dependency in build script
2015-06-05 10:17:15 -07:00
17d5381059 build: default git sha to GitNotFound in case git fails 2015-06-05 10:09:50 -07:00
f47ed4a364 storage: initial compact 2015-06-05 09:22:44 -07:00
60ca9ebab1 Merge pull request #2915 from jonboulle/master
docs: readme/branch-management cleanup
2015-06-04 16:54:15 -07:00
048a948eca docs: readme/branch-management cleanup 2015-06-04 16:41:32 -07:00
75ddf05ca1 Merge pull request #2910 from xiang90/etcdctl
etcdctl: cleanup
2015-06-03 10:53:13 -07:00
f9c67daee5 Merge pull request #2912 from xiang90/client-curl
client: support printing cURL command
2015-06-03 10:15:00 -07:00
4f2df84a38 client: support printing cURL command 2015-06-03 10:02:37 -07:00
9e8d589163 Merge pull request #2906 from yichengq/fix-pipeline-stop
rafthttp: fix pipeline.stop may block
2015-06-03 08:47:17 -07:00
f0edf06b6d etcdctl: minor cleanup 2015-06-02 19:50:37 -07:00
079e7c10a0 etcdctl: move format to format.go 2015-06-02 19:29:05 -07:00
26682b663d etcdctl: cleanup etcdctl exit code 2015-06-02 19:01:41 -07:00
7f8925e172 rafthttp: fix pipeline.stop may block
This PR makes pipeline.stop stop quickly. It cancels inflight requests,
and stops sending messages in the buffer.
2015-06-02 17:15:44 -07:00
627929d2f4 Merge pull request #2909 from xiang90/logger
*: rename logger to plog
2015-06-02 15:03:28 -07:00
711451ce2d *: rename logger to plog 2015-06-02 14:58:24 -07:00
28878e34ff Merge pull request #2903 from xiang90/chord_rafthttp
rafhttp: clean up logging messages
2015-06-02 14:44:40 -07:00
b74082c06c Merge pull request #2889 from yichengq/version-runtime-enforce
rafthttp: version enforcement on rafthttp messages
2015-06-02 14:37:38 -07:00
c371d8c65c rafthttp: version enforcement on rafthttp messages
This PR sets etcd version and min cluster version in request header,
and let server check version compatibility. rafthttp server
will reject any message from peer with incompatible version(too low
version or too high version), and print out warning logs.
2015-06-02 13:33:18 -07:00
2bf64b4adf Merge pull request #2898 from xiang90/raft_log
raft use leveled logger
2015-06-02 13:04:02 -07:00
1561b85bf3 raft: drop the raft prefix in logging 2015-06-02 12:50:42 -07:00
3af4a45d7b etcdserver: make raft use leveled logger 2015-06-02 12:50:42 -07:00
89f6f988cb Godeps: update logger pkg 2015-06-02 12:50:42 -07:00
46b5eb051e Merge pull request #2896 from xiang90/wal_log
wal: use leveled logger
2015-06-02 11:39:25 -07:00
59dd1eeaf0 Merge pull request #2897 from xiang90/snapshot_logger
snap: use leveled logger
2015-06-02 11:39:17 -07:00
a8af787971 Merge pull request #2902 from BlueDragonX/bug-proxyreq-closed
Reuse a bytes buffer as proxy request body.
2015-06-02 10:37:48 -07:00
4e85f932e0 proxy: Reuse a bytes buffer as proxy request body.
The call to transport.RoundTrip closes the request body regardless of
the value of request.Closed. This causes subsequent calls to RoundTrip
using the same request body to fail.

Fixes #2895
2015-06-02 10:27:20 -07:00
2b5f417113 Merge pull request #2901 from xiang90/fix_urlpick
rafthttp: move mu to the top in urlPicker struct
2015-06-01 23:53:57 -07:00
1cd5c7efee Merge pull request #2900 from yichengq/proxy-maxidle
etcdmain: increase maxIdleConnsPerHost in proxy transport
2015-06-01 23:31:35 -07:00
a7a4233f0b rafhttp: clean up logging messages 2015-06-01 17:18:37 -07:00
b660ee408f rafthttp: move mu to the top in urlPicker struct
mutex protects all the fields.
2015-06-01 16:40:18 -07:00
0589afe605 etcdmain: increase maxIdleConnsPerHost in proxy transport
This PR set maxIdleConnsPerHost to 128 to let proxy handle 128 concurrent
requests in long term smoothly.
If the number of concurrent requests is bigger than this value,
proxy needs to create one new connection when handling each request in
the delta, which is bad because the creation consumes resource and may
eat up your ephemeral port.
2015-06-01 16:19:36 -07:00
ae5f7c943b snap: use leveled logger 2015-06-01 14:07:30 -07:00
185d2bced4 wal: use leveled logger 2015-06-01 13:38:50 -07:00
8825af47a0 Merge pull request #2893 from eparis/unfuck-godeps
godeps: fix and update dependencies
2015-06-01 10:16:58 -07:00
af5286c63b Fix godeps to be usable
Godeps should allow me to do
  godep restore
  godep save -r ./...

But that doesn't work. Try it.

This requires update to the following packages:
github.com/prometheus/client_golang/
github.com/prometheus/procfs
github.com/matttproud/golang_protobuf_extensions/

There were 2 major problems.

1. godeps have code.google.com/p/goprotobuf but that repo doesn't exist
2. prometheus/client_golang/_vendor moved to other packages and godep
(with -r) can't handle it.

At the end of this we should be able to use godeps again without tons of
black magic.  uggh.  what a pain in the ass.

The black magic to actually get godeps back in shape was:

```bash
 # remove code.google.com/p/goprotobuf (doesn't exist)
 # remove all _vendor lines from prometheus (we still have other
 # prometheus lines so restore still works)
vi Godeps/Godeps.json

 # remove all the crazy vendoring crud because godep doesn't handle it
 # correctly
find . -name \*.go | xargs sed -i
's|github.com/coreos/etcd/Godeps/_workspace/src/||'

 # ok now, restore as best we can (everything except it wines about
 # goprotobuf
godep restore

 # now update the packages which were using the old (dead) goprotobuf
go get -u github.com/prometheus/client_golang/
go get -u github.com/matttproud/golang_protobuf_extensions/
 # update prometheus procfs because prometheus/client_golang/ has a
 # dependancy on this update
go get -u github.com/prometheus/procfs

 # get rid of Godeps directory entirely
git rm -rf Godeps

 # ok, now, rewrite the Godeps directory and redo the path rewrites
godep  save -r ./...

 # now put Godeps back into git
git add Godeps/

 # commit the new code
git commit -aA

 # And now, you can use godeps!
godep restore
godep save -r ./...
git diff
 # nothing!!
```
2015-05-31 23:52:16 -04:00
d417b36e5d storage: refactor key_index 2015-05-31 15:24:04 -07:00
7735501407 Merge pull request #2874 from xiang90/storeAPI
kv api of stroage
2015-05-31 15:17:20 -07:00
815fe327dd Merge pull request #2890 from xiang90/fix_raft_comment
raft: remove wrong invariant
2015-05-30 13:28:13 -07:00
77c3613d94 build: use posix shell 2015-05-30 09:34:54 +03:00
0ca6be31f8 raft: remove wrong invariant
The commit > unstable might not true for follower. The leader only need
to ensure the entry is stored on the majority of nodes to commit an
entry. So the minority of the cluster might receive commit > unstable
append request. This is normal.
2015-05-29 18:48:59 -07:00
871107c65a Merge pull request #2883 from alexaltair/master
etcdmain: use double-dash in message flag
2015-05-28 14:33:14 -07:00
4e97305df0 Merge pull request #2878 from xiang90/fix_raft_node
raft: fix raft node start bug
2015-05-28 14:31:25 -07:00
6f8c36c2ab etcdmain: use double-dash in message flag 2015-05-28 13:09:44 -07:00
ce5e14e713 Merge pull request #2881 from barakmich/go-etcd-update
Godep: update go-etcd version
2015-05-28 14:10:50 -04:00
f6f7ef6b3a Godep: update go-etcd version 2015-05-28 14:02:14 -04:00
6c207b9277 stroage: kill todo 2015-05-27 14:46:59 -07:00
de1c9c08e1 Merge pull request #2842 from SpencerBrown/SpencerBrown-patch-2
docs: add client flags to examples in clustering.md
2015-05-27 14:28:38 -07:00
69d02410cf stroage: adopt KV interface 2015-05-27 14:24:23 -07:00
6f0558b999 Merge pull request #2871 from xiang90/cluster_id
rafthttp: print out log when clusterID mismatch instead of exiting
2015-05-27 13:34:27 -07:00
085447ed85 raft: fix raft node start bug
raft node should set initial prev hard state to empty.
Or it will not send the first hard coded state to application
until the state changes again.

This commit fixs the issue. It introduce a small overhead, that
the same tate might send to application twice when restarting.
But this is fine.
2015-05-27 13:32:04 -07:00
cbb8b9bb08 stroage: add tnx id 2015-05-27 10:35:51 -07:00
7ad2b22498 Merge pull request #2876 from xiang90/little_fix
etcdmian: remove main prefix in logging
2015-05-27 10:11:34 -07:00
1d6e9fd387 Merge pull request #2875 from yichengq/verbose-integration
test: run integration tests in verbose mode
2015-05-27 10:09:56 -07:00
7875de7d2f etcdmian: remove main prefix in logging
We are using new log pkg, which adds the prefix for us.
2015-05-27 10:01:22 -07:00
9c1aec6877 storage: add rangeKeys func 2015-05-27 09:58:21 -07:00
fde7a7a10c test: run integration tests in verbose mode
Travis doesn't print out the final result of integration tests
sometimes, and verbose mode helps us debug.
2015-05-27 09:57:44 -07:00
4e0b28f1ca Merge pull request #2872 from bprashanth/log_gomax
etcdmain: explicitly set gomaxprocs and log its value
2015-05-27 09:57:12 -07:00
1e15b05e4c etcdmain: explicitly set gomaxprocs and log its value 2015-05-27 09:53:05 -07:00
fb12a4e412 storage: fix a deadlock in batch tx 2015-05-27 09:31:11 -07:00
93ecf36855 storage: support tnx 2015-05-27 09:31:11 -07:00
9db360387d storage: support Range 2015-05-27 09:31:11 -07:00
7bb388ed52 storage: initial kv api 2015-05-27 09:31:11 -07:00
9be6a7c8fd Merge pull request #2831 from xiang90/index
storage: initial index and key index
2015-05-27 09:29:42 -07:00
49da7b6556 storage: add boltdb as dependency 2015-05-27 09:24:49 -07:00
0d3d4c5b01 rafthttp: print out log when clusterID mismatch instead of exiting
We have heard from several users that they do not expect a clusterID
mismatch to kill the cluster.
2015-05-26 16:05:58 -07:00
5d741e4945 Merge pull request #2797 from yichengq/stream-2.0
rafthttp: try stream msgappV1 handler if msgappV2 is unsupported
2015-05-26 15:09:51 -07:00
19fc1a7137 rafthttp: update streamReader term in time
Because etcd 2.1 will build stream to any existing peers and etcd 2.0
requires the remote to provide most updated term, it is
necessary for streamReader to know the latest term.
2015-05-26 14:52:42 -07:00
fad2c09fa8 rafthttp: not log expected timeout as error
The network timeout from stream with etcd 2.0 is expected because etcd
2.0 doesn't heartbeat on idle connections.
2015-05-26 14:52:41 -07:00
38b8e848ac rafthttp: try stream msgappV1 handler if msgappV2 is unsupported
This helps etcd 2.1 connect to msgappV1 handler when the remote member
doesn't support msgappV2. And it doesn't print out unsupported handler
error to make log clean.
2015-05-26 14:52:41 -07:00
42fe370b35 Merge pull request #2848 from xiang90/metrics
*: use namespace and subsystem in metrics
2015-05-26 14:44:54 -07:00
60c8719d08 Merge pull request #2782 from yichengq/not-close-stream
rafthttp: only close streamMsgApp when updating term
2015-05-26 14:41:22 -07:00
34ac145b38 *: use namespace and subsystem in metrics
Fix #2841.

From Prometheus developer:
```
the recommended way for etcd as an open source project and under
consideration of its size would be etcd_<subsystem>_<name>.
```

We made the naming change accordingly.
2015-05-26 14:39:04 -07:00
3028edd7dc Merge pull request #2856 from xiang90/mrefactor
etcdserver: refactore member.go
2015-05-26 14:37:37 -07:00
4d8be39fd1 Merge pull request #2870 from yichengq/enable-travis-govet
travis: stop install tools cover and vet
2015-05-26 11:59:42 -07:00
c951c22fff Merge pull request #2861 from barakmich/2859
etcdserver: fix go vet. Fixes #2859
2015-05-26 11:06:55 -07:00
90ad78aa46 travis: stop install tools cover and vet
There is no need to install them separately because they have been
downloaded in the default go root directory.
2015-05-26 11:03:53 -07:00
1be69b1391 Merge pull request #2864 from schmichael/mention-metafora
docs: mention metafora distributed task library
2015-05-22 13:24:20 -07:00
e93242967c docs: mention metafora distributed task library
Metafora uses etcd as a task broker, command channel, and state store.
2015-05-22 13:17:05 -07:00
0e49a0a3ef docs: add client flags to examples in clustering.md
to make it a complete functional example
2015-05-22 14:18:14 -05:00
9ef098c5ed etcdserver: fix go vet. Fixes #2859 2015-05-22 13:54:54 -04:00
58eefda72d Merge pull request #2840 from yichengq/revert-url-equal
Revert "Treat URLs have same IP address as same"
2015-05-21 19:27:19 -07:00
4a72d3a8bb etcdserver: refactore member.go 2015-05-21 09:19:29 -07:00
e332e86b5d storage: address barak's comments 2015-05-20 17:47:35 -07:00
0ad6d7e3ba Merge pull request #2853 from bdarnell/status
raft: MultiNode.Status returns nil for non-existent groups.
2015-05-20 13:07:23 -07:00
d58fac453d raft: MultiNode.Status returns nil for non-existent groups.
Previously it would panic if the group did not exist.
2015-05-20 15:45:38 -04:00
781eccb337 Merge pull request #2852 from bdarnell/hex-node-id
raft: Format node IDs as hex in DescribeMessage.
2015-05-20 12:34:35 -07:00
ef721db247 raft: Format node IDs as hex in DescribeMessage.
This is how they are printed in all other log messages.
2015-05-20 15:32:56 -04:00
260aad5468 Merge pull request #2830 from xiang90/join_checking
checking cluster version compatibility before joining the existing cluster
2015-05-20 12:25:50 -07:00
aa417ab644 etcdserver: log the per endpoint error in getVersion 2015-05-20 12:10:10 -07:00
db7db689a6 etcdserver: check cluster version compability when joining 2015-05-19 10:19:41 -07:00
845cb61213 storage: add kv and event proto 2015-05-18 14:35:10 -07:00
00ed4fe778 Merge pull request #2764 from barakmich/2755
security: Lazily create the security directories. Fixes #2755.
2015-05-18 17:34:13 -04:00
a88a53274f security: Lazily create the security directories. Fixes #2755, may find new instances for #2741
revert the kv integration test

fix nits

amend security mention of GUEST
2015-05-18 17:28:04 -04:00
6ee5cd9105 Merge pull request #2675 from xiang90/v3rfc
doc: v3api rfc
2015-05-18 13:52:54 -07:00
7c879ee576 doc: v3api rfc 2015-05-18 13:48:16 -07:00
3153e635d5 Revert "Treat URLs have same IP address as same"
This reverts commit f8ce5996b0.

etcd no longer resolves TCP addresses passed in through flags,
so there is no need to compare hostname and IP slices anymore.
(for more details: a3892221ee)

Conflicts:
	etcdserver/cluster.go
	etcdserver/config.go
	pkg/netutil/netutil.go
	pkg/netutil/netutil_test.go
2015-05-16 03:21:10 -07:00
b3e6ad136a docs: add node-etcd-config to libs and tools doc 2015-05-16 02:02:44 -07:00
9575cc4258 storage: add delete example 2015-05-15 19:33:59 -07:00
2e43ac8463 rafthttp: add test for streamReader.updateMsgAppTerm 2015-05-15 11:21:54 -07:00
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
9699a501f3 Merge pull request #2833 from yichengq/rename-closer
rafthttp: resetCloser -> close
2015-05-15 11:18:58 -07:00
8e0992a28b rafthttp: resetCloser -> close
name 'close' is shorter and more straightforward.
2015-05-14 22:24:05 -07:00
fc4543a3fd Merge pull request #2628 from yichengq/improve-msgappv2
rafthttp: reduce allocs in msgappv2
2015-05-14 21:18:16 -07:00
4b0d9f69c7 storage: add a simple backend and kv example 2015-05-14 20:43:32 -07:00
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
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
9d831e3075 *: godep btree 2015-05-14 17:59:55 -07:00
660fd5e3e1 storage: add comment around compact 2015-05-14 17:55:54 -07:00
ee47973199 storage: initial index 2015-05-14 17:53:41 -07:00
32d44aa3b2 storage: initial key index 2015-05-14 17:35:12 -07:00
556713739c Merge pull request #2823 from alexwlchan/master
docs: small fixes to spelling and similar
2015-05-14 15:41:14 -07:00
9f8342dba4 etcdserver: do not get local version via HTTP 2015-05-13 17:19:32 -07:00
988c30bfba etcdserver: getVersion returns both server and cluster version 2015-05-13 17:04:46 -07:00
1a9dcd2f72 Merge pull request #2826 from yichengq/fix-wait-test
pkg/wait: fix TestWaitTestStress
2015-05-13 15:56:26 -07:00
132b12f8db Merge pull request #2827 from xiang90/cluster_v
etcdhttp: version endpoint also returns cluster version.
2015-05-13 15:54:54 -07:00
6296054ff6 etcdhttp: version endpoint also returns cluster version. 2015-05-13 15:48:10 -07:00
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
75ee7f4aa1 Merge pull request #2821 from yichengq/private-cluster
etcdserver: stop exposing Cluster struct
2015-05-13 10:26:48 -07:00
2690535f8a Merge pull request #2820 from xiang90/cap
version capability checking
2015-05-13 10:16:49 -07:00
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
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
19ab1cb2a9 Merge pull request #2822 from xiang90/rm_log
etcdserver: remove unnecessary around detect datadir
2015-05-13 09:27:21 -07:00
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
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
f4c51cb5a1 Merge pull request #2766 from yichengq/345
*: extract types.Cluster from etcdserver.Cluster
2015-05-12 15:52:24 -07:00
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
197437316f Merge pull request #2804 from xiang90/vv
etcdserver: support update cluster version through raft
2015-05-12 14:31:27 -07:00
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
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
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
b764f07e34 Merge pull request #2811 from mischief/plan9-lock
pkg/fileutil: add plan9 lockfile support
2015-05-11 17:42:40 -07:00
91cbf47a2a etcdmain: better error msg when detected duplicate id in discovery 2015-05-11 17:34:44 -07:00
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
2e8c932ab0 pkg/fileutil: add plan9 lockfile support 2015-05-11 13:24:01 -07:00
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
3d242695b3 Merge pull request #2775 from yichengq/proxy-doc
docs: proxy needs accessible advertise client urls
2015-05-10 10:18:40 -07:00
42783c1faa Merge pull request #2805 from MSamman/more_version_info
version: added more version information
2015-05-08 20:28:10 -07:00
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
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
b24dd8e4e6 Merge pull request #2792 from ecnahc515/client_create_dir
client: Support creating directory through KeysAPI
2015-05-07 11:13:49 -07:00
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
eb930c3298 Merge pull request #2787 from bcwaldon/ttldur
client: add Node.TTLDuration()
2015-05-05 15:21:44 -07:00
ee9e336fd4 client: add Node.TTLDuration() 2015-05-05 15:03:24 -07:00
d101568ac9 Merge pull request #2788 from barakmich/roadmap
*: Initial roadmap
2015-05-05 16:43:06 -04:00
d4bd57229d *: Initial roadmap 2015-05-05 16:05:35 -04:00
0b082b7bd4 Merge pull request #2771 from sorah/close-ongoing-conn
Fix connection leak when client disconnected
2015-04-29 20:46:13 -07:00
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
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
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
0fbf90b1e0 Merge pull request #2774 from xiang90/cluster
etcdserver: rename StoreAdminPrefix to StoreClusterPrefix
2015-04-29 12:20:04 -07:00
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
a4e35f4650 Merge pull request #2718 from xiang90/version
support cluster-wide version sync
2015-04-29 11:45:21 -07:00
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
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
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
beb606f066 Merge pull request #2704 from philips/build-aci-port-mountpoint
scripts: build-aci update to have mountPoint and ports
2015-04-29 07:30:44 -07:00
6c77e7a737 Merge pull request #2768 from coreos/docs-formatting
docs: fix code block formatting
2015-04-28 14:02:30 -07:00
2a50f7a1aa Merge pull request #2770 from barakmich/new_logger
etcdmain: fix logging flag documentation
2015-04-28 16:53:58 -04:00
ad8e3ea5dc etcdmain: fix logging flag documentation 2015-04-28 16:31:19 -04:00
2299e35d99 Merge pull request #2769 from barakmich/new_logger
etcdmain: New logger
2015-04-28 16:06:51 -04:00
b369cf037a etcdmain: New Logging Package
use capnslog

Vendor capnslog and set the flags in etcd main

remove package prefix from etcdmain
2015-04-28 15:42:32 -04:00
bfd4a29f67 docs: fix code block formatting 2015-04-28 11:17:13 -07:00
0d6e062b5b Merge pull request #2738 from sublimino/patch-1
docs: fix link to etcd-migrate in README.md
2015-04-27 22:12:57 -07:00
eafdd3b718 Merge pull request #2730 from yichengq/tester-key-param
main: parameterize stress key size and key suffix range
2015-04-27 17:02:36 -07:00
057d21cf79 main: parameterize stress key size and key suffix range
It faciliates tester to adjust the size of each request, the number of
keys in the store and the size of snapshot.
2015-04-27 16:46:56 -07:00
33f3bb3074 Merge pull request #2754 from xiang90/member_change
integration: add a test case for a full cluster rotation
2015-04-27 15:44:15 -07:00
077c8397d2 integration: add a test case for a full cluster rotation 2015-04-27 15:38:06 -07:00
d080c33c07 Merge pull request #2762 from yichengq/343
rafthttp: stop etcd if it is found removed when stream dial
2015-04-27 15:10:39 -07:00
1c1cccd236 rafthttp: stop etcd if it is found removed when stream dial
The original process is stopping etcd only when pipeline message finds itself
has been removed. After this PR, stream dial has this functionality too.
It helps fast etcd stop, which doesn't need to wait for stream break to
fall back to pipeline, and wait for election timeout to send out message
to detect self removal.
2015-04-27 15:10:00 -07:00
be6f49ba32 Merge pull request #2758 from lavagetto/master
docs: clarify the disaster recovery guide
2015-04-25 10:54:17 -07:00
968f3d9711 docs: clarify the disaster recovery guide
A bit was missing from the documentation on disaster recovery, the reset
of the advertised peer urls for the node recovered from backup. Without
that, any subsequent server joining the cluster would not be able to
speak to the first node.
2015-04-25 18:54:29 +02:00
f31a57d02e Merge pull request #2757 from yichengq/fix-typo
client: fix test name typo
2015-04-24 18:06:59 -07:00
39dae50e71 client: fix test name typo
This is introduced at d89a862
2015-04-24 18:05:18 -07:00
f244ae4aa5 Merge pull request #2756 from xiang90/client_gone
client: 410 is a vaild response for member.Remove
2015-04-24 17:17:12 -07:00
91c45c3243 client: 410 is a vaild response for member.Remove
When removing a member, etcdserver might return 410 that indicates
the member has been removed. To client, 410 is a vaild response since
the client might do internal retry.
2015-04-24 17:01:23 -07:00
b6aa31a5b6 Merge pull request #2750 from xiang90/member_test
integration: add tests around the membership change issues
2015-04-24 13:22:19 -07:00
a42b9708ae integration: add tests around the membership change issues 2015-04-24 13:07:43 -07:00
ebecee34e0 Merge pull request #2701 from yichengq/rafthttp-anon
rafthttp: add remotes
2015-04-24 13:04:37 -07:00
49f4c17767 Merge pull request #2751 from akolb1/solaris_fix3
pkg/fileutil: add filelock support for solaris
2015-04-24 12:50:13 -07:00
39c7060d3b pkg/fileutil: add filelock support for solaris 2015-04-24 12:18:08 -07:00
9f19b5660f rafthttp: add AddRemote
Add remotes to rafthttp, who help newly joined members catch up the
progress of the cluster. It supports basic message sending to remote, and
has no stream connection for simplicity. remotes will not be used
after the latest peers have been added into rafthttp.
2015-04-24 11:49:23 -07:00
41c7b43dc5 Merge pull request #2749 from junxu/master
raft: fix typo in raftlog
2015-04-24 07:47:01 -07:00
6b7891c643 raft: fix typo in raftlog
fix typo in String() method of raftlog which will misorder
the "committed" and "unstable.offset" output.
2015-04-24 03:28:57 -04:00
b5d4d9ae9b Merge pull request #2713 from xiaost/etcdserver-skip-empty-entry
etcdserver: apply: skip empty Entry
2015-04-23 21:24:25 -07:00
cab1e9a723 etcdserver: skip noop entry in apply 2015-04-24 12:15:51 +08:00
0d25b20fc0 *: bump to v2.1.0-alpha.0+git 2015-04-23 15:02:51 -07:00
c1608bcdb4 *: bump to v2.1.0-alpha.0 2015-04-23 15:02:18 -07:00
01d9c9ce17 Merge pull request #2739 from xiang90/fix_wal
wal: change io.EOF returned by readFull to io.ErrUnexpectedEOF
2015-04-23 14:21:19 -07:00
0efcfcb87b Merge pull request #2654 from barakmich/update_security
security: Update security
2015-04-23 16:16:31 -04:00
fa74e702d8 security: Improve the security api as per the suggestions list in #2384
Subcommits:

decouple root and security enable/disable

create root role

prefix matching

godep: bump go-etcd to include credentials

add godep for speakeasy and auth entry parsing

appropriate errors for security enable/disable

WIP adding to etcd/client all the security client methods

add guest access

minor ui return tweaks

revert client changes

respond to comments, log more security operations

fix major ensure() bug, add better UX

block recursive access

fix some boneheaded mistakes

fix integration test

last comments

fix up security_api.md

philips nits

fix docs
2015-04-23 16:11:38 -04:00
d1d7feacc9 wal: change io.EOF returned by readFull to io.ErrUnexpectedEOF
Decoder should return error for any broken block including the
one that only contains the length field. We should change io.EOF
to io.ErrUnexpectedEOF before return the error.
2015-04-23 09:53:36 -07:00
efb0b6e5c8 Fix link to etcd-migrate in README.md 2015-04-23 17:03:08 +01:00
5cd6eead51 Merge pull request #2735 from robszumski/docs-migrate-link
docs: add absolute link to readme
2015-04-22 15:15:04 -07:00
c9878f4765 docs: add absolute link to readme 2015-04-22 13:59:08 -07:00
25d857bb47 Merge pull request #2732 from robszumski/relative-links
docs: remove absolute links to other docs
2015-04-22 11:54:30 -07:00
bd54f46d1b docs: remove absolute links to other docs 2015-04-22 11:47:52 -07:00
4953e490f6 Merge pull request #2731 from yichengq/tester-wait-long
tools/etcd-tester: wait longer for health
2015-04-22 11:25:58 -07:00
46d743f389 Merge pull request #2726 from yichengq/init-sstat
etcdserver: init server stats before passing it as argument
2015-04-22 08:39:47 -07:00
1d96de459a etcdserver: init server stats before passing it as argument
It is more reasonable to init the variable before passing it as an
argument.

It fixes a bug that etcdserver may panic on server stats when processing
a message from rafthttp streamReader before server stats is initialized
in server.Start().
2015-04-22 08:28:08 -07:00
3127a3b659 tools/etcd-tester: wait longer for health
It dramatically reduce the probability that follower failed to catch up
the leader.
2015-04-21 17:55:24 -07:00
b99c80874f Merge pull request #2721 from philips/add-extended
etcdctl: add extended as output format
2015-04-21 12:16:00 -07:00
57270ec0b7 etcdctl: add extended as output format
extended wasn't documented in the help as one of the output formats, fix
this!
2015-04-21 10:22:58 -07:00
f077092bc1 Merge pull request #2715 from xiang90/version
*: serve json version on both client and peer url
2015-04-20 16:52:14 -07:00
5ad559b503 *: serve json version on both client and peer url 2015-04-20 16:23:51 -07:00
9dd7c1c60b Merge pull request #2708 from judwhite/patch-1
README.md: change setDir -> setdir
2015-04-20 13:56:35 -07:00
1811701427 Revert "etcdserver: fix cluster fallback recovery"
This reverts commit cff005777a.

Conflicts:
	etcdserver/server.go
2015-04-19 11:34:33 -07:00
88224f6f4e Revert "etcdserver: not apply stale conf change in cluster and transport"
This reverts commit 40197f0698.
2015-04-19 11:08:03 -07:00
4eae0e06e5 Merge pull request #2709 from justinsb/specify_bash_in_genproto
genproto assumes bash; specify bash
2015-04-18 15:31:00 -07:00
117cb995a5 script: genproto assumes bash; specify bash 2015-04-18 15:13:35 -07:00
d0f1bf9f8e README.md: change setDir -> setdir 2015-04-18 05:33:32 -05:00
90a7978474 Merge pull request #2666 from philips/check-error-in-store
store: always check the error
2015-04-17 20:14:32 -07:00
00044cd3bd scripts: build-aci update to have mountPoint and ports
Expose the etcd ports and data-dir mountPoint for future releases.
2015-04-17 14:57:15 -04:00
61e94ae16c Merge pull request #2625 from bakins/client-srv
Initial SRV discovery for clients
2015-04-17 08:07:32 -07:00
c4899c201e client: Discovery via SRV lookups
Based on code from discovery/srv.go.  The returns the target as DNS
returns it. In the case of SSL, certs are tied to the hostname and not
the IP address generally.

Solves #2547
2015-04-17 10:57:01 -04:00
2a675c08c2 store: always check the error
Ensure that we propogate any errors out of the node.Remove operation
back to the user. There is no reason to assume here.
2015-04-16 17:22:57 -07:00
54c4d5005d Merge pull request #2673 from ecnahc515/create_in_order
client: Add CreateInOrder method to client.KeysAPI
2015-04-16 13:34:09 -07:00
ee54aa3f02 Merge pull request #2697 from coreos/robszumski-patch-1
docs: size up all headers by 2
2015-04-16 10:10:35 -07:00
df32fe63c8 docs: size up all headers by 2 2015-04-16 09:55:46 -07:00
38a373ede9 Merge pull request #2692 from philips/add-migration-guide
Documentation: add migration notes to backward compatibility
2015-04-16 07:05:07 -07:00
a223fd532b Documentation: add migration notes to backward compatibility
Add thorough notes on both the data directory migration and the snapshot
migration options.
2015-04-15 20:42:12 -07:00
3e5d1cd873 Merge pull request #2678 from xiang90/fix_snapshot
snap: load should only return ErrNoSnapshot
2015-04-15 09:53:17 -07:00
f697916793 snap: load should only return ErrNoSnapshot
If there is no available snapshot, load should return
ErrNoSnapshot. etcdserver might recover from that error
if it still have complete WAL files.
2015-04-15 09:41:07 -07:00
0c3a92f855 Merge pull request #2663 from xiang90/wal_b
wal: report throughput in wal bench
2015-04-15 09:32:17 -07:00
da098ad713 Merge pull request #2685 from xiang90/fix_server
etcdserver: prevExist=true + condition is compareAndSwap
2015-04-15 09:17:13 -07:00
98f8dfbc9d etcdserver: prevExist=true + condition is compareAndSwap
PrevExist indicates the key should exist. Condition compares with
an existing key. So PrevExist+condition = CompareAndSwap not Update.
2015-04-14 23:44:06 -07:00
3aa7a31771 Merge pull request #2680 from xiang90/fix_backup
etcdctl: backup tool should use the new layout
2015-04-14 11:50:14 -07:00
d3778b1286 etcdctl: backup tool should use the new layout 2015-04-14 11:49:54 -07:00
d89a8628c6 client: Add CreateInOrder method to client.KeysAPI
Allows creating nodes within a given directory with atomically increasing
keys
2015-04-13 17:23:17 -07:00
f480a8b051 Merge pull request #2665 from xiaost/fix-minor-bug-in-etcdserver-send
etcdserver: fix minor bug in EtcdServer.send
2015-04-13 07:27:12 -07:00
eab2c2224a etcdserver: fix minor bug in EtcdServer.send
it seems to nothing serious.
after deleted peers, the log may output:
"etcdserver: send message to unknown receiver %s"
2015-04-13 20:35:58 +08:00
aed18395c9 wal: report throughput in wal bench 2015-04-12 21:35:08 -07:00
25f1feceb5 Merge pull request #2645 from xiang90/fix_more
wal: never leave a corrupted wal file
2015-04-09 10:30:54 -07:00
852213879b Merge pull request #2633 from yichengq/deprecate
etcdmain: deprecate --ca-file and --peer-ca-file
2015-04-09 10:22:30 -07:00
2f7b9a2232 etcdmain: deprecate --ca-file and --peer-ca-file
1. Print out DEPRECATE warning when running and configuration doc.
2. Use new flags for security example.
2015-04-09 10:14:32 -07:00
89242d4659 wal: better log msg 2015-04-09 09:54:20 -07:00
6a9e414961 Merge pull request #2603 from xiang90/dnssrv
*: stop using resolved tcp addr
2015-04-09 09:46:56 -07:00
9b65ff6959 discovery: drop trailing . from srv target 2015-04-09 07:08:22 -07:00
f5d4c86153 discovery: add a test case for srv
During srv discovery, it should try to match local member with
resolved addr and return unresolved hostnames for the cluster.
2015-04-09 07:07:27 -07:00
a3892221ee *: stop using resolved tcp addr
We start to resolve host into tcp addrs since we generate
tcp based initial-cluster during srv discovery. However it
creates problems around tls and cluster verification. The
srv discovery only needs to use resolved the tcp addr to
find the local node. It does not have to resolve everything
and use the resolved addrs.

This fixes #2488 and #2226
2015-04-09 07:01:48 -07:00
486eb8f6a8 Merge pull request #2641 from yichengq/fix-build-release
scripts: not put etcd-migrate into release dir
2015-04-08 17:22:18 -07:00
53792ccbdc wal: never leave a corrupted wal file
If the process dies during wal.cut(), it might leave a corrupted wal
file. This commit solves the problem by creating a temp wal file first,
then atomically rename it to a wal file when we are sure it is vaild.
2015-04-08 15:57:20 -07:00
2141308524 Merge pull request #2631 from yichengq/metrics-fd
etcdserver: metrics and monitor number of file descriptor
2015-04-08 11:28:58 -07:00
7a7e1f7a7c etcdserver: metrics and monitor number of file descriptor
It exposes the metrics of file descriptor limit and file descriptor used.
Moreover, it prints out warning when more than 80% of fd limit has been used.

```
2015/04/08 01:26:19 etcdserver: 80% of the file descriptor limit is open
[open = 969, limit = 1024]
```
2015-04-08 11:17:48 -07:00
252a931666 Merge pull request #2642 from yichengq/protect-wal
wal: allow at most one WAL function called at one time
2015-04-08 09:42:00 -07:00
44de670de7 wal: allow at most one WAL function called at one time
SaveSnap and Save are called in separate goroutines now. Allow at most
one WAL function being called at one time to protect internal fields and
guarantee execution order.
Or one possible bug is that the new cut file is started with snapshot
entry instead of crc entry.
2015-04-08 00:34:30 -07:00
91e9a24289 scripts: not put etcd-migrate into release dir
etcd-migrate has been integrated with etcd, and there is no need to put
it into release dir any more.
2015-04-07 16:04:52 -07:00
c66777f80f Merge pull request #2640 from xiang90/import
etcdctl: refactor message in import command
2015-04-07 15:09:34 -07:00
8c0b01d35b etcdctl: refactor message in import command 2015-04-07 15:08:07 -07:00
1b4bcedf99 Merge pull request #2637 from bakins/proxy-randomize-endpoints
proxy: shuffle endpoints
2015-04-07 14:12:50 -07:00
1fa511b995 Clarify that it is the proxy doing the shuffle. 2015-04-07 17:05:17 -04:00
74fd2b0536 Merge pull request #2638 from xiang90/import
etcdctl: import hidden keys
2015-04-07 12:53:18 -07:00
2c647409b9 etcdctl: import hidden keys 2015-04-07 12:41:05 -07:00
e1622cd22c proxy: shuffle endpoints
Shuffle endpoitns to avoid being "stuck" to a single cluster member.
2015-04-07 15:40:29 -04:00
8e9f2bb9e6 Merge pull request #2634 from xiang90/client-new
client: add dir/ttl fields into node
2015-04-07 09:11:19 -07:00
ec1fab3dc1 Merge pull request #2635 from yichengq/fix-doc
docs: fix broken link for migration tool
2015-04-07 09:03:30 -07:00
552acd8c37 docs: fix broken link for migration tool 2015-04-06 22:55:37 -07:00
666a97271d client: add dir/ttl fields into node 2015-04-06 21:47:20 -07:00
374a18130a Merge pull request #2629 from crawford/ports
*: update to use IANA-assigned ports
2015-04-06 13:57:18 -07:00
d9ad6aa2a9 *: update to use IANA-assigned ports 2015-04-06 13:49:43 -07:00
739db062d4 Merge pull request #2630 from yichengq/remove-coreos-pkg
pkg: remove unused pkg/coreos
2015-04-06 13:41:03 -07:00
2b830dd64b pkg: remove unused pkg/coreos
The package was used in upgrade path, and is not used anywhere now.
2015-04-06 13:33:42 -07:00
7d10385ec6 Merge pull request #2617 from yichengq/add-tls-test
integration: add TestTLSClusterUsingDiscovery and TestDoubleTLSCluster
2015-04-06 09:46:08 -07:00
51548acb4f rafthttp: reduce allocs in msgappv2
The patch decreases the allocs when sending one AppEntry in msgappv2
stream from 30 to 9. This helps reduce CPU load when etcd is under
high write load.
2015-04-06 09:45:39 -07:00
27083093d3 Merge pull request #2627 from mateusbraga/patch-2
osutil: fix InterruptHandler comment position
2015-04-04 09:06:55 -07:00
cec8466ad2 osutil: fix InterruptHandler comment position 2015-04-04 11:32:42 -04:00
c777516a5d Merge pull request #2620 from yichengq/new-rafthttp-msgapp
rafthttp: introduce msgappv2 stream format
2015-04-03 17:13:05 -07:00
0d88e0d111 rafthttp: introduce msgappv2 stream format
msgappv2 stream is used to send all MsgApp, and replaces the
functionality of msgapp stream. Compared to v1, it has several
advantanges:
1. The output message is exactly the same with the input one, which
cannot be done in v1.
2. It uses one connection to stream persistently, which prevents message
reorder and saves the time to request stream.
3. It transmits 10 addiontional bytes in the procedure of committing one
proposal, which is trivia for idle time.
4. It transmits less bytes when committing mutliple proposals or keep
committing proposals.
2015-04-03 17:08:56 -07:00
89495f9194 Merge pull request #2626 from yichengq/fix-raft-status
raft: generate correct json-format status
2015-04-03 13:54:46 -07:00
fa96e64b43 Merge pull request #2624 from yichengq/fix-raft-storage
raft: lock storage when compact it
2015-04-03 13:51:06 -07:00
3d32c059dd raft: generate correct json-format status
Current json-format string misses the double quote around status field.

Use %q for better clearance.
2015-04-03 13:49:46 -07:00
422cb7cb06 Merge pull request #2621 from yichengq/fix-inflight
raft: fix freeTo fails to free
2015-04-03 13:28:29 -07:00
d91ea7f199 raft: fix freeTo fails to free
If freeTo is called when to is set to the lastest inflight, freeTo
fails to free the slots.
2015-04-03 13:21:26 -07:00
c6de464587 raft: lock storage when compact it
etcd now compact raft storage asynchronously, and append entry to raft
storage may happen at the same time. Add the lock to fix the bug that
the entries saved in storage may be organized in a wrong way.
2015-04-03 11:38:01 -07:00
471aa1aa89 Merge pull request #2622 from xiang90/fix_watcher
store: fix watcher removal
2015-04-03 10:39:03 -07:00
999917010d store: fix watcher removal 2015-04-03 10:13:43 -07:00
c38a6a38bb Merge pull request #2619 from kelseyhightower/update-docker-docs
Documentation: update docker docs to use new image and mount certs
2015-04-02 13:39:24 -07:00
3db33d19e9 Documentation: update docker docs to use new image and mount certs 2015-04-02 13:22:27 -07:00
73936d1874 integration: add TestDoubleTLSCluster 2015-04-02 10:08:40 -07:00
ccb0934e22 integration: add TestTLSClusterUsingDiscovery 2015-04-02 00:01:39 -07:00
39633850d1 Merge pull request #2610 from yichengq/add-tls-test
integration: add TestTLSClusterOf3
2015-04-01 21:57:44 -07:00
d2efa2a615 integration: add TestTLSClusterOf3 2015-04-01 20:55:00 -07:00
a719f78046 Merge pull request #2616 from yichengq/stop-raft
etcdserver: stop raft node goroutine before stop server
2015-04-01 11:53:24 -07:00
9e5743c816 etcdserver: stop raft node goroutine before stop server
Stop raftNode goroutine before stopping server goroutine, so
server.Stop does stop all underlying stuffs elegantly now. This fixes
the problem that previous-round lock on WAL may not be released when
etcd is restarted.
2015-04-01 11:20:51 -07:00
2c7a8c2216 Merge pull request #2615 from yichengq/fix-upgrade-test
integration: fix upgrade test
2015-04-01 09:44:01 -07:00
f3baf4517b integration: fix upgrade test
Upgrade test listens on a fixed port, which may fail with 'bind address
already in use' if the port was just used to send tcp sockets.

The commit makes it listen on a random available port to avoid this.
2015-03-31 16:17:58 -07:00
9ad2eaf16c Merge pull request #2614 from barakmich/typos
etcdctl: fix import typos
2015-03-31 16:43:43 -04:00
ad7a12066f etcdctl: fix import typos 2015-03-31 16:41:35 -04:00
8ac7639459 Merge pull request #2612 from yichengq/fix-isolate
pkg/netutil: fix DropPort and RecoverPort in linux
2015-03-31 11:58:12 -07:00
a4fefd7f73 Merge pull request #2613 from xiang90/fix_import
etcdctl: wait for goroutine existing
2015-03-31 11:56:35 -07:00
1024f587e0 etcdctl: main routine of import command should wait for goroutine existing 2015-03-31 11:55:19 -07:00
46cfbb3a26 Merge pull request #2605 from xiang90/build
build: do not build internal debugging tool
2015-03-31 11:47:00 -07:00
a9157ce6d3 build: do not build internal debugging tool
We are still playing around with the dump-log tool.
Stop building it publicly until we are happy with its
ux and functionality.
2015-03-31 11:45:12 -07:00
b67ee7d222 Merge pull request #2608 from xiang90/walallocation
wal: reduce allocation when encoding int64
2015-03-31 10:55:20 -07:00
44665fc055 Merge pull request #2611 from xiang90/ctlport
etcdct: adopt new client port by default
2015-03-31 10:47:06 -07:00
24f9ba8ee8 pkg/netutil: fix DropPort and RecoverPort in linux
The iptables commands in DropPort do not work because setting
destination-port flag without specifying the protocol is invalid.
2015-03-31 10:39:31 -07:00
8ac565bc38 etcdct: adopt new client port by default
etcdserver uses both 4001 and 2379 for serving client requests by
default. etcdctl supports both ports by default.
2015-03-31 09:56:42 -07:00
8bcaa2bfdf wal: reduce allocation when encoding int64 2015-03-30 20:41:31 -07:00
2990c29a71 Merge pull request #2607 from xiang90/walallocation
wal: reduce allocation when encoding entries
2015-03-30 20:31:00 -07:00
c32cca3a4f wal: reduce allocation when encoding entries 2015-03-30 19:20:46 -07:00
4cbbbb6c46 Merge pull request #2606 from xiang90/update
*: update context pkg
2015-03-30 18:59:39 -07:00
73adb20166 *: update context pkg 2015-03-30 18:58:44 -07:00
77a04cda0c Merge pull request #2597 from xiang90/wal-repair
wal: fix the unexpectedEOF error in the last wal.
2015-03-30 13:49:05 -07:00
3e9a033cd2 wal: repair decoder needs to update its crc 2015-03-30 13:45:23 -07:00
253f7c4ae1 Merge pull request #2522 from xiang90/user_pw
etcdserver/etcdhttp: do not return back the password of a user
2015-03-30 13:42:41 -07:00
80d08ca280 Merge pull request #2521 from xiang90/sec_remove_lastmodified
doc/rfc: remove unimplemented stuff
2015-03-30 13:42:31 -07:00
c0f7ca26a3 Merge pull request #2587 from xiang90/ctl
etcdctl: add import command
2015-03-30 13:42:01 -07:00
fbfa6ba86a Merge pull request #2598 from xiang90/raft_bench
raft: node bench matches reality
2015-03-30 09:55:13 -07:00
81750ab2d7 Merge pull request #2600 from yichengq/failure-isolate
tools/functional-tester: add isolate failures
2015-03-29 22:43:51 -07:00
0b9a318e68 etcdserver: make the wal repairing logic clear 2015-03-29 21:10:28 -07:00
ee2833111d Merge pull request #2599 from yichengq/etcd-tester
tools/etcd-agent: stop etcd only if it is running when cleanup
2015-03-29 21:07:24 -07:00
e3e11aa1b1 Merge pull request #2584 from kalabiyau/patch-1
Update README.md
2015-03-29 20:59:13 -07:00
684ebd95ae wal: backup broken wal before repairing 2015-03-29 15:42:59 -07:00
1231f82f22 etcdserver: save snapshot into wal first 2015-03-29 14:23:05 -07:00
04a62dd54b tools/functional-tester: add isolate failures 2015-03-29 00:29:47 -07:00
8b4eed29e5 wal: fix the unexpectedEOF error in the last wal.
It is safe to repair the unexpectedEOF error in the last wal. raft
will not send out message before the entry successfully comitted
into wal. Thus we can safely truncate the last entry in the wal
to repair.
2015-03-28 21:08:14 -07:00
097a56fe01 tools/etcd-agent: stop etcd only if it is running
Stop etcd only if it is running, and not report error when stopping etcd
which is not started.
2015-03-28 19:31:06 -07:00
3f867bc6ed raft: node bench matches reality 2015-03-28 14:53:42 -07:00
84cf0843bf etcdctl: add migratesnap command 2015-03-27 19:23:38 -07:00
9a33678878 Merge pull request #2596 from yichengq/revert-internal-version
Revert "etcdhttp: add internalVersion"
2015-03-27 17:02:02 -07:00
60efd4d96e Revert "etcdhttp: add internalVersion"
This reverts commit a77bf97c14.

Conflicts:
	version/version.go
2015-03-27 16:53:55 -07:00
09f8dbad98 Merge pull request #2594 from xiang90/rm_upgrade
*: remove upgrading related stuff
2015-03-27 15:37:47 -07:00
45032480f1 *: remove upgrading related stuff 2015-03-27 15:28:00 -07:00
dd92a2b484 Merge pull request #2556 from yichengq/fix-apply-conf
etcdserver: not apply stale conf change
2015-03-27 14:00:30 -07:00
a16d15aafc Merge pull request #2591 from kelseyhightower/cleanup-etcdserver-stats
etcdserver: add stats.FollowerLatencyStats and stats.FollowerCountsStats...
2015-03-27 13:59:40 -07:00
538d624cfa etcdserver: add stats.LatencyStats and stats.CountsStats types 2015-03-27 13:42:44 -07:00
40197f0698 etcdserver: not apply stale conf change in cluster and transport 2015-03-27 12:53:34 -07:00
2439adf945 Merge pull request #2589 from mateusbraga/patch-1
docs: add clarity about the 1000 events history
2015-03-27 10:04:27 -07:00
7f833ced2b docs: add clarity about the 1000 events history
When talking about missing events on a particular key, the 1000 event history 
limit can be understood as being per key, instead of etcd-wide events. Make it 
clear that it is across all etcd keys.
2015-03-27 13:02:48 -04:00
635e4db6d9 Merge pull request #2582 from xiang90/cluster-check
etcdserver: loose member validation for joining existing cluster
2015-03-25 14:37:13 -07:00
424c29eacc Update README.md 2015-03-25 22:01:02 +01:00
e3817adb5b etcdserver: loose member validation for joining existing cluster 2015-03-25 13:59:22 -07:00
e5f2f40145 Merge pull request #2579 from xiang90/update-proto
*: update protobuf
2015-03-25 10:59:34 -07:00
05e240b892 *: update protobuf 2015-03-25 10:14:35 -07:00
bbcee5f506 Merge pull request #2577 from yichengq/fix-wal-test
wal: fix missing import
2015-03-24 22:58:43 -07:00
3dd6e0b88f wal: fix missing import 2015-03-24 22:53:15 -07:00
ea24b397bf Merge pull request #2576 from xiang90/fix_wal
wal: releastTo should work with large release index
2015-03-24 22:35:04 -07:00
6e6669d696 wal: releastTo should work with large release index 2015-03-24 22:34:26 -07:00
f940a34e60 Merge pull request #2575 from yichengq/343
version: not return err NotExist in Detect
2015-03-24 20:26:53 -07:00
16183bc22b version: not return err NotExist in Detect 2015-03-24 20:19:42 -07:00
d40ecad617 Merge pull request #2572 from bdarnell/multinode-config
raft: Use raft.Config in MultiNode.
2015-03-24 19:28:28 -07:00
f03ccd1120 Merge pull request #2573 from yichengq/fix-detect-wal
print out extra files in data dir instead of erroring
2015-03-24 19:17:01 -07:00
5e0077cc0c etcdserver: print out extra files in data dir instead of erroring 2015-03-24 18:56:22 -07:00
c9d507df11 raft: Use raft.Config in MultiNode. 2015-03-24 15:37:13 -04:00
866a9d4e41 Merge pull request #2568 from xiang90/raftnode
raft: make node configurable
2015-03-24 11:18:22 -07:00
b3fb052ad4 raft: make peers a prviate field in raft.Config 2015-03-24 11:10:07 -07:00
ea78f5d1aa Merge pull request #2552 from yichengq/fix-2396
etcdserver: check -initial-cluster in join case
2015-03-23 22:46:38 -07:00
abcd828114 etcdserver: add join-existing check 2015-03-23 22:31:20 -07:00
abddef0f28 raft: make node configurable 2015-03-23 21:20:49 -07:00
5ba85cb58d Merge pull request #2565 from coreos/philips-patch-1
raft: design: fixup markdown
2015-03-23 14:06:05 -07:00
057978bbc6 raft: design: fixup markdown
Need a space between `1.` for markdown to render as a list.
2015-03-23 14:01:17 -07:00
bcf001fe76 Merge pull request #2563 from yichengq/343
etcdmain: print error when non-flag args remain
2015-03-23 11:26:31 -07:00
0ac05e310e etcdmain: print error when non-flag args remain 2015-03-23 11:23:47 -07:00
e201f4b824 Merge pull request #2561 from xiang90/raft-configurable
raft: make raft configurable
2015-03-23 09:55:48 -07:00
d9b5b56c82 raft: make raft configurable 2015-03-23 09:55:19 -07:00
823c6d678c Merge pull request #2557 from yichengq/fix-windows-binary
scripts: add .exe extension on windows binaries
2015-03-22 22:58:44 -07:00
454b66edde Merge pull request #2558 from kelseyhightower/add-basic-auth
netutil: add BasicAuth function
2015-03-20 22:34:06 -07:00
a552722f03 Merge pull request #2544 from xiang90/raft-inflight
raft: add flow control for progress
2015-03-20 20:12:31 -07:00
4a64373225 raft: add flow control for progress
Each progress has a inflighs sliding window. When the progress
is in replicate state, inflights will control the sending speed
of the leader.

The leader can have at most maxInflight number of inflight
messages for each replicate progress. Receving a appResp moves
forward the sliding window. Heartbeat response free one
slot if the window is full.
2015-03-20 20:04:33 -07:00
09a86cb9b9 Merge pull request #2553 from xiang90/raft-design
raft: add progress state machine graph
2015-03-20 19:57:51 -07:00
4611c3b2d7 netutil: add BasicAuth function
etcd ships it's own BasicAuth function and no longer requires
Go 1.4 to build.
2015-03-20 17:32:33 -07:00
431fcc60ab scripts: add .exe extension on windows binaries 2015-03-20 16:45:29 -07:00
86622537a1 raft: add progress state machine graph 2015-03-20 15:28:50 -07:00
b7bbeefbff Merge pull request #2551 from yichengq/remove-starter
migrate: remove starter code
2015-03-20 13:07:23 -07:00
02be882c8f migrate: remove starter code
It has been moved to github.com/coreos/etcd-starter.
2015-03-20 10:51:42 -07:00
44d9209990 Merge pull request #2548 from xiang90/raft-design
raft: add our very first design.md
2015-03-20 09:07:44 -07:00
6e557c58c7 Merge pull request #2532 from yichengq/342
raft: print out data and time in log
2015-03-20 08:03:23 -07:00
f455de281c Merge pull request #2537 from buaazp/fix_store_stats_clone
fixed clone error for store stats.
2015-03-20 07:56:57 -07:00
afed8cf044 store: fixed clone error for store stats. 2015-03-20 12:31:47 +08:00
59d8089295 raft: add our very first design.md 2015-03-19 21:00:47 -07:00
2a980ee336 Merge pull request #2503 from yichengq/339
docs/security: fix peer TLS communication example
2015-03-19 17:16:09 -07:00
ea764dcdf7 Merge pull request #2542 from yichengq/etcd-tester
tools/etcd-tester: stress cluster using 50MB snapshot
2015-03-19 14:52:57 -07:00
d920c5b801 tools/etcd-tester: stress cluster using 50MB snapshot 2015-03-19 14:52:27 -07:00
ed81ccc1bb Merge pull request #2540 from xiang90/raft-progress
raft: move progress to progress.go
2015-03-19 10:09:54 -07:00
2adb58f9de raft: move progress to progress.go 2015-03-19 10:05:04 -07:00
a475e90c9c Merge pull request #2531 from xiang90/raft-limit
raft: limit the size of msgApp
2015-03-19 09:55:36 -07:00
125a033c72 Merge pull request #2534 from philips/initial-cluster-name
etcdmain: let user provide a name w/o initial-cluster update
2015-03-18 18:55:58 -07:00
b29eaed9ce Merge pull request #2533 from philips/grammar-unsafe-flags
Documentation: fixup grammar around the unsafe flags
2015-03-18 18:27:28 -07:00
82adf0b039 Merge pull request #2536 from philips/fixup-wal-201-starter
migrate: detect version 2.0.1
2015-03-18 18:23:50 -07:00
86ee3e3452 migrate: detect version 2.0.1
Without this code a second start will crash:

```
$ ./bin/etcd -name foobar --data-dir=foobar
2015/03/18 18:06:28 starter: detect etcd version 2.0.1 in foobar
2015/03/18 18:06:28 starter: unhandled etcd version in foobar
panic: starter: unhandled etcd version in foobar

goroutine 1 [running]:
log.Panicf(0x594770, 0x25, 0x208927c70, 0x1, 0x1)
	/usr/local/go/src/log/log.go:314 +0xd0
github.com/coreos/etcd/migrate/starter.checkInternalVersion(0x20889a480, 0x0, 0x0)
	/Users/philips/src/github.com/coreos/etcd/gopath/src/github.com/coreos/etcd/migrate/starter/starter.go:160 +0xf2f
github.com/coreos/etcd/migrate/starter.StartDesiredVersion(0x20884a010, 0x3, 0x3)
	/Users/philips/src/github.com/coreos/etcd/gopath/src/github.com/coreos/etcd/migrate/starter/starter.go:77 +0x2a9
main.main()
	/Users/philips/src/github.com/coreos/etcd/gopath/src/github.com/coreos/etcd/main.go:46 +0x25e

goroutine 9 [syscall]:
os/signal.loop()
	/usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
	/usr/local/go/src/os/signal/signal_unix.go:27 +0x35
```
2015-03-18 18:09:46 -07:00
ea72f2637c etcdmain: let user provide a name w/o initial-cluster update
Currently this doesn't work if a user wants to try out a single machine
cluster but change the name for whatever reason. This is because the
name is always "default" and the

```
./bin/etcd -name 'baz'
```

This solves our problem on CoreOS where the default is `ETCD_NAME=%m`.
2015-03-18 17:24:52 -07:00
408cfc4f28 Documentation: fixup grammar around the unsafe flags 2015-03-18 16:39:45 -07:00
7571b2cde2 raft: limit the size of msgApp
limit the max size of entries sent per message.
Lower the cost at probing state as we limit the size per message;
lower the penalty when aggressively decrease to a too low next.
2015-03-18 15:59:30 -07:00
0634cf2cfe raft: print out data and time in log
Keep the default log setting consistent with other packages.
2015-03-18 15:49:06 -07:00
7e7bc76038 Merge pull request #2514 from yichengq/340
raft: introduce progress states
2015-03-18 09:40:30 -07:00
67194c0b22 raft: introduce progress states 2015-03-18 08:16:32 -07:00
35fddbc5d0 Merge pull request #2526 from xiang90/fix_proxy_restart
etcdserver: etcd should fall back to proxy again if proxy data is detected
2015-03-17 16:22:23 -07:00
1ab68902a9 etcdmain: identify data dir type 2015-03-17 16:10:58 -07:00
d17f3a4452 Merge pull request #2519 from bdarnell/multinode-commit
raft: Use the correct commit index when advancing in MultiNode.
2015-03-17 10:31:53 -07:00
cd1ff78ff3 raft: Elaborate a little more about committed entries in commitReady. 2015-03-17 13:22:36 -04:00
5bfb4ed4fb Merge pull request #2520 from funkygao/funky
fix godoc bug
2015-03-17 08:00:10 -07:00
0b912c0faf raft: fix godoc about starting a node 2015-03-17 17:35:18 +08:00
9d28f94005 etcdserver/etcdhttp: do not return back the password of a user 2015-03-16 22:35:01 -07:00
263e55e2ff doc/rfc: remove unimplemented stuff 2015-03-16 22:22:34 -07:00
271d911c32 raft: Use the correct commit index when advancing in MultiNode.
This fixes an issue when restoring from a snapshot and brings
MultiNode closer to Node.
2015-03-16 18:40:51 -04:00
8a589d11d5 Merge pull request #2518 from xiang90/security_write_error
etcdserver/etcdhttp: write the http error to response writer
2015-03-16 15:25:35 -07:00
f3e4dbf967 etcdserver/etcdhttp: write the http error to response writer 2015-03-16 15:24:19 -07:00
bba7f75562 Merge pull request #2517 from yichengq/fix-sec2
security: fix var shadowing in CreateOrUpdateUser
2015-03-16 15:08:55 -07:00
8335a5407b security: fix var shadowing in CreateOrUpdateUser 2015-03-16 14:59:05 -07:00
98ef65ce77 Merge pull request #2516 from yichengq/fix-sec
security: fix var shadowing in CreateOrUpdate
2015-03-16 14:56:38 -07:00
d7780cf293 security: fix var shadowing in CreateOrUpdate 2015-03-16 14:55:04 -07:00
b65a7ed18b Merge pull request #2434 from barakmich/acl
security: Add saving of users and roles through the v2 API
2015-03-16 16:28:29 -04:00
001efa0639 security: Implement RBAC security for etcd
stub out security

further wip

Last stub before CRUD for roles

Complete role merging

start tests

add Godep for golang.org/x/crypto/bcrypt

first round of comments

add tests, remove root addition (will be added back as part of creation)

Add security checks for /v2/machines and /v2/keys

Allow non-root to determine if security is enabled, get machine list.

Responding to comments, remove multiple verbs (like /v2/security/user/foo/password)

add some prefixes to the logging
2015-03-16 16:23:11 -04:00
f8aaa6a161 Merge pull request #2510 from xiang90/tester-rp
tools/functional-tester/etcd-tester: report agent status
2015-03-14 10:09:52 -07:00
9c74f98b97 Merge pull request #2502 from kelseyhightower/trusted-ca-and-client-auth
etcd: server SSL and client cert auth configuration is more explicit
2015-03-14 09:40:53 -07:00
6b1eb296e0 Merge pull request #2509 from yichengq/341
docs: add branch management
2015-03-13 15:35:06 -07:00
45d790c345 docs: add branch management 2015-03-13 15:33:59 -07:00
46ebb83b90 tools/functional-tester/etcd-tester: report agent status 2015-03-13 15:29:57 -07:00
1f470fd1c6 Merge pull request #2507 from xiang90/agent-log
tools/funcational-tester/etcd-agent: log the error for dubgging
2015-03-13 13:28:41 -07:00
83bb02e320 tools/funcational-tester/etcd-agent: log the error for dubgging 2015-03-13 12:08:08 -07:00
a9ecf0caff Merge pull request #2498 from xiang90/agent-status
tools/functional-tester/etcd-agent: add status rpc
2015-03-13 10:56:02 -07:00
e46beb75c8 tools/functional-tester/etcd-agent: add status rpc 2015-03-13 10:48:06 -07:00
8dd8b1cdc2 etcd: server SSL and client cert auth configuration is more explicit
etcd does not provide enough flexibility to configure server SSL and
client authentication separately. When configuring server SSL the
`--ca-file` flag is required to trust self-signed SSL certificates
used to service client requests.

The `--ca-file` has the side effect of enabling client cert
authentication. This can be surprising for those looking to simply
secure communication between an etcd server and client.

Resolve this issue by introducing four new flags:

    --client-cert-auth
    --peer-client-cert-auth
    --trusted-ca-file
    --peer-trusted-ca-file

These new flags will allow etcd to support a more explicit SSL
configuration for both etcd clients and peers.

Example usage:

Start etcd with server SSL and no client cert authentication:

    etcd -name etcd0 \
    --advertise-client-urls https://etcd0.example.com:2379 \
    --cert-file etcd0.example.com.crt \
    --key-file etcd0.example.com.key \
    --trusted-ca-file ca.crt

Start etcd with server SSL and enable client cert authentication:

    etcd -name etcd0 \
    --advertise-client-urls https://etcd0.example.com:2379 \
    --cert-file etcd0.example.com.crt \
    --key-file etcd0.example.com.key \
    --trusted-ca-file ca.crt \
    --client-cert-auth

Start etcd with server SSL and client cert authentication for both
peer and client endpoints:

    etcd -name etcd0 \
    --advertise-client-urls https://etcd0.example.com:2379 \
    --cert-file etcd0.example.com.crt \
    --key-file etcd0.example.com.key \
    --trusted-ca-file ca.crt \
    --client-cert-auth \
    --peer-cert-file etcd0.example.com.crt \
    --peer-key-file etcd0.example.com.key \
    --peer-trusted-ca-file ca.crt \
    --peer-client-cert-auth

This change is backwards compatible with etcd versions 2.0.0+. The
current behavior of the `--ca-file` flag is preserved.

Fixes #2499.
2015-03-12 23:09:54 -07:00
b53bfd2b40 docs/security: fix peer TLS communication example 2015-03-12 22:40:39 -07:00
862c16e821 Merge pull request #2500 from xiang90/fix-panic
etcdmain: verify heartbeat and election flag
2015-03-12 18:06:38 -07:00
ed8c3534e9 etcdmain: verify heartbeat and election flag 2015-03-12 17:45:49 -07:00
38df712777 Merge pull request #2496 from bdarnell/patch-2
raft: correctly pass arguments to Logger.Panicf()
2015-03-12 14:39:17 -07:00
5e19adcf70 raft: correctly pass arguments to Logger.Panicf() 2015-03-12 16:15:43 -04:00
6103a05ed1 Merge pull request #2495 from yichengq/337
rafthttp: report snapshot failure when dropping MsgSnap
2015-03-12 13:10:00 -07:00
d9cb77aad5 rafthttp: report snapshot failure when dropping MsgSnap 2015-03-12 13:06:43 -07:00
f9ee8ecb3a Merge pull request #2478 from kmeaw/master
Support IPv6 address for ETCD_ADDR and ETCD_PEER_ADDR
2015-03-12 13:04:32 -07:00
d537ef3de9 Merge pull request #2494 from xiang90/ft
tools/functional-tester: add http status reporter
2015-03-12 12:50:13 -07:00
462f32a81b tools/functional-tester: add http status reporter 2015-03-12 12:49:48 -07:00
ab20a5e12d Merge pull request #2491 from endocode/iaguis/fix-test
rafttest: fix build error
2015-03-12 08:02:30 -07:00
e698192e4a rafttest: fix build error
raftLogger is not exported so we can't access it from here. Go back to
using log.
2015-03-12 11:47:13 +01:00
00a22891ee pkg/flags: Add support for IPv6 addresses
Support IPv6 address for ETCD_ADDR and ETCD_PEER_ADDR

pkg/flags: Support IPv6 address for ETCD_ADDR and ETCD_PEER_ADDR

pkg/flags: tests for IPv6 addr and bind-addr flags

pkg/flags: IPAddressPort.Host: do not enclose IPv6 address in square brackets

pkg/flags: set default bind address to [::] instead of 0.0.0.0

pkg/flags: we don't need fmt any more

also, one minor fix: net.JoinHostPort takes string as a port value

pkg/flags: fix ipv6 tests

pkg/flags: test both IPv4 and IPv6 addresses in TestIPAddressPortString

etcdmain: test: use [::] instead of 0.0.0.0
2015-03-12 11:30:53 +03:00
32105e6ed0 Merge pull request #2484 from yichengq/336
rafthttp: drop messages in channel when disconnection
2015-03-11 14:55:10 -07:00
e41cbeda5d rafthttp: drop messages in channel when disconnection
The messages in channel are outdated, and there is no need to send
them in the future. It also reports unreachable if there are messages
in the channel.
2015-03-11 14:42:06 -07:00
62a7e2f41f Merge pull request #2483 from yichengq/335
rafthttp: report unreachable when dropping messages
2015-03-11 14:41:15 -07:00
39731724ff Merge pull request #2485 from yichengq/337
raft: fall back to bad path when unreachable
2015-03-11 14:16:39 -07:00
a230003255 rafthttp: report unreachable when dropping messages 2015-03-11 14:11:41 -07:00
be0bf2a2bd raft: fall back to bad path when unreachable 2015-03-11 13:21:23 -07:00
2ca981d8cb Merge pull request #2482 from xiang90/fix-raft
raft: reply with the commit index when receives a smaller append message
2015-03-11 10:34:25 -07:00
c643967a41 raft: reply with the commit index when receives a smaller append message
Follower should not reject the append message with a smaller index than its commit
index. Or it will trigger the leader's resending logic, which might have a high cost.
2015-03-10 22:32:36 -07:00
b1ff6ddd88 Merge pull request #2446 from xiang90/apply-routine
etcdserver: separate apply and raft routine
2015-03-10 18:40:52 -07:00
d015610da5 etcdserver: separate apply and raft routine 2015-03-10 13:34:24 -07:00
9a9d00b482 Merge pull request #2453 from yichengq/334
tools/etcd-tester: add kill one member tests
2015-03-10 13:17:57 -07:00
24a210ab20 tools/etcd-tester: add kill one member tests 2015-03-10 11:38:54 -07:00
83496c3966 Merge pull request #2474 from xiang90/fix-wal
wal: fix ReleaseLockTo
2015-03-09 20:12:24 -07:00
b66eb3d81c wal: fix ReleaseLockTo
ReleaseLockTo should not release the lock on the WAL
segment that is right before the given index. When
restarting etcd, etcd needs to read from the WAL segment
that has a smaller index than the snapshot index.

The correct behavior is that ReleaseLockTo releases
the locks w is holding so that w only holds one lock
that has an index smaller than the given index.
2015-03-09 19:52:54 -07:00
4e525e63a4 Merge pull request #2459 from yichengq/335
rafthttp: use dedicated go-routine for MsgProp process
2015-03-09 14:17:28 -07:00
51397a6423 rafthttp: use go-routine for MsgProp processing
MsgProp process is blocking when there is no leader, which blocks the peer
loop totally.
2015-03-09 14:11:16 -07:00
a2be25cba4 Merge pull request #2460 from xiang90/raft-logger
raft: introduce logger interface
2015-03-09 08:00:21 -07:00
97579e2e1d raft: introduce logger interface 2015-03-08 21:36:32 -07:00
17ba06b5cd Merge pull request #2461 from xiang90/fix-raft
raft: do not reset vote if term is not changed
2015-03-08 11:39:35 -07:00
7fe608532a raft: do not reset vote if term is not changed
raft MUST keep the voting information for the same term. reset
should not reset vote if term is not changed.
2015-03-07 22:31:20 -08:00
b374f93bb8 Merge pull request #2456 from xiang90/tls
pkg/transport: fix downgrade https to http bug in transport
2015-03-06 11:39:44 -08:00
3c9581adde pkg/transport: fix downgrade https to http bug in transport
If the TLS config is empty, etcd downgrades https to http without a warning.
This commit avoid the downgrade and stoping etcd from bootstrap if it cannot
listen on TLS.
2015-03-06 10:42:23 -08:00
964c61916d Merge pull request #2455 from kelseyhightower/add-benchmarks
Documentation: add initial benchmarks
2015-03-06 09:34:05 -08:00
4a38788b2f Documentation: add initial benchmarks 2015-03-06 09:32:24 -08:00
ba20016f0f tools/etcd-tester: reorganize failures 2015-03-05 21:14:41 -08:00
daea484a9f Merge pull request #2451 from xiang90/fix_wal
wal: do not race reader and writer
2015-03-05 20:57:25 -08:00
ab72c3ec88 wal: do not race reader and writer 2015-03-05 20:19:17 -08:00
eba6daef4b Merge pull request #2450 from yichengq/335
tools/functional-tester: add cleanup rpc
2015-03-05 16:36:16 -08:00
181ee445c1 better dir name 2015-03-05 16:34:14 -08:00
b96ecfcc07 Merge pull request #2448 from yichengq/334
tools/etcd-tester: add kill majority test
2015-03-05 15:59:34 -08:00
8e76ccf979 Merge pull request #2439 from xiang90/metrics
Metrics
2015-03-05 15:55:34 -08:00
2152447361 tools/functional-tester: add cleanup rpc 2015-03-05 15:55:28 -08:00
4314b19a2e tools/etcd-agent: recycle etcd zombie when termination 2015-03-05 15:51:11 -08:00
267313a3f8 tools/etcd-tester: add kill majority test 2015-03-05 15:14:14 -08:00
8b770f8a1a Merge pull request #2447 from yichengq/334
etcd-tester: initial stresser
2015-03-05 13:33:51 -08:00
3cffc910de tools/etcd-tester: use stresser 2015-03-05 13:21:49 -08:00
eec52738d8 etcd-tester: initial stresser 2015-03-05 11:06:43 -08:00
0a04eec481 Merge pull request #2441 from yichengq/334
tools/functional-tester: make it work basically
2015-03-05 10:30:38 -08:00
d5957aebfd tools/etcd-tester: add failure killall 2015-03-05 10:24:21 -08:00
530dd891be tools/etcd-tester: make it work
1. add cluster support
2. add failureNo case
3. add main func
2015-03-05 10:24:21 -08:00
8d3d737993 tools/etcd-agent/client: fix rpc Dial 2015-03-05 10:24:21 -08:00
061baad611 tools/etcd-agent: write etcd log into log file 2015-03-05 10:24:13 -08:00
0ab24d4606 Merge pull request #2444 from bdarnell/multinode-report
Add ReportUnreachable and ReportSnapshot to MultiNode.
2015-03-05 10:05:15 -08:00
725c411346 Add ReportUnreachable and ReportSnapshot to MultiNode.
Add ReportSnapshot requirement to doc.go.
2015-03-05 12:39:52 -05:00
6b9b695167 Merge pull request #2435 from bdarnell/multinode
raft: Introduce MultiNode.
2015-03-04 21:27:20 -08:00
008bbd2b84 tools/etcd-agent: log rpc actions 2015-03-04 18:29:23 -08:00
9e69aba7aa tools/etcd-agent: add main func 2015-03-04 17:22:56 -08:00
a32abdbb0f rafthttp: make metrics naming consistent 2015-03-04 16:12:53 -08:00
ab33c068b7 rafthttp: record the number of failed messages 2015-03-04 16:09:50 -08:00
c2d4d8c64e Merge pull request #2415 from yichengq/333
rafthttp: support multiple peer urls
2015-03-04 16:00:25 -08:00
933ab1e4f7 rafthttp: peer.newURLc -> peer.newURLsC 2015-03-04 15:00:47 -08:00
0fe9861197 rafthttp: support multiple peer urls 2015-03-04 15:00:07 -08:00
c3f32504ec Merge pull request #2431 from bdarnell/raft-docs
raft: Expand doc.go
2015-03-04 13:29:35 -08:00
c824c867ec raft: more doc updates.
Including parallelism of persist and send, cancellation of
ConfChanges, and the risks of two-node clusters.
2015-03-04 15:48:35 -05:00
4e74d81bbb raft: Introduce MultiNode.
MultiNode is an alternative to raft.Node that is more efficient
when a node may participate in many consensus groups. It is currently
used in the CockroachDB project; this commit merges the
github.com/cockroachdb/etcd fork back into the mainline.
2015-03-04 15:30:21 -05:00
ecf9d1232d Merge pull request #2433 from xiang90/metrics
rafthttp: add metrics for sending message
2015-03-04 11:29:25 -08:00
17aa3cf7db rafthttp: add metrics for sending message 2015-03-04 11:18:16 -08:00
80146e2ccf Merge pull request #2427 from xiang90/etcd-smoketest
tools/functional-tester: inital commit
2015-03-04 10:30:49 -08:00
ebf253bad9 Merge pull request #20 from yichengq/etcd-smoketest
etcd-tester: fix build
2015-03-04 10:30:36 -08:00
30e6d49bec etcd-tester: fix build 2015-03-04 10:22:53 -08:00
250970cc23 raft: Expand doc.go
Includes more details on the required caller behavior and the safety of
membership changes.

Closes #2397
2015-03-04 13:18:02 -05:00
c7146bd5f2 Merge pull request #2421 from xiang90/cleanup-rafthttp
Cleanup rafthttp
2015-03-03 22:35:01 -08:00
44e53953c9 rafthttp: add comments for Transporter interface 2015-03-03 22:34:47 -08:00
2bfd266a81 tools/functional-tester: inital commit 2015-03-03 20:12:20 -08:00
559466e996 Merge pull request #2422 from xiang90/fix_etcdctl
etcdctl: mark unstarted member
2015-03-03 11:13:39 -08:00
b218fc67e4 etcdctl: mark unstarted member 2015-03-03 11:00:40 -08:00
2558b1d31b Merge pull request #2420 from xiang90/kill-todo
rafthttp: kill connection timeout TODO
2015-03-03 10:15:27 -08:00
cb105c626c rafthttp: kill connection timeout TODO 2015-03-03 09:49:01 -08:00
3a132ad8ef Merge pull request #2413 from xiang90/refactor-peer
rafthttp: add comment for timeout
2015-03-03 06:40:24 -08:00
a3b3fc5e87 Merge pull request #2414 from xiang90/fix_max_host
pkg/transport: set the maxIdleConnsPerHost to -1
2015-03-03 06:30:46 -08:00
b15806e189 etcdctl: update the ls subcommand help to match behavior
Currently the `etcdctl ls` subcommand help output is a bit misleading.
It mentions that using the `--recursive` flag will output all keys and
values for a given path:

    --recursive  returns all values for key and child keys

This is inaccurate. The `--recursive` will only output the key names
under the given path. Fix the issue by updating the help string for
the `--recursive` flag.

    --recursive  returns all key names recursively for the given path

Fixes #2379.
2015-03-03 06:25:22 -08:00
1271b01069 Merge pull request #2406 from yichengq/333
rafthttp: add functional tests
2015-03-02 22:51:55 -08:00
e50d43fd32 pkg/transport: set the maxIdleConnsPerHost to -1
for transport that are using timeout connections, we set the
maxIdleConnsPerHost to -1. The default transport does not clear
the timeout for the connections it sets to be idle. So the connections
with timeout cannot be reused.
2015-03-02 21:52:03 -08:00
115b045505 rafthttp: add comment for timeout 2015-03-02 16:52:19 -08:00
24fbad7bd8 Merge pull request #2412 from xiang90/refactor-peer
rafhttp: refactor peer.go
2015-03-02 16:24:35 -08:00
88bde91716 rafhttp: refactor func peer.pick in peer.go 2015-03-02 15:17:14 -08:00
81c67eed9c rafthttp: add functional tests 2015-03-02 14:22:20 -08:00
4dd3be0f05 Merge pull request #2401 from yichengq/331
rafthttp: add unit tests and SendMsgApp benchmark
2015-03-02 13:55:16 -08:00
fc2d7019e5 rafthttp: {nopProcessor, errProcessor} -> fakeRaft 2015-03-02 13:31:56 -08:00
ee8325d62c test: not run race test on rafthttp pkg 2015-03-02 13:30:34 -08:00
f59b60671e rafthttp: add peer tests 2015-03-02 13:30:30 -08:00
45d6b76eea rafthttp: add stream tests 2015-03-02 13:29:05 -08:00
8ec28f27d1 rafthttp: streamReader roundtrip -> dial 2015-03-02 13:26:48 -08:00
a299f68e09 rafthttp: add transport benchmark test 2015-03-02 13:25:32 -08:00
9d445d2fcf rafthttp: add transport tests 2015-03-02 13:25:30 -08:00
399e3cdf81 rafthttp: add stream http tests 2015-03-02 13:24:50 -08:00
31666cdbff Merge pull request #2408 from yichengq/335
rafthttp: report MsgSnap status
2015-03-02 09:43:08 -08:00
b4b9b9118a rafthttp: report MsgSnap status 2015-03-02 09:38:11 -08:00
78aa251ab2 rafthttp: only use pipeline to send MsgSnap
The size of MsgSnap may be very big, e.g., 1G.
If its size is big and general streaming is used to send it, it may block
the following messages for several ten seconds, which interrupts the
heartbeat heavily.
Only use pipeline to send MsgSnap.
2015-03-02 09:35:54 -08:00
9989bf1d36 Merge pull request #2407 from yichengq/334
rafthttp: report unreachable status of the peer
2015-03-02 09:35:35 -08:00
dcd125e7a6 Merge pull request #2382 from philips/add-faq
Documentation: add implementation faq
2015-03-01 20:24:50 -08:00
9b986fb4c1 rafthttp: report unreachable status of the peer
When it failed to send message to the remote peer, it reports unreachable
to raft.
2015-03-01 16:48:26 -08:00
09f181f585 raft: log unreachable remote node 2015-03-01 16:47:49 -08:00
dfa625407f Merge pull request #2400 from xiang90/rm_acl
acl: remove acl pkg
2015-03-01 15:28:58 -08:00
199c1eaab6 Merge pull request #2403 from xiang90/keep_entries
etcdserver: keep a min number of entries in memory
2015-03-01 10:18:21 -08:00
428b77afc3 etcdserver: keep a min number of entries in memory
Do not aggressively compact raft log entries. After a snapshot,
etcd server can compact the raft log upto snapshot index. etcd server
compacts to an index smaller than snapshot to keep some entries in memory.
The leader can still read out the in memory entries to send to a slightly
slow follower. If all the entries are compacted, the leader will send the
whole snapshot or read entries from disk if possible.
2015-03-01 10:12:13 -08:00
a4018f25c9 Merge pull request #2405 from mikael84/patch-1
Documentation: fix "Missing infra1="
2015-02-28 21:48:01 -08:00
22c8d781ef Documentation: fix "Missing infra1="
Documentation: fix "Missing infra1="
2015-03-01 09:44:25 +04:00
6d81009b26 acl: remove acl pkg 2015-02-28 15:02:47 -08:00
fbd5c81139 raft: remove shadowing of variables from test 2015-02-28 12:09:33 -08:00
d459ae0df3 store: remove unused ACL field 2015-02-28 11:46:21 -08:00
a4dab7ad75 *: do not block etcdserver when encoding store into json
Encoding store into json snapshot has quite high CPU cost. And it
will block for a while. This commit makes the encoding process non-
blocking by running it in another go-routine.
2015-02-28 11:41:58 -08:00
9b4d52ee73 raft: do not resend snapshot if not necessary
raft relies on the link layer to report the status of the sent snapshot.
If the snapshot is still sending, the replication to that remote peer will
be paused. If the snapshot finish sending, the replication will begin
optimistically after electionTimeout. If the snapshot fails, raft will
try to resend it.
2015-02-28 11:41:58 -08:00
2185ac5ac8 raft: cleanup unreachable 2015-02-28 11:35:16 -08:00
eeaf12beb1 rafthttp: use /raft/stream for MsgApp stream
New rafthttp uses /raft/stream/msgapp for MsgApp stream, but v2.0 rafthttp
cannot understand it. Use the old endpoint /raft/stream instead for backward
compatibility, and plan to move to new endpoint in the version after the
next one.
2015-02-28 11:35:16 -08:00
758ff26dd8 rafthttp: add copyright header 2015-02-28 11:35:16 -08:00
1fdbbb959f rafthttp: add util, msgapp, message test 2015-02-28 11:35:16 -08:00
dee3001086 rafthttp: add back tests that commentted out 2015-02-28 11:35:16 -08:00
87e3de8b8b integration: fix decrease cluster tests 2015-02-28 11:35:16 -08:00
1c5a507761 rafthttp: refactor peer and add general stream 2015-02-28 11:35:16 -08:00
2c94e2d771 *: make dial timeout configurable
Dial timeout is set shorter because
1. etcd is supposed to work in good environment, and the new value is long
enough
2. shorter dial timeout makes dial fail faster, which is good for
performance
2015-02-28 11:18:59 -08:00
55cd03ff4b rafthttp: add run loop for peer 2015-02-28 11:18:59 -08:00
86429264fb wal: support auto-cut in wal
WAL should control the cut logic itself. We want to do falloc to
per allocate the space for a segmented wal file at the beginning
and cut it when it size reaches the limit.
2015-02-28 11:18:59 -08:00
c3d3ad931b snap: add save latency metrics 2015-02-28 11:16:42 -08:00
95bba154d6 etcdserver: add propose summary 2015-02-28 11:16:42 -08:00
83c953b153 etcdhttp: move /stats to /debug/vars 2015-02-28 11:16:42 -08:00
a776064a8b etcdmain: fix godeps on osx 2015-02-28 11:16:41 -08:00
7bf615aee0 *: drop old metrics pkg 2015-02-28 11:16:41 -08:00
84485643fe *: expose wal metrics at /metrics 2015-02-28 11:06:11 -08:00
fb1a28c65d *: vendor prometheus 2015-02-28 11:06:11 -08:00
d8a9e11e22 rafthttp: extract pipeline from peer 2015-02-28 11:06:11 -08:00
2af33fd494 raft: add reportUnreachable 2015-02-28 10:45:22 -08:00
ba7215d7a8 acl: initial interface 2015-02-28 10:45:22 -08:00
9fe78c8bc4 client: don't use nested actions 2015-02-28 10:45:21 -08:00
25cf916a80 client: ensure Response closed on cancel 2015-02-28 10:45:21 -08:00
b41d6bc416 client: set hard limit on redirect checks 2015-02-28 10:45:21 -08:00
50a9b2d9c8 client: rm naked return from httpClusterClient.Do 2015-02-28 10:45:21 -08:00
99aa0e1fcc client: test httpClusterClient.reset failure cases 2015-02-28 10:45:21 -08:00
ed173a2a76 client: fix bad URL fixture 2015-02-28 10:45:21 -08:00
cd777b2966 client: test httpClusterClient.Sync 2015-02-28 10:45:21 -08:00
ae062a0825 client: move lock so MembersAPI.List doesn't deadlock 2015-02-28 10:45:21 -08:00
83930ac113 client: test DefaultCheckRedirect 2015-02-28 10:45:21 -08:00
943c7ef307 client: test httpKeysAPI's Create and Update methods 2015-02-28 10:45:21 -08:00
115e758c32 client: test httpKeysAPI.Delete 2015-02-28 10:45:21 -08:00
ece03fb987 client: drop unnecessary field deleteAction.Value 2015-02-28 10:45:21 -08:00
6fc209e574 client: test httpKeysAPI.Get 2015-02-28 10:45:21 -08:00
32bfcca5a8 client: test httpKeysAPI.Set 2015-02-28 10:45:20 -08:00
14b3f96091 client: test httpKeysAPI.Watcher 2015-02-28 10:45:20 -08:00
cd85451971 client: clarify relationship of AfterIndex and waitIndex 2015-02-28 10:45:20 -08:00
09017af35e client: test httpWatcher 2015-02-28 10:38:47 -08:00
11a6cb68a6 client: test unmarshaling of failure responses 2015-02-28 10:38:47 -08:00
9378413283 client: exhaustive member-related testing 2015-02-28 10:38:47 -08:00
32ff3ce26f client: test for non-integer X-Etcd-Index 2015-02-28 10:38:47 -08:00
8a6b72b08d client: tweak test fields 2015-02-28 10:38:47 -08:00
b174732812 client: introduce Error type 2015-02-28 10:38:47 -08:00
8fdc6b154e client: document PrevExistType 2015-02-28 10:38:47 -08:00
39b5b083c0 client: document Member fields 2015-02-28 10:38:47 -08:00
27de5eec76 client: document Response and Node structs 2015-02-28 10:38:47 -08:00
4a77760f56 client: break dependency on httptypes pkg 2015-02-28 10:38:46 -08:00
9b334e07a6 client: allow caller to decide HTTP redirect policy 2015-02-28 10:38:46 -08:00
1c03df62a5 client: WaitIndex -> AfterIndex 2015-02-28 10:38:46 -08:00
a834f297f9 client: document KeysAPI methods 2015-02-28 10:22:52 -08:00
2b5589ddcd client: encourage error handling in package doc 2015-02-28 10:22:52 -08:00
6fd105d554 client: document using a custom context 2015-02-28 10:22:52 -08:00
479a17dcbf client: add GetOptions.Sort 2015-02-28 10:22:52 -08:00
84ede6fbec client: use options struct for KeysAPI.Get 2015-02-28 10:22:52 -08:00
8621caf3e2 client: define a DefaultTransport 2015-02-28 10:22:52 -08:00
ce4486ff85 client: document Client methods 2015-02-28 10:22:52 -08:00
1773d0a18b client: simplify CancelableTransport doc 2015-02-28 10:22:52 -08:00
19dd4a0f3c client: document Config 2015-02-28 10:22:52 -08:00
6d82472275 client: move http.go into client.go 2015-02-28 10:22:52 -08:00
bfbf672ce4 client: document MembersAPI methods 2015-02-28 10:22:52 -08:00
7255fb1b62 client: alias etcdserver/etcdhttp/httptypes.Member 2015-02-28 10:22:52 -08:00
932351a00d client: document Watcher.Next 2015-02-28 10:22:52 -08:00
aee95468ba client: document MembersAPI/KeysAPI constructors 2015-02-28 10:22:51 -08:00
e885c6c5f4 client: document *Options 2015-02-28 10:22:51 -08:00
88cea415a7 client: NewDiscoveryKeysAPI -> NewKeysAPIWithPrefix 2015-02-28 10:22:51 -08:00
89070fd237 client: package-level doc 2015-02-28 10:22:51 -08:00
3d4e1f59dc client: drop unnecessary Nodes type 2015-02-28 10:22:51 -08:00
7ff84351f5 client: centralize exported variables 2015-02-28 10:22:51 -08:00
a9f605e5fe client: unexport defaultV2MembersPrefix 2015-02-28 10:22:51 -08:00
bb9f016b91 client: unexport defaultV2KeysPrefix 2015-02-28 10:22:51 -08:00
3fdda06602 client: s/SyncableHTTPClient/Client/g 2015-02-28 10:22:51 -08:00
bac1d2f420 client: unexport httpClient interface 2015-02-28 10:22:51 -08:00
52288fa748 client: remove CancelableTransport arg from httpClientFactory 2015-02-28 10:22:51 -08:00
3b41b77cd7 client: ClientConfig -> Config 2015-02-28 10:22:51 -08:00
2aecbaf165 client: unexport httpAction 2015-02-28 10:22:51 -08:00
3f5e827e3c client: httpClient -> simpleHTTPClient 2015-02-28 10:22:51 -08:00
f037cb9f65 client: collapse unnecessary constructor 2015-02-28 10:22:50 -08:00
62054dfb5e client: don't cache httpClients in httpClusterClient 2015-02-28 10:22:50 -08:00
99d63eb62e client: protect httpClusterClient with RWMutex 2015-02-28 10:22:50 -08:00
0943831b8e client: establish httpClusterClient.reset 2015-02-28 10:22:50 -08:00
74fe28c5e0 client: exchange ClientConfig for SyncableHTTPClient 2015-02-28 10:22:50 -08:00
942f0f6b9e client: accept TTL through KeysAPI.Set 2015-02-28 10:22:50 -08:00
3d53e9bfaa client: pass around options as pointers 2015-02-28 10:22:50 -08:00
0a7e0875d5 client: copy DeleteOptions onto deleteAction 2015-02-28 10:19:05 -08:00
025ee0379c client: copy SetOptions onto setAction 2015-02-28 10:19:05 -08:00
01fc01ec69 client: KeysAPI.[R]Watch -> Watcher w/ opts struct 2015-02-28 10:19:04 -08:00
bc32060b1d client: support PrevIndex in SetOptions & DeleteOptions 2015-02-28 10:14:25 -08:00
7ccf5eb476 client: support PrevValue in SetOptions & DeleteOptions 2015-02-28 10:14:25 -08:00
0f31f403d1 client: add KeysAPI.Delete 2015-02-28 10:14:25 -08:00
2f479c8721 client: assert method in tests 2015-02-28 10:14:25 -08:00
84e495e51e client: s/assertResponse/assertRequest/ 2015-02-28 10:14:25 -08:00
6e637f2f75 client: add KeysAPI.Set 2015-02-28 10:14:25 -08:00
8b3d05f661 client: add KeysAPI.RGet 2015-02-28 10:14:25 -08:00
6d89e6217d client: rename KeysAPI.RecursiveWatch to RWatch 2015-02-28 10:14:25 -08:00
4e5c015fe9 client: add Update method 2015-02-28 10:14:25 -08:00
c6d955f4c1 client: drive Create with setAction; drop TTL 2015-02-28 10:12:35 -08:00
99840c9697 *: cleanup import 2015-02-28 10:12:35 -08:00
9e63b1fb63 wal: record metrics 2015-02-28 10:12:35 -08:00
2e078582f9 etcdmain: expose runtime metrics 2015-02-28 10:11:53 -08:00
9b6fcfffb6 *: replace our own metrics with codahale/metrics 2015-02-28 10:11:53 -08:00
33afbfead6 etcdserver: remove the dep on metrics. first step towards removing metrics pkg from etcd. 2015-02-28 10:09:55 -08:00
feaabde125 Godeps: bump golang.org/x/net/context to b8c11bbe 2015-02-28 10:09:55 -08:00
cbef6ab152 raft: clean up storage 2015-02-28 10:09:07 -08:00
8fb6eb6c70 Update libraries-and-tools.md
Added a distributed r/w lock in addition to the master election implementation.
2015-02-28 10:09:07 -08:00
5ede18be74 raft: separate compact and createsnap in memory storage 2015-02-28 10:08:30 -08:00
cea3448438 *: bump to v2.0.4+git 2015-02-27 12:25:50 -08:00
1a2c6d3f2f *: bump to v2.0.4 2015-02-26 22:01:24 -08:00
53fda9d558 Documentation: add implementation faq
Add some notes on the design discussion around the `--initial` flags. If
anything is wrong let me know.
2015-02-26 09:52:45 -08:00
ecf7c27697 Merge pull request #2374 from wellbehavedsoftware/fix-2373
etcdtcl: fix etcdctl cluster-health ignores SSL settings
2015-02-25 07:44:10 -08:00
05ecdbc617 etcdtcl: fix etcdctl cluster-health ignores SSL settings
etcdctl reconnects to the leader, but was not picking up ssl settings in this
case, which causes it to show unhealthy when this is not the case.

Fixes #2373
2015-02-25 13:19:07 +01:00
6648b7e302 Merge pull request #2363 from yichengq/329
migrate/starter: fix v2 data dir checking
2015-02-24 22:44:10 -08:00
194105e02c Merge pull request #2369 from jonsyu1/master
Documentation fixes for proxy
2015-02-24 21:39:20 -08:00
31bfffaa48 Documentation: standardize on url over URL
url and URL both appear in this doc. Choose url due to higher frequency
2015-02-24 16:26:27 -05:00
1fbaf9dbb7 Documentation: fix discovery flag for proxy docs
It seems that the -discovery flag used to be -discovery-url. Updated this to use
the currently documented and supported -discovery flag.
2015-02-24 16:25:18 -05:00
3fd9136740 migrate/starter: fix v2 data dir checking 2015-02-24 11:47:56 -08:00
a560c52815 Merge pull request #2354 from xiang90/wait_time
pkg/wait: add WaitTime
2015-02-23 14:29:39 -08:00
53d20a8a29 pkg/wait: add WaitTime
WaitTime waits on deadline instead of id.
2015-02-23 14:26:42 -08:00
4b72095bd3 Merge pull request #2350 from jonsyu1/master
Fixed sample command flags in proxy docs
2015-02-23 09:19:15 -08:00
28e150e50e Documentation: fix sample command flags for proxy
The docs mention the listen-client-urls flag, but the examples use
client-listen-urls, which is an invalid flag.
2015-02-23 11:15:42 -05:00
4d0472029a Merge pull request #2348 from yichengq/326
etcdserver: fix cluster fallback recovery
2015-02-21 12:16:08 -08:00
e54fdfd9cc Merge pull request #2349 from yichengq/327
rafthttp: fix panic on receiving empty ents
2015-02-20 15:15:43 -08:00
ca390560f9 rafthttp: fix panic on receiving empty ents
2.0 rc may send empty ents. Fix it for backward compatibility.
2015-02-20 15:07:27 -08:00
cff005777a etcdserver: fix cluster fallback recovery
Cluster and transport may recover to old states when new node joins
the cluster. Record cluster last modified index to avoid this.
2015-02-20 14:30:00 -08:00
d57e07dcde Merge pull request #2347 from bdarnell/fix-nyet-test
Fix test for existence of go-nyet.
2015-02-20 14:07:55 -05:00
79bc3f4774 Fix test for existence of go-nyet.
When the file is not found, `which` returns an empty string,
which passes the -f test. `command -v` is the most portable alternative
to `which` per
http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212
2015-02-20 14:02:43 -05:00
d2b0dd2419 Merge pull request #2345 from bdarnell/normal-entry-formatter
Only use the EntryFormatter for normal entries.
2015-02-20 11:00:12 -08:00
b53dc0826e Only use the EntryFormatter for normal entries.
ConfChange entries also have a Data field but the application-supplied
formatter won't know what to do with them.
2015-02-20 13:51:14 -05:00
0ea2173a7e Merge pull request #2343 from xiang90/fix_kill
osutil: pid 1 should exit directly instead of trying to kill itself
2015-02-20 09:01:49 -08:00
7ae94f2bf0 osutil: pid 1 should exit directly instead of trying to kill itself 2015-02-19 20:27:50 -08:00
4228c703a7 Merge pull request #2341 from yichengq/326
migrate/starter: fix flag parsing
2015-02-19 11:02:07 -08:00
10629c40e1 migrate/starter: fix flag parsing 2015-02-18 23:47:52 -08:00
e2928cd97a Merge pull request #2242 from barakmich/acl_doc
docs: Add v2 ACL RFC
2015-02-18 23:31:26 -08:00
40365c4f8d docs: add Security RFC
docs: Add v2 ACL RFC

Add workflow, fix terminology, make the API JSON, and general cleanup

fixes from xiang90s comments

add permissions struct

update regarding glob matches

rename file
2015-02-18 14:34:00 -05:00
88994f9ec8 Merge pull request #2335 from xiang90/dump-tool
tool: dump tool supports index
2015-02-18 09:35:49 -08:00
d6f8a30f7c tool: dump tool supports index 2015-02-18 09:13:47 -08:00
7c65857283 Merge pull request #2327 from barakmich/remove_shadowing
*: remove shadowing of variables from etcd and add travis test
2015-02-17 17:46:41 -05:00
92dca0af0f *: remove shadowing of variables from etcd and add travis test
We've been bitten by this enough times that I wrote a tool so that
it never happens again.
2015-02-17 16:31:42 -05:00
0a5707420b Merge pull request #2326 from yichengq/325
migrate/functional: fix `go build` failure
2015-02-17 10:46:39 -08:00
90b06f874d migrate/functional: fix go build failure 2015-02-17 10:35:30 -08:00
66199afb25 Merge pull request #2322 from kelseyhightower/add-etcd-docker-guide
doc: add etcd docker guide
2015-02-16 12:43:17 -08:00
217a1f0730 doc: add etcd docker guide
Fixes #2253
2015-02-16 11:44:41 -08:00
def62071f0 Merge pull request #2320 from xiang90/fix_error
etcdserver: fix error message when valide the discovery cluster
2015-02-16 09:53:24 -08:00
beb44ef6ba etcdserver: fix error message when valide the discovery cluster 2015-02-16 09:53:01 -08:00
d1ed54b734 Merge pull request #2317 from zhangbaitong/master
docs:small fix
2015-02-16 08:28:37 -08:00
518eb9fa2f docs:small fix
Signed-off-by: zhangbaitong <zhangbaitong@163.com>
2015-02-16 17:54:24 +08:00
73e67628d9 Merge pull request #2313 from xiang90/cluster_mu
etcdserver: move the mutex before what it guards
2015-02-14 23:05:53 -08:00
04bd06d20b etcdserver: move the mutex before what it guards 2015-02-14 22:26:12 -08:00
29f05bb217 Merge pull request #2307 from xiang90/refactor_cluster
etcdserver: getOtherPeerURLs -> getRemotePeerURLs
2015-02-14 20:59:38 -08:00
c5ca1218f3 etcdserver: GetClusterFromPeers -> GetClusterFromRemotePeers 2015-02-13 19:05:29 -08:00
f7540912d6 etcdserver: getOtherPeerURLs -> getRemotePeerURLs 2015-02-13 18:56:45 -08:00
0fcbadc10b Merge pull request #2305 from xiang90/fix_win
osutil: fix win build
2015-02-13 16:39:07 -08:00
e44dc0f3fe osutil: fix win build 2015-02-13 16:33:39 -08:00
4d728cc8c4 *: bump to v2.0.3 2015-02-13 15:27:24 -08:00
f7998bb2db Merge pull request #2304 from xiang90/fix_discovery_validation
etcdserver: validate discovery cluster
2015-02-13 14:41:09 -08:00
cfa7ab6074 etcdserver: validate discovery cluster 2015-02-13 14:32:24 -08:00
b59390c9c3 Merge pull request #2293 from barakmich/etcd_underscore
migrate: stop deleting _etcd
2015-02-13 17:10:14 -05:00
fdebf2b109 fix parent references 2015-02-13 16:54:15 -05:00
e9f4be498d migrate: decrease memory usage (only duplicate machines) 2015-02-13 15:26:54 -05:00
6d9d7b4497 Merge pull request #2302 from xiang90/fix_travis
integration: wait for slow travis
2015-02-13 11:49:37 -08:00
163ea3f5c5 integration: wait for slow travis 2015-02-13 11:41:03 -08:00
ea1e54b2a1 Merge pull request #2291 from ArtfulCoder/master
Added go build flag '-installsuffix cgo' to create a static library for etcd and etcdctl
2015-02-13 11:23:03 -08:00
b31109cfd7 Merge pull request #2290 from xiang90/fix_transport
etcdserver: recover transport when recovering from a snapshot
2015-02-13 10:23:29 -08:00
7a909c3950 Merge pull request #2282 from matishsiao/patch-1
add etcd-console tool to tools list
2015-02-13 10:20:31 -08:00
c16cc3a6a3 etcdserver: recover transport when recovering from a snapshot 2015-02-13 10:16:28 -08:00
d7840b75c3 Merge pull request #2301 from xiang90/fix_snap
integration: fix test
2015-02-13 10:03:45 -08:00
aed2c82e44 integration: fix test 2015-02-13 10:02:42 -08:00
39ee85470f Merge pull request #2300 from xiang90/fix_snap
etcdserver: fix snapshot
2015-02-13 09:56:19 -08:00
fbc4c8efb5 etcdserver: fix snapshot 2015-02-13 09:54:25 -08:00
12999ba083 Merge pull request #2298 from barakmich/issue2295
etcdserver: Unmask the snapshotter. Fixes #2295
2015-02-13 09:38:58 -08:00
a0e3bc9cbd etcdserver: Unmask the snapshotter. Fixes #2295 2015-02-13 11:56:00 -05:00
b06e43b803 Merge pull request #2289 from fabxc/feature/graceful_shutdown
main: shutdown gracefully.
2015-02-13 07:34:07 -08:00
8bf795dc3c etcdmain/osutil: shutdown gracefully, interrupt handling
The functionality in pkg/osutil ensures that all interrupt handlers finish
and the process kills itself with the proper signal.
Test for interrupt handling added.
The server shutsdown gracefully by stopping on interrupt (Issue #2277.)
2015-02-13 10:28:53 +01:00
02c52f175f migrate: stop deleting etcd 2015-02-12 19:35:33 -05:00
daf1a913bb Merge pull request #2287 from Amit-PivotalLabs/master
rafthttp/transport.go: Fix nil pointer dereference in RemovePeer
2015-02-12 14:49:12 -08:00
317e57a8a8 rafthttp: Panic informatively when removing unknown peer ID 2015-02-12 14:43:44 -08:00
5c0d3889f8 Added go build flag '-installsuffix cgo' to create a static library. This is needed when go 1.4 is used to build. 2015-02-12 14:08:02 -08:00
a71184424a *: bump to v2.0.2+git 2015-02-12 11:41:48 -08:00
409daceb73 *: bump to v2.0.2 2015-02-12 11:14:50 -08:00
c6cc276ef0 Merge pull request #2286 from barakmich/fix_migrations
etcdserver: Canonicalize migrations
2015-02-12 12:53:33 -05:00
cd50f0e058 etcdserver: Create MemberDir() and base {Snap,WAL}Dir() thereon. Audit DataDir. 2015-02-12 12:45:19 -05:00
fade9b6065 etcdserver: Refactor 2.0.1 directory rename into a proper migration
fix all instances

fix detection test
2015-02-12 11:53:19 -05:00
590205b8c0 Merge pull request #2284 from xiang90/cleanup
Cleanup
2015-02-11 16:21:10 -08:00
163f0f09f6 etcdserver: cleanup cluster_util 2015-02-11 16:20:38 -08:00
20497f1f85 etcdserver: move remote cluster retrive to cluster_util.go 2015-02-11 14:03:14 -08:00
4a0887ef7a Merge pull request #2283 from xiang90/etcd-dump
etcd dump
2015-02-11 11:24:05 -08:00
161b1d2e2e tools: etcd-dump-logs tool support dump from a given snapshot file 2015-02-11 10:50:04 -08:00
71bed48916 snap: add Read function 2015-02-11 10:21:19 -08:00
fe1d9565c2 *: bump to 2.0.1 2015-02-10 20:19:35 -08:00
fd90ec6c26 add etcd-console tool to tools list
i add etcd-console tool to tools list for reference
2015-02-11 10:43:21 +08:00
a81e147d8f Merge pull request #2281 from robszumski/docs-migrate
docs: add diagram and restructure for clarity
2015-02-10 17:45:24 -08:00
24b953a55d docs: add diagram and restructure for clarity 2015-02-10 17:34:23 -08:00
54bef0d2cd Merge pull request #2233 from yichengq/315
docs: add allow_legacy_mode.md
2015-02-10 15:46:52 -08:00
d0677a24dd docs: add allow_legacy_mode.md 2015-02-10 15:46:26 -08:00
bdc8cc1f54 Merge pull request #2278 from xiang90/ctl
etcdctl: add default peerurl for upgrade subcmd
2015-02-10 15:35:04 -08:00
b036c384a5 Merge pull request #2280 from gabesullice/typo-fix
documentation: fix typo in Documentation/clustering.md
2015-02-10 15:24:17 -08:00
df2a689d1c documentation: fix typo in Documentation/clustering.md
just an extra space needed to be removed.

Fixes #2279
2015-02-10 16:18:51 -07:00
f97a263a95 etcdctl: add default peerurl for upgrade subcmd 2015-02-10 15:13:12 -08:00
96ea0ff45c Merge pull request #2274 from xiang90/fix_stats
rafthttp: remove follower from leaderstats when it is removed from the c...
2015-02-10 11:27:29 -08:00
58112c4d2d rafthttp: remove follower from leaderstats when it is removed from the cluster 2015-02-10 11:22:33 -08:00
d74e74d320 Merge pull request #2261 from yichengq/322
migrate: fix setting commit index from snapshot
2015-02-10 09:57:24 -08:00
9834875d35 Merge pull request #2271 from yichengq/323
etcdmain: infer bind addr from addr in v1 flagset
2015-02-10 09:53:37 -08:00
9460b6efda Merge pull request #2267 from xiang90/fix_snapconf
etcdserver: save confstate when apply new snapshot
2015-02-10 09:44:10 -08:00
57dd8c18cc etcdmain: infer bind addr from addr in v1 flagset 2015-02-10 09:42:10 -08:00
9ec8ea47c8 Merge pull request #2272 from yichengq/324
rafthttp: not send 0-entry MsgApp using stream
2015-02-10 09:40:32 -08:00
6e1aecfc6f etcdserver: save confstate when apply new snapshot 2015-02-10 07:31:25 -08:00
96fde55a0f rafthttp: not send 0-entry MsgApp using stream
It is not sent out because it is useless to let remote raft step the
message.
Moreover, MsgApp stream reader can always assume that the length
of entries sent is > 0.
2015-02-10 00:02:22 -08:00
84dac75ed5 Merge pull request #2213 from yichengq/317
migrate/starter: fix --version output
2015-02-09 23:18:35 -08:00
1481ef9a5e Merge pull request #2264 from xiang90/pause
rafttest: support node pause
2015-02-09 18:54:56 -08:00
fa66055f66 rafttest: drop isPaused 2015-02-09 18:52:34 -08:00
085b608de9 rafttest: support node pause 2015-02-09 16:26:43 -08:00
3c9c4c4afa Merge pull request #2249 from xiang90/rttest
raftest: wait for network sending
2015-02-09 15:55:30 -08:00
279b216f9a raftest: wait for network sending 2015-02-09 15:52:16 -08:00
8788c74b48 Merge pull request #2263 from xiang90/cread
Documentation: document kv api change
2015-02-09 15:46:45 -08:00
8d663078bf Documentation: document kv api change 2015-02-09 15:35:15 -08:00
0242faa838 Merge pull request #2257 from yichengq/321
docs: fix stats response in api.md
2015-02-09 14:46:57 -08:00
9c850b7182 Merge pull request #2259 from xiang90/healthy
etcdctl: support healthy checking
2015-02-09 14:38:43 -08:00
db88d9764c migrate: fix setting commit index from snapshot 2015-02-09 14:38:38 -08:00
7bbdad9068 etcdctl: support healthy checking 2015-02-09 14:35:24 -08:00
af00536d71 Merge pull request #2252 from xiang90/raftdelay
rafttest: add network delay
2015-02-09 13:14:32 -08:00
c990099008 docs: fix stats response in api.md 2015-02-09 11:48:54 -08:00
65cd0051fe rafttest: add network delay 2015-02-06 15:01:07 -08:00
c94db98177 Merge pull request #2250 from xiang90/raftnt
rafttest: add network drop
2015-02-06 12:40:55 -08:00
d423946fa4 rafttest: add network drop 2015-02-06 10:50:55 -08:00
e2feafc741 Merge pull request #2241 from peterrosell/correct_defaults_in_tuning
Correct defaults for heartbeat and election
2015-02-06 07:41:47 -08:00
c8b5d47f24 Documentation: Correct defaults for heartbeat and election
Defaults for hearbeat-interval and election-timeout is updated according to configuration documentation.
2015-02-06 10:13:57 +01:00
d71be31e68 Merge pull request #2245 from xiang90/fix_store
store: fix modifiedindex in node clone
2015-02-05 22:42:07 -08:00
9776e6d082 store: fix modifiedindex in node clone 2015-02-05 22:26:52 -08:00
766e0ad901 Merge pull request #2236 from philips/remove-becomes
Small grammar fixes
2015-02-05 11:26:16 -08:00
a387e2a989 Merge pull request #2232 from yichengq/319
fix the problem of StoreKeysPrefix key in store
2015-02-05 07:58:49 -08:00
26dc5904a5 Merge pull request #2235 from yichengq/318
migrate/functional: add Upgrade TLS V1 cluster test
2015-02-04 21:56:42 -08:00
136e0b6e26 migrate/functional: add Upgrade TLS V1 cluster test 2015-02-04 21:49:42 -08:00
599e821309 etcdctl/upgrade: use peer flags for peer transport 2015-02-04 21:49:42 -08:00
1ce7f6e0d0 migrate/starter: fix --version output 2015-02-04 21:28:56 -08:00
860a8c8717 Documentation: grammar fixup in admin guide
Rephrase to avoid "becomes".
2015-02-04 21:28:43 -08:00
a4c4027dc7 rafthttp: becomes -> became in log line
Simple grammar fix.
2015-02-04 21:28:23 -08:00
3ac0298bd0 store: set readonly to pre-defined namespaces 2015-02-04 16:47:08 -08:00
f13c7872d5 etcdserver: register pre-defined namespaces in store 2015-02-04 16:33:40 -08:00
38038e476a Merge pull request #2230 from yichengq/315
pkg/osutil: add Unsetenv
2015-02-04 10:43:43 -08:00
871e92ef73 pkg/osutil: add Unsetenv
go1.4 doesn't support static link well, so we stay in go1.3 for a while.
Implement Unsetenv in go1.3 way.
2015-02-04 10:29:20 -08:00
58cb9a3b76 Merge pull request #2222 from yichengq/315
migrate/starter: unset discovery when setting initial-cluster
2015-02-03 23:27:43 -08:00
a0f8aa1add travis: use latest go tool repo 2015-02-03 23:23:02 -08:00
5c6ce0c18d travis: use go1.4 for new feature os.Unsetenv() 2015-02-03 23:11:08 -08:00
378fa46b7d Merge pull request #2224 from xiang90/raftt
rafttest: separate network interface and network
2015-02-03 23:11:01 -08:00
83edf0d862 rafttest: separate network interface and network 2015-02-03 22:50:27 -08:00
d0205519a8 migrate/starter: unset discovery when setting initial-cluster 2015-02-03 18:29:52 -08:00
fca9805f84 Merge pull request #2221 from yichengq/315
migrate/starter: fix default version dir
2015-02-03 14:57:27 -08:00
f109020b94 migrate/starter: fix default version dir 2015-02-03 14:56:26 -08:00
81d7eaf17f Merge pull request #2205 from yichengq/315
migrate: support standby mode upgrade
2015-02-03 11:07:49 -08:00
2d081bd3b9 migrate: support standby mode upgrade 2015-02-03 10:59:43 -08:00
f2f2adc663 migrate/functional: always run tests on CoreOS image 2015-02-03 10:59:43 -08:00
92b329fdb9 etcdmain: use symlink instead of link for v0.4 files
link doesn't support directory.
2015-02-03 10:59:43 -08:00
00eaf165a8 Merge pull request #2212 from xiang90/rt
raftest: add restart and related simple test
2015-02-03 10:15:23 -08:00
b147a6328d raftest: add restart and related simple test 2015-02-03 10:08:52 -08:00
afb14a3e7a Merge pull request #2210 from yichengq/316
etcdmain: use /member subdir to save member data
2015-02-02 17:06:30 -08:00
ce1d7a9fa9 etcdmain: use /member subdir to save member data 2015-02-02 17:01:19 -08:00
470be16c04 Merge pull request #2209 from xiang90/fix_proxy
etcd: fix proxy
2015-02-02 15:02:25 -08:00
fbabcedcc9 etcd: fix proxy
1. move proxy datadir to /proxy subdir.
2. delay update proxy's cluster after validation.
2015-02-02 14:58:45 -08:00
d16c5e1e81 Merge pull request #2203 from xiang90/raft_test
raft: add raft test suite
2015-02-01 14:57:09 -08:00
d65af21b73 raft: add raft test suite 2015-02-01 14:53:22 -08:00
bdcae31638 Merge pull request #2202 from xiang90/proxy
etcd: fix proxy updating
2015-01-30 17:00:07 -08:00
ae9f54c132 etcd: fix proxy updating 2015-01-30 16:56:41 -08:00
a3d0097908 Merge pull request #2201 from barakmich/member_suggestion
etcdctl: give more helpful suggestions on removal
2015-01-30 19:51:22 -05:00
37e8d608b3 add documentation link and describe the 404/500 errors better 2015-01-30 19:41:44 -05:00
c66176b538 etcdctl: give more helpful suggestions on removal 2015-01-30 19:23:19 -05:00
b6936a0079 docs: fix broken link 2015-01-30 15:37:26 -08:00
9961d5ca2b Merge pull request #2198 from xiang90/proxy
Proxy
2015-01-30 15:24:13 -08:00
dc7374c488 etcd: persist proxy cluster to disk 2015-01-30 15:18:26 -08:00
87a8ebd222 docs: expand description of -initial-cluster-state 2015-01-30 14:14:51 -08:00
27e5b9a394 docs: clarify reconfig options 2015-01-30 14:14:28 -08:00
f5afe3cc34 Fixed typo in API documentation. 2015-01-30 14:14:18 -08:00
3ee7a265f6 README: remove doozer and zookeeper mentions
doozer in particular is rather confusing to mention since the project
hasn't been worked on in years. While we are at it it might simplify
people's understanding if we remove zookeeper too.
2015-01-30 14:13:47 -08:00
d1f9f2f1b7 scripts: remove 2.0 Documentation from build-release
2.0 docs have been merged into the Documentation folder now.
2015-01-30 14:13:25 -08:00
894f1aadce Merge pull request #2199 from xiang90/coreos
mian: detects coreos
2015-01-30 12:10:23 -08:00
fce80136e3 main: detects coreos 2015-01-30 12:10:05 -08:00
ebf9daff74 Merge pull request #2190 from yichengq/308
migrate: support start desired version
2015-01-30 11:47:22 -08:00
ec5a6e8beb migrate: support start desired version 2015-01-30 00:35:53 -08:00
0945e487e7 docs: fix static clustering example
When using very similar flags to our examples, the cluster doesn't bootstrap due to mismatched protocols (`http` vs `https`) in the `-initial-advertise-peer-urls` and `initial-cluster` list:

```
./etcd -name infra0 -initial-advertise-peer-urls https://127.0.0.1:2380 \
>   -listen-peer-urls https://127.0.0.1:2380 \
>   -initial-cluster-token etcd-cluster-1 \
>   -initial-cluster infra0=http://127.0.0.1:2380,infra1=http://127.0.0.1:2381,infra2=http://127.0.0.1:2382 \
>   -initial-cluster-state new
2015/01/29 10:32:16 no data-dir provided, using default data-dir ./infra0.etcd
2015/01/29 10:32:16 etcd: listening for peers on https://127.0.0.1:2380
2015/01/29 10:32:16 etcd: listening for client requests on http://localhost:2379
2015/01/29 10:32:16 etcd: listening for client requests on http://localhost:4001
2015/01/29 10:32:16 etcd: stopping listening for client requests on http://localhost:4001
2015/01/29 10:32:16 etcd: stopping listening for client requests on http://localhost:2379
2015/01/29 10:32:16 etcd: stopping listening for peers on https://127.0.0.1:2380
2015/01/29 10:32:16 etcd: infra0 has different advertised URLs in the cluster and advertised peer URLs list
```
2015-01-29 13:44:13 -08:00
a65556abe2 Merge pull request #2189 from yichengq/314
support disaster recovery from rc1 data dir
2015-01-29 13:38:00 -08:00
e966e565c4 etcdctl/backup_command: handle datadir with missed snapshot mark
This helps to recover from the data dir created in v2.0.0-rc1.
2015-01-29 13:32:59 -08:00
7840d49ae0 etcdserver: not add self to transporter based on local ID
If this is decided by local name, it comes to trouble if the name is
duplicate in the cluster.
2015-01-29 12:35:47 -08:00
d0af96d558 etcdctl/backup_command: save snapshot mark in new wal 2015-01-29 12:35:39 -08:00
fd0c0c9263 Merge pull request #2185 from xiang90/fix_tls_keepalive
Fix tls keepalive
2015-01-29 10:36:11 -08:00
4960324876 pkg/transport: fix tlskeepalive 2015-01-29 09:42:48 -08:00
1610 changed files with 405616 additions and 32204 deletions

8
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,8 @@
# Bug reporting
A good bug report has some very specific qualities, so please read over our short document on
[reporting bugs][report_bugs] before you submit your bug report.
To ask a question, go ahead and ignore this.
[report_bugs]: https://github.com/coreos/etcd/blob/master/Documentation/reporting_bugs.md

5
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,5 @@
# Contributing guidelines
Please read our [contribution workflow][contributing] before submitting a pull request.
[contributing]: https://github.com/coreos/etcd/blob/master/CONTRIBUTING.md#contribution-flow

3
.gitignore vendored
View File

@ -1,5 +1,6 @@
/coverage
/gopath
/gopath.proto
/go-bindata
/machine*
/bin
@ -9,3 +10,5 @@
*.swp
/hack/insta-discovery/.env
*.test
tools/functional-tester/docker/bin
hack/tls-setup/certs

View File

@ -1,4 +1,4 @@
// Copyright 2014 CoreOS, Inc.
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,11 +1,64 @@
dist: trusty
language: go
go_import_path: github.com/coreos/etcd
sudo: false
go:
- 1.3
go:
- 1.7.5
notifications:
on_success: never
on_failure: never
env:
matrix:
- TARGET=amd64
- TARGET=arm64
- TARGET=arm
- TARGET=386
- TARGET=ppc64le
matrix:
fast_finish: true
allow_failures:
- go: tip
exclude:
- go: tip
env: TARGET=arm
- go: tip
env: TARGET=arm64
- go: tip
env: TARGET=386
- go: tip
env: TARGET=ppc64le
addons:
apt:
packages:
- libpcap-dev
- libaspell-dev
- libhunspell-dev
before_install:
- go get -v github.com/chzchzchz/goword
- go get -v honnef.co/go/simple/cmd/gosimple
- go get -v honnef.co/go/unused/cmd/unused
# disable godep restore override
install:
- go get code.google.com/p/go.tools/cmd/cover
- go get code.google.com/p/go.tools/cmd/vet
- pushd cmd/etcd && go get -t -v ./... && popd
script:
- INTEGRATION=y ./test
- >
case "${TARGET}" in
amd64)
GOARCH=amd64 ./test
;;
386)
GOARCH=386 PASSES="build unit" ./test
;;
*)
# test building out of gopath
GO_BUILD_FLAGS="-a -v" GOPATH="" GOARCH="${TARGET}" ./build
;;
esac

View File

@ -1,6 +1,6 @@
# How to contribute
etcd is Apache 2.0 licensed and accepts contributions via Github pull requests. This document outlines some of the conventions on commit message formatting, contact points for developers and other resources to make getting your contribution into etcd easier.
etcd is Apache 2.0 licensed and accepts contributions via GitHub pull requests. This document outlines some of the conventions on commit message formatting, contact points for developers and other resources to make getting your contribution into etcd easier.
# Email and chat
@ -12,6 +12,14 @@ etcd is Apache 2.0 licensed and accepts contributions via Github pull requests.
- Fork the repository on GitHub
- Read the README.md for build instructions
## Reporting bugs and creating issues
Reporting bugs is one of the best ways to contribute. However, a good bug report
has some very specific qualities, so please read over our short document on
[reporting bugs](https://github.com/coreos/etcd/blob/master/Documentation/reporting_bugs.md)
before you submit your bug report. This document might contain links known
issues, another good reason to take a look there, before reporting your bug.
## Contribution flow
This is a rough outline of what a contributor's workflow looks like:
@ -27,11 +35,11 @@ Thanks for your contributions!
### Code style
The coding style suggested by the Golang community is used in etcd. See the [style doc](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) for details.
The coding style suggested by the Golang community is used in etcd. See the [style doc](https://github.com/golang/go/wiki/CodeReviewComments) for details.
Please follow this style to make etcd easy to review, maintain and develop.
### Format of the Commit Message
### Format of the commit message
We follow a rough convention for commit messages that is designed to answer two
questions: what changed and why. The subject line should feature the what and

View File

@ -1,2 +1,6 @@
FROM golang:onbuild
EXPOSE 4001 7001 2379 2380
FROM golang
ADD . /go/src/github.com/coreos/etcd
ADD cmd/vendor /go/src/github.com/coreos/etcd/vendor
RUN go install github.com/coreos/etcd
EXPOSE 2379 2380
ENTRYPOINT ["etcd"]

11
Dockerfile-release Normal file
View File

@ -0,0 +1,11 @@
FROM alpine:latest
ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
RUN mkdir -p /var/etcd/
RUN mkdir -p /var/lib/etcd/
EXPOSE 2379 2380
# Define default command.
CMD ["/usr/local/bin/etcd"]

View File

@ -1,47 +0,0 @@
## etcd 0.4.x -> 2.0.0 Data Migration Tool
### Upgrading from 0.4.x
Between 0.4.x and 2.0, the on-disk data formats have changed. In order to allow users to convert to 2.0, a migration tool is provided.
etcd will detect 0.4.x data dir and update the data automatically (while leaving a backup, in case of emergency).
### Data Migration Tips
* Keep the environment variables and etcd instance flags the same, particularly `--name`/`ETCD_NAME`.
* Don't change the cluster configuration. If there's a plan to add or remove machines, it's probably best to arrange for that after the migration, rather than before or at the same time.
### Running the tool
The tool can be run via:
```sh
./bin/etcd-migrate --data-dir=<PATH TO YOUR DATA>
```
It should autodetect everything and convert the data-dir to be 2.0 compatible. It does not remove the 0.4.x data, and is safe to convert multiple times; the 2.0 data will be overwritten. Recovering the disk space once everything is settled is covered later in the document.
If, however, it complains about autodetecting the name (which can happen, depending on how the cluster was configured), you need to supply the name of this particular node. This is equivalent to the `--name` flag (or `ETCD_NAME` variable) that etcd was run with, which can also be found by accessing the self api, eg:
```sh
curl -L http://127.0.0.1:4001/v2/stats/self
```
Where the `"name"` field is the name of the local machine.
Then, run the migration tool with
```sh
./bin/etcd-migrate --data-dir=<PATH TO YOUR DATA> --name=<NAME>
```
And the tool should migrate successfully. If it still has an error at this time, it's a failure or bug in the tool and it's worth reporting a bug.
### Recovering Disk Space
If the conversion has completed, the entire cluster is running on something 2.0-based, and the disk space is important, the following command will clear 0.4.x data from the data-dir:
```sh
rm -ri snapshot conf log
```
It will ask before every deletion, but these are the 0.4.x files and will not affect the working 2.0 data.

1
Documentation/README.md Symbolic link
View File

@ -0,0 +1 @@
docs.md

View File

@ -1,55 +0,0 @@
### Backward Compatibility
The main goal of etcd 2.0 release is to improve cluster safety around bootstrapping and dynamic reconfiguration. To do this, we deprecated the old error-prone APIs and provide a new set of APIs.
The other main focus of this release was a more reliable Raft implementation, but as this change is internal it should not have any notable effects to users.
#### Command Line Flags Changes
The major flag changes are to mostly related to bootstrapping. The `initial-*` flags provide an improved way to specify the required criteria to start the cluster. The advertised URLs now support a list of values instead of a single value, which allows etcd users to gracefully migrate to the new set of IANA-assigned ports (2379/client and 2380/peers) while maintaining backward compatibility with the old ports.
- `-addr` is replaced by `-advertise-client-urls`.
- `-bind-addr` is replaced by `-listen-client-urls`.
- `-peer-addr` is replaced by `-initial-advertise-peer-urls`.
- `-peer-bind-addr` is replaced by `-listen-peer-urls`.
- `-peers` is replaced by `-initial-cluster`.
- `-peers-file` is replaced by `-initial-cluster`.
- `-peer-heartbeat-interval` is replaced by `-heartbeat-interval`.
- `-peer-election-timeout` is replaced by `-election-timeout`.
The documentation of new command line flags can be found at
https://github.com/coreos/etcd/blob/master/Documentation/configuration.md.
#### Data Dir
- Default data dir location has changed from {$hostname}.etcd to {name}.etcd.
- The disk format within the data dir has changed. etcd 2.0 should be able to auto upgrade the old data format. Instructions on doing so manually are in the [migration tool doc][migrationtooldoc].
[migrationtooldoc]: https://github.com/coreos/etcd/blob/master/Documentation/0_4_migration_tool.md
#### Standby
etcd 0.4s standby mode has been deprecated. [Proxy mode][proxymode] is introduced to solve a subset of problems standby was solving.
Standby mode was intended for large clusters that had a subset of the members acting in the consensus process. Overall this process was too magical and allowed for operators to back themselves into a corner.
Proxy mode in 2.0 will provide similar functionality, and with improved control over which machines act as proxies due to the operator specifically configuring them. Proxies also support read only or read/write modes for increased security and durability.
[proxymode]: https://github.com/coreos/etcd/blob/master/Documentation/proxy.md
#### Discovery Service
A size key needs to be provided inside a [discovery token][discoverytoken].
[discoverytoken]: https://github.com/coreos/etcd/blob/master/Documentation/clustering.md#custom-etcd-discovery-service
#### HTTP Admin API
`v2/admin` on peer url and `v2/keys/_etcd` are unified under the new [v2/member API][memberapi] to better explain which machines are part of an etcd cluster, and to simplify the keyspace for all your use cases.
[memberapi]: https://github.com/coreos/etcd/blob/master/Documentation/other_apis.md
#### HTTP Key Value API
- The follower can now transparently proxy write equests to the leader. Clients will no longer see 307 redirections to the leader from etcd.
- Expiration time is in UTC instead of local time.

View File

@ -0,0 +1,18 @@
# Benchmarks
etcd benchmarks will be published regularly and tracked for each release below:
- [etcd v2.1.0-alpha][2.1]
- [etcd v2.2.0-rc][2.2]
- [etcd v3 demo][3.0]
# Memory Usage Benchmarks
It records expected memory usage in different scenarios.
- [etcd v2.2.0-rc][2.2-mem]
[2.1]: etcd-2-1-0-alpha-benchmarks.md
[2.2]: etcd-2-2-0-rc-benchmarks.md
[2.2-mem]: etcd-2-2-0-rc-memory-benchmarks.md
[3.0]: etcd-3-demo-benchmarks.md

View File

@ -0,0 +1,52 @@
## Physical machines
GCE n1-highcpu-2 machine type
- 1x dedicated local SSD mounted under /var/lib/etcd
- 1x dedicated slow disk for the OS
- 1.8 GB memory
- 2x CPUs
- etcd version 2.1.0 alpha
## etcd Cluster
3 etcd members, each runs on a single machine
## Testing
Bootstrap another machine and use the [hey HTTP benchmark tool][hey] to send requests to each etcd member. Check the [benchmark hacking guide][hack-benchmark] for detailed instructions.
## Performance
### reading one single key
| key size in bytes | number of clients | target etcd server | read QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|--------------------|----------|---------------|
| 64 | 1 | leader only | 1534 | 0.7 |
| 64 | 64 | leader only | 10125 | 9.1 |
| 64 | 256 | leader only | 13892 | 27.1 |
| 256 | 1 | leader only | 1530 | 0.8 |
| 256 | 64 | leader only | 10106 | 10.1 |
| 256 | 256 | leader only | 14667 | 27.0 |
| 64 | 64 | all servers | 24200 | 3.9 |
| 64 | 256 | all servers | 33300 | 11.8 |
| 256 | 64 | all servers | 24800 | 3.9 |
| 256 | 256 | all servers | 33000 | 11.5 |
### writing one single key
| key size in bytes | number of clients | target etcd server | write QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|--------------------|-----------|---------------|
| 64 | 1 | leader only | 60 | 21.4 |
| 64 | 64 | leader only | 1742 | 46.8 |
| 64 | 256 | leader only | 3982 | 90.5 |
| 256 | 1 | leader only | 58 | 20.3 |
| 256 | 64 | leader only | 1770 | 47.8 |
| 256 | 256 | leader only | 4157 | 105.3 |
| 64 | 64 | all servers | 1028 | 123.4 |
| 64 | 256 | all servers | 3260 | 123.8 |
| 256 | 64 | all servers | 1033 | 121.5 |
| 256 | 256 | all servers | 3061 | 119.3 |
[hey]: https://github.com/rakyll/hey
[hack-benchmark]: /hack/benchmark/

View File

@ -0,0 +1,69 @@
# Benchmarking etcd v2.2.0
## Physical Machines
GCE n1-highcpu-2 machine type
- 1x dedicated local SSD mounted as etcd data directory
- 1x dedicated slow disk for the OS
- 1.8 GB memory
- 2x CPUs
## etcd Cluster
3 etcd 2.2.0 members, each runs on a single machine.
Detailed versions:
```
etcd Version: 2.2.0
Git SHA: e4561dd
Go Version: go1.5
Go OS/Arch: linux/amd64
```
## Testing
Bootstrap another machine, outside of the etcd cluster, and run the [`hey` HTTP benchmark tool](https://github.com/rakyll/hey) with a connection reuse patch to send requests to each etcd cluster member. See the [benchmark instructions](../../hack/benchmark/) for the patch and the steps to reproduce our procedures.
The performance is calulated through results of 100 benchmark rounds.
## Performance
### Single Key Read Performance
| key size in bytes | number of clients | target etcd server | average read QPS | read QPS stddev | average 90th Percentile Latency (ms) | latency stddev |
|-------------------|-------------------|--------------------|------------------|-----------------|--------------------------------------|----------------|
| 64 | 1 | leader only | 2303 | 200 | 0.49 | 0.06 |
| 64 | 64 | leader only | 15048 | 685 | 7.60 | 0.46 |
| 64 | 256 | leader only | 14508 | 434 | 29.76 | 1.05 |
| 256 | 1 | leader only | 2162 | 214 | 0.52 | 0.06 |
| 256 | 64 | leader only | 14789 | 792 | 7.69| 0.48 |
| 256 | 256 | leader only | 14424 | 512 | 29.92 | 1.42 |
| 64 | 64 | all servers | 45752 | 2048 | 2.47 | 0.14 |
| 64 | 256 | all servers | 46592 | 1273 | 10.14 | 0.59 |
| 256 | 64 | all servers | 45332 | 1847 | 2.48| 0.12 |
| 256 | 256 | all servers | 46485 | 1340 | 10.18 | 0.74 |
### Single Key Write Performance
| key size in bytes | number of clients | target etcd server | average write QPS | write QPS stddev | average 90th Percentile Latency (ms) | latency stddev |
|-------------------|-------------------|--------------------|------------------|-----------------|--------------------------------------|----------------|
| 64 | 1 | leader only | 55 | 4 | 24.51 | 13.26 |
| 64 | 64 | leader only | 2139 | 125 | 35.23 | 3.40 |
| 64 | 256 | leader only | 4581 | 581 | 70.53 | 10.22 |
| 256 | 1 | leader only | 56 | 4 | 22.37| 4.33 |
| 256 | 64 | leader only | 2052 | 151 | 36.83 | 4.20 |
| 256 | 256 | leader only | 4442 | 560 | 71.59 | 10.03 |
| 64 | 64 | all servers | 1625 | 85 | 58.51 | 5.14 |
| 64 | 256 | all servers | 4461 | 298 | 89.47 | 36.48 |
| 256 | 64 | all servers | 1599 | 94 | 60.11| 6.43 |
| 256 | 256 | all servers | 4315 | 193 | 88.98 | 7.01 |
## Performance Changes
- Because etcd now records metrics for each API call, read QPS performance seems to see a minor decrease in most scenarios. This minimal performance impact was judged a reasonable investment for the breadth of monitoring and debugging information returned.
- Write QPS to cluster leaders seems to be increased by a small margin. This is because the main loop and entry apply loops were decoupled in the etcd raft logic, eliminating several blocks between them.
- Write QPS to all members seems to be increased by a significant margin, because followers now receive the latest commit index sooner, and commit proposals more quickly.

View File

@ -0,0 +1,72 @@
## Physical machines
GCE n1-highcpu-2 machine type
- 1x dedicated local SSD mounted under /var/lib/etcd
- 1x dedicated slow disk for the OS
- 1.8 GB memory
- 2x CPUs
## etcd Cluster
3 etcd 2.2.0-rc members, each runs on a single machine.
Detailed versions:
```
etcd Version: 2.2.0-alpha.1+git
Git SHA: 59a5a7e
Go Version: go1.4.2
Go OS/Arch: linux/amd64
```
Also, we use 3 etcd 2.1.0 alpha-stage members to form cluster to get base performance. etcd's commit head is at [c7146bd5][c7146bd5], which is the same as the one that we use in [etcd 2.1 benchmark][etcd-2.1-benchmark].
## Testing
Bootstrap another machine and use the [hey HTTP benchmark tool][hey] to send requests to each etcd member. Check the [benchmark hacking guide][hack-benchmark] for detailed instructions.
## Performance
### reading one single key
| key size in bytes | number of clients | target etcd server | read QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|--------------------|----------|---------------|
| 64 | 1 | leader only | 2804 (-5%) | 0.4 (+0%) |
| 64 | 64 | leader only | 17816 (+0%) | 5.7 (-6%) |
| 64 | 256 | leader only | 18667 (-6%) | 20.4 (+2%) |
| 256 | 1 | leader only | 2181 (-15%) | 0.5 (+25%) |
| 256 | 64 | leader only | 17435 (-7%) | 6.0 (+9%) |
| 256 | 256 | leader only | 18180 (-8%) | 21.3 (+3%) |
| 64 | 64 | all servers | 46965 (-4%) | 2.1 (+0%) |
| 64 | 256 | all servers | 55286 (-6%) | 7.4 (+6%) |
| 256 | 64 | all servers | 46603 (-6%) | 2.1 (+5%) |
| 256 | 256 | all servers | 55291 (-6%) | 7.3 (+4%) |
### writing one single key
| key size in bytes | number of clients | target etcd server | write QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|--------------------|-----------|---------------|
| 64 | 1 | leader only | 76 (+22%) | 19.4 (-15%) |
| 64 | 64 | leader only | 2461 (+45%) | 31.8 (-32%) |
| 64 | 256 | leader only | 4275 (+1%) | 69.6 (-10%) |
| 256 | 1 | leader only | 64 (+20%) | 16.7 (-30%) |
| 256 | 64 | leader only | 2385 (+30%) | 31.5 (-19%) |
| 256 | 256 | leader only | 4353 (-3%) | 74.0 (+9%) |
| 64 | 64 | all servers | 2005 (+81%) | 49.8 (-55%) |
| 64 | 256 | all servers | 4868 (+35%) | 81.5 (-40%) |
| 256 | 64 | all servers | 1925 (+72%) | 47.7 (-59%) |
| 256 | 256 | all servers | 4975 (+36%) | 70.3 (-36%) |
### performance changes explanation
- read QPS in most scenarios is decreased by 5~8%. The reason is that etcd records store metrics for each store operation. The metrics is important for monitoring and debugging, so this is acceptable.
- write QPS to leader is increased by 20~30%. This is because we decouple raft main loop and entry apply loop, which avoids them blocking each other.
- write QPS to all servers is increased by 30~80% because follower could receive latest commit index earlier and commit proposals faster.
[hey]: https://github.com/rakyll/hey
[c7146bd5]: https://github.com/coreos/etcd/commits/c7146bd5f2c73716091262edc638401bb8229144
[etcd-2.1-benchmark]: etcd-2-1-0-alpha-benchmarks.md
[hack-benchmark]: /hack/benchmark/

View File

@ -0,0 +1,47 @@
## Physical machine
GCE n1-standard-2 machine type
- 1x dedicated local SSD mounted under /var/lib/etcd
- 1x dedicated slow disk for the OS
- 7.5 GB memory
- 2x CPUs
## etcd
```
etcd Version: 2.2.0-rc.0+git
Git SHA: 103cb5c
Go Version: go1.5
Go OS/Arch: linux/amd64
```
## Testing
Start 3-member etcd cluster, each of which uses 2 cores.
The length of key name is always 64 bytes, which is a reasonable length of average key bytes.
## Memory Maximal Usage
- etcd may use maximal memory if one follower is dead and the leader keeps sending snapshots.
- `max RSS` is the maximal memory usage recorded in 3 runs.
| value bytes | key number | data size(MB) | max RSS(MB) | max RSS/data rate on leader |
|-------------|-------------|---------------|-------------|-----------------------------|
| 128 | 50000 | 6 | 433 | 72x |
| 128 | 100000 | 12 | 659 | 54x |
| 128 | 200000 | 24 | 1466 | 61x |
| 1024 | 50000 | 48 | 1253 | 26x |
| 1024 | 100000 | 96 | 2344 | 24x |
| 1024 | 200000 | 192 | 4361 | 22x |
## Data Size Threshold
- When etcd reaches data size threshold, it may trigger leader election easily and drop part of proposals.
- At most cases, etcd cluster should work smoothly if it doesn't hit the threshold. If it doesn't work well due to insufficient resources, you need to decrease its data size.
| value bytes | key number limitation | suggested data size threshold(MB) | consumed RSS(MB) |
|-------------|-----------------------|-----------------------------------|------------------|
| 128 | 400K | 48 | 2400 |
| 1024 | 300K | 292 | 6500 |

View File

@ -0,0 +1,42 @@
## Physical machines
GCE n1-highcpu-2 machine type
- 1x dedicated local SSD mounted under /var/lib/etcd
- 1x dedicated slow disk for the OS
- 1.8 GB memory
- 2x CPUs
- etcd version 2.2.0
## etcd Cluster
1 etcd member running in v3 demo mode
## Testing
Use [etcd v3 benchmark tool][etcd-v3-benchmark].
## Performance
### reading one single key
| key size in bytes | number of clients | read QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|----------|---------------|
| 256 | 1 | 2716 | 0.4 |
| 256 | 64 | 16623 | 6.1 |
| 256 | 256 | 16622 | 21.7 |
The performance is nearly the same as the one with empty server handler.
### reading one single key after putting
| key size in bytes | number of clients | read QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|----------|---------------|
| 256 | 1 | 2269 | 0.5 |
| 256 | 64 | 13582 | 8.6 |
| 256 | 256 | 13262 | 47.5 |
The performance with empty server handler is not affected by one put. So the
performance downgrade should be caused by storage package.
[etcd-v3-benchmark]: /tools/benchmark/

View File

@ -0,0 +1,77 @@
# Watch Memory Usage Benchmark
*NOTE*: The watch features are under active development, and their memory usage may change as that development progresses. We do not expect it to significantly increase beyond the figures stated below.
A primary goal of etcd is supporting a very large number of watchers doing a massively large amount of watching. etcd aims to support O(10k) clients, O(100K) watch streams (O(10) streams per client) and O(10M) total watchings (O(100) watching per stream). The memory consumed by each individual watching accounts for the largest portion of etcd's overall usage, and is therefore the focus of current and future optimizations.
Three related components of etcd watch consume physical memory: each `grpc.Conn`, each watch stream, and each instance of the watching activity. `grpc.Conn` maintains the actual TCP connection and other gRPC connection state. Each `grpc.Conn` consumes O(10kb) of memory, and might have multiple watch streams attached.
Each watch stream is an independent HTTP2 connection which consumes another O(10kb) of memory.
Multiple watchings might share one watch stream.
Watching is the actual struct that tracks the changes on the key-value store. Each watching should only consume < O(1kb).
```
+-------+
| watch |
+---------> | foo |
| +-------+
+------+-----+
| stream |
+--------------> | |
| +------+-----+ +-------+
| | | watch |
| +---------> | bar |
+-----+------+ +-------+
| | +------------+
| conn +-------> | stream |
| | | |
+-----+------+ +------------+
|
|
|
| +------------+
+--------------> | stream |
| |
+------------+
```
The theoretical memory consumption of watch can be approximated with the formula:
`memory = c1 * number_of_conn + c2 * avg_number_of_stream_per_conn + c3 * avg_number_of_watch_stream`
## Testing Environment
etcd version
- git head https://github.com/coreos/etcd/commit/185097ffaa627b909007e772c175e8fefac17af3
GCE n1-standard-2 machine type
- 7.5 GB memory
- 2x CPUs
## Overall memory usage
The overall memory usage captures how much [RSS][rss] etcd consumes with the client watchers. While the result may vary by as much as 10%, it is still meaningful, since the goal is to learn about the rough memory usage and the pattern of allocations.
With the benchmark result, we can calculate roughly that `c1 = 17kb`, `c2 = 18kb` and `c3 = 350bytes`. So each additional client connection consumes 17kb of memory and each additional stream consumes 18kb of memory, and each additional watching only cause 350bytes. A single etcd server can maintain millions of watchings with a few GB of memory in normal case.
| clients | streams per client | watchings per stream | total watching | memory usage |
|---------|---------|-----------|----------------|--------------|
| 1k | 1 | 1 | 1k | 50MB |
| 2k | 1 | 1 | 2k | 90MB |
| 5k | 1 | 1 | 5k | 200MB |
| 1k | 10 | 1 | 10k | 217MB |
| 2k | 10 | 1 | 20k | 417MB |
| 5k | 10 | 1 | 50k | 980MB |
| 1k | 50 | 1 | 50k | 1001MB |
| 2k | 50 | 1 | 100k | 1960MB |
| 5k | 50 | 1 | 250k | 4700MB |
| 1k | 50 | 10 | 500k | 1171MB |
| 2k | 50 | 10 | 1M | 2371MB |
| 5k | 50 | 10 | 2.5M | 5710MB |
| 1k | 50 | 100 | 5M | 2380MB |
| 2k | 50 | 100 | 10M | 4672MB |
| 5k | 50 | 100 | 25M | *OOM* |
[rss]: https://en.wikipedia.org/wiki/Resident_set_size

View File

@ -0,0 +1,98 @@
# Storage Memory Usage Benchmark
<!---todo: link storage to storage design doc-->
Two components of etcd storage consume physical memory. The etcd process allocates an *in-memory index* to speed key lookup. The process's *page cache*, managed by the operating system, stores recently-accessed data from disk for quick re-use.
The in-memory index holds all the keys in a [B-tree][btree] data structure, along with pointers to the on-disk data (the values). Each key in the B-tree may contain multiple pointers, pointing to different versions of its values. The theoretical memory consumption of the in-memory index can hence be approximated with the formula:
`N * (c1 + avg_key_size) + N * (avg_versions_of_key) * (c2 + size_of_pointer)`
where `c1` is the key metadata overhead and `c2` is the version metadata overhead.
The graph shows the detailed structure of the in-memory index B-tree.
```
In mem index
+------------+
| key || ... |
+--------------+ | || |
| | +------------+
| | | v1 || ... |
| disk <----------------| || | Tree Node
| | +------------+
| | | v2 || ... |
| <----------------+ || |
| | +------------+
+--------------+ +-----+ | | |
| | | | |
| +------------+
|
|
^
------+
| ... |
| |
+-----+
| ... | Tree Node
| |
+-----+
| ... |
| |
------+
```
[Page cache memory][pagecache] is managed by the operating system and is not covered in detail in this document.
## Testing Environment
etcd version
- git head https://github.com/coreos/etcd/commit/776e9fb7be7eee5e6b58ab977c8887b4fe4d48db
GCE n1-standard-2 machine type
- 7.5 GB memory
- 2x CPUs
## In-memory index memory usage
In this test, we only benchmark the memory usage of the in-memory index. The goal is to find `c1` and `c2` mentioned above and to understand the hard limit of memory consumption of the storage.
We calculate the memory usage consumption via the Go runtime.ReadMemStats. We calculate the total allocated bytes difference before creating the index and after creating the index. It cannot perfectly reflect the memory usage of the in-memory index itself but can show the rough consumption pattern.
| N | versions | key size | memory usage |
|------|----------|----------|--------------|
| 100K | 1 | 64bytes | 22MB |
| 100K | 5 | 64bytes | 39MB |
| 1M | 1 | 64bytes | 218MB |
| 1M | 5 | 64bytes | 432MB |
| 100K | 1 | 256bytes | 41MB |
| 100K | 5 | 256bytes | 65MB |
| 1M | 1 | 256bytes | 409MB |
| 1M | 5 | 256bytes | 506MB |
Based on the result, we can calculate `c1=120bytes`, `c2=30bytes`. We only need two sets of data to calculate `c1` and `c2`, since they are the only unknown variable in the formula. The `c1=120bytes` and `c2=30bytes` are the average value of the 4 sets of `c1` and `c2` we calculated. The key metadata overhead is still relatively nontrivial (50%) for small key-value pairs. However, this is a significant improvement over the old store, which had at least 1000% overhead.
## Overall memory usage
The overall memory usage captures how much RSS etcd consumes with the storage. The value size should have very little impact on the overall memory usage of etcd, since we keep values on disk and only retain hot values in memory, managed by the OS page cache.
| N | versions | key size | value size | memory usage |
|------|----------|----------|------------|--------------|
| 100K | 1 | 64bytes | 256bytes | 40MB |
| 100K | 5 | 64bytes | 256bytes | 89MB |
| 1M | 1 | 64bytes | 256bytes | 470MB |
| 1M | 5 | 64bytes | 256bytes | 880MB |
| 100K | 1 | 64bytes | 1KB | 102MB |
| 100K | 5 | 64bytes | 1KB | 164MB |
| 1M | 1 | 64bytes | 1KB | 587MB |
| 1M | 5 | 64bytes | 1KB | 836MB |
Based on the result, we know the value size does not significantly impact the memory consumption. There is some minor increase due to more data held in the OS page cache.
[btree]: https://en.wikipedia.org/wiki/B-tree
[pagecache]: https://en.wikipedia.org/wiki/Page_cache

View File

@ -0,0 +1,26 @@
# Branch management
## Guide
* New development occurs on the [master branch][master].
* Master branch should always have a green build!
* Backwards-compatible bug fixes should target the master branch and subsequently be ported to stable branches.
* Once the master branch is ready for release, it will be tagged and become the new stable branch.
The etcd team has adopted a *rolling release model* and supports one stable version of etcd.
### Master branch
The `master` branch is our development branch. All new features land here first.
To try new and experimental features, pull `master` and play with it. Note that `master` may not be stable because new features may introduce bugs.
Before the release of the next stable version, feature PRs will be frozen. We will focus on the testing, bug-fix and documentation for one to two weeks.
### Stable branches
All branches with prefix `release-` are considered _stable_ branches.
After every minor release (http://semver.org/), we will have a new stable branch for that release. We will keep fixing the backwards-compatible bugs for the latest stable release, but not previous releases. The _patch_ release, incorporating any bug fixes, will be once every two weeks, given any patches.
[master]: https://github.com/coreos/etcd/tree/master

View File

@ -1,356 +0,0 @@
# Clustering Guide
## Overview
Starting an etcd cluster statically requires that each member knows another in the cluster. In a number of cases, you might not know the IPs of your cluster members ahead of time. In these cases, you can bootstrap an etcd cluster with the help of a discovery service.
This guide willcover the following mechanisms for bootstrapping an etcd cluster:
* [Static](#static)
* [etcd Discovery](#etcd-discovery)
* [DNS Discovery](#dns-discovery)
Each of the bootstrapping mechanisms will be used to create a three machine etcd cluster with the following details:
|Name|Address|Hostname|
|------|---------|------------------|
|infra0|10.0.1.10|infra0.example.com|
|infra1|10.0.1.11|infra1.example.com|
|infra2|10.0.1.12|infra2.example.com|
## Static
As we know the cluster members, their addresses and the size of the cluster before starting, we can use an offline bootstrap configuration by setting the `initial-cluster` flag. Each machine will get either the following command line or environment variables:
```
ETCD_INITIAL_CLUSTER="infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380"
ETCD_INITIAL_CLUSTER_STATE=new
```
```
-initial-cluster infra0=http://10.0.1.10:2380,http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
-initial-cluster-state new
```
Note that the URLs specified in `initial-cluster` are the _advertised peer URLs_, i.e. they should match the value of `initial-advertise-peer-urls` on the respective nodes.
If you are spinning up multiple clusters (or creating and destroying a single cluster) with same configuration for testing purpose, it is highly recommended that you specify a unique `initial-cluster-token` for the different clusters. By doing this, etcd can generate unique cluster IDs and member IDs for the clusters even if they otherwise have the exact same configuration. This can protect you from cross-cluster-interaction, which might corrupt your clusters.
On each machine you would start etcd with these flags:
```
$ etcd -name infra0 -initial-advertise-peer-urls https://10.0.1.10:2380 \
-listen-peer-urls https://10.0.1.10:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
-initial-cluster-state new
```
```
$ etcd -name infra1 -initial-advertise-peer-urls https://10.0.1.11:2380 \
-listen-peer-urls https://10.0.1.11:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
-initial-cluster-state new
```
```
$ etcd -name infra2 -initial-advertise-peer-urls https://10.0.1.12:2380 \
-listen-peer-urls https://10.0.1.12:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
-initial-cluster-state new
```
The command line parameters starting with `-initial-cluster` will be ignored on subsequent runs of etcd. You are free to remove the environment variables or command line flags after the initial bootstrap process. If you need to make changes to the configuration later (for example, adding or removing members to/from the cluster), see the [runtime configuration](runtime-configuration.md) guide.
### Error Cases
In the following example, we have not included our new host in the list of enumerated nodes. If this is a new cluster, the node _must_ be added to the list of initial cluster members.
```
$ etcd -name infra1 -initial-advertise-peer-urls http://10.0.1.11:2380 \
-listen-peer-urls https://10.0.1.11:2380 \
-initial-cluster infra0=http://10.0.1.10:2380 \
-initial-cluster-state new
etcd: infra1 not listed in the initial cluster config
exit 1
```
In this example, we are attempting to map a node (infra0) on a different address (127.0.0.1:2380) than its enumerated address in the cluster list (10.0.1.10:2380). If this node is to listen on multiple addresses, all addresses _must_ be reflected in the "initial-cluster" configuration directive.
```
$ etcd -name infra0 -initial-advertise-peer-urls http://127.0.0.1:2380 \
-listen-peer-urls http://10.0.1.10:2380 \
-initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
-initial-cluster-state=new
etcd: error setting up initial cluster: infra0 has different advertised URLs in the cluster and advertised peer URLs list
exit 1
```
If you configure a peer with a different set of configuration and attempt to join this cluster you will get a cluster ID mismatch and etcd will exit.
```
$ etcd -name infra3 -initial-advertise-peer-urls http://10.0.1.13:2380 \
-listen-peer-urls http://10.0.1.13:2380 \
-initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra3=http://10.0.1.13:2380 \
-initial-cluster-state=new
etcd: conflicting cluster ID to the target cluster (c6ab534d07e8fcc4 != bc25ea2a74fb18b0). Exiting.
exit 1
```
## Discovery
In a number of cases, you might not know the IPs of your cluster peers ahead of time. This is common when utilizing cloud providers or when your network uses DHCP. In these cases, rather than specifying a static configuration, you can use an existing etcd cluster to bootstrap a new one. We call this process "discovery".
There two methods that can be used for discovery:
* etcd discovery service
* DNS SRV records
### etcd Discovery
#### Lifetime of a Discovery URL
A discovery URL identifies a unique etcd cluster. Instead of reusing a discovery URL, you should always create discovery URLs for new clusters.
Moreover, discovery URLs should ONLY be used for the initial bootstrapping of a cluster. To change cluster membership after the cluster is already running, see the [runtime reconfiguration][runtime] guide.
[runtime]: https://github.com/coreos/etcd/blob/master/Documentation/runtime-configuration.md
#### Custom etcd Discovery Service
Discovery uses an existing cluster to bootstrap itself. If you are using your own etcd cluster you can create a URL like so:
```
$ curl -X PUT https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83/_config/size -d value=3
```
By setting the size key to the URL, you create a discovery URL with an expected cluster size of 3.
If you bootstrap an etcd cluster using discovery service with more than the expected number of etcd members, the extra etcd processes will [fall back][fall-back] to being [proxies][proxy] by default.
The URL you will use in this case will be `https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83` and the etcd members will use the `https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83` directory for registration as they start.
Now we start etcd with those relevant flags for each member:
```
$ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \
-listen-peer-urls http://10.0.1.10:2380 \
-discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83
```
```
$ etcd -name infra1 -initial-advertise-peer-urls http://10.0.1.11:2380 \
-listen-peer-urls http://10.0.1.11:2380 \
-discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83
```
```
$ etcd -name infra2 -initial-advertise-peer-urls http://10.0.1.12:2380 \
-listen-peer-urls http://10.0.1.12:2380 \
-discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83
```
This will cause each member to register itself with the custom etcd discovery service and begin the cluster once all machines have been registered.
#### Public etcd Discovery Service
If you do not have access to an existing cluster, you can use the public discovery service hosted at `discovery.etcd.io`. You can create a private discovery URL using the "new" endpoint like so:
```
$ curl https://discovery.etcd.io/new?size=3
https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
This will create the cluster with an initial expected size of 3 members. If you do not specify a size, a default of 3 will be used.
If you bootstrap an etcd cluster using discovery service with more than the expected number of etcd members, the extra etcd processes will [fall back][fall-back] to being [proxies][proxy] by default.
[fall-back]: proxy.md#fallback-to-proxy-mode-with-discovery-service
[proxy]: proxy.md
```
ETCD_DISCOVERY=https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
```
-discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
Now we start etcd with those relevant flags for each member:
```
$ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \
-listen-peer-urls http://10.0.1.10:2380 \
-discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
```
$ etcd -name infra1 -initial-advertise-peer-urls http://10.0.1.11:2380 \
-listen-peer-urls http://10.0.1.11:2380 \
-discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
```
$ etcd -name infra2 -initial-advertise-peer-urls http://10.0.1.12:2380 \
-listen-peer-urls http://10.0.1.12:2380 \
-discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
This will cause each member to register itself with the discovery service and begin the cluster once all members have been registered.
You can use the environment variable `ETCD_DISCOVERY_PROXY` to cause etcd to use an HTTP proxy to connect to the discovery service.
#### Error and Warning Cases
##### Discovery Server Errors
```
$ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \
-listen-peer-urls http://10.0.1.10:2380 \
-discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
etcd: error: the cluster doesnt have a size configuration value in https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de/_config
exit 1
```
##### User Errors
This error will occur if the discovery cluster already has the configured number of members, and `discovery-fallback` is explicitly disabled
```
$ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \
-listen-peer-urls http://10.0.1.10:2380 \
-discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de \
-discovery-fallback exit
etcd: discovery: cluster is full
exit 1
```
##### Warnings
This is a harmless warning notifying you that the discovery URL will be
ignored on this machine.
```
$ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \
-listen-peer-urls http://10.0.1.10:2380 \
-discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
etcdserver: discovery token ignored since a cluster has already been initialized. Valid log found at /var/lib/etcd
```
### DNS Discovery
DNS [SRV records](http://www.ietf.org/rfc/rfc2052.txt) can be used as a discovery mechanism.
The `-discovery-srv` flag can be used to set the DNS domain name where the discovery SRV records can be found.
The following DNS SRV records are looked up in the listed order:
* _etcd-server-ssl._tcp.example.com
* _etcd-server._tcp.example.com
If `_etcd-server-ssl._tcp.example.com` is found then etcd will attempt the bootstrapping process over SSL.
#### Create DNS SRV records
```
$ dig +noall +answer SRV _etcd-server._tcp.example.com
_etcd-server._tcp.example.com. 300 IN SRV 0 0 2380 infra0.example.com.
_etcd-server._tcp.example.com. 300 IN SRV 0 0 2380 infra1.example.com.
_etcd-server._tcp.example.com. 300 IN SRV 0 0 2380 infra2.example.com.
```
```
$ dig +noall +answer infra0.example.com infra1.example.com infra2.example.com
infra0.example.com. 300 IN A 10.0.1.10
infra1.example.com. 300 IN A 10.0.1.11
infra2.example.com. 300 IN A 10.0.1.12
```
#### Bootstrap the etcd cluster using DNS
etcd cluster memebers can listen on domain names or IP address, the bootstrap process will resolve DNS A records.
```
$ etcd -name infra0 \
-discovery-srv example.com \
-initial-advertise-peer-urls http://infra0.example.com:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster-state new \
-advertise-client-urls http://infra0.example.com:2379 \
-listen-client-urls http://infra0.example.com:2379 \
-listen-peer-urls http://infra0.example.com:2380
```
```
$ etcd -name infra1 \
-discovery-srv example.com \
-initial-advertise-peer-urls http://infra1.example.com:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster-state new \
-advertise-client-urls http://infra1.example.com:2379 \
-listen-client-urls http://infra1.example.com:2379 \
-listen-peer-urls http://infra1.example.com:2380
```
```
$ etcd -name infra2 \
-discovery-srv example.com \
-initial-advertise-peer-urls http://infra2.example.com:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster-state new \
-advertise-client-urls http://infra2.example.com:2379 \
-listen-client-urls http://infra2.example.com:2379 \
-listen-peer-urls http://infra2.example.com:2380
```
You can also bootstrap the cluster using IP addresses instead of domain names:
```
$ etcd -name infra0 \
-discovery-srv example.com \
-initial-advertise-peer-urls http://10.0.1.10:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster-state new \
-advertise-client-urls http://10.0.1.10:2379 \
-listen-client-urls http://10.0.1.10:2379 \
-listen-peer-urls http://10.0.1.10:2380
```
```
$ etcd -name infra1 \
-discovery-srv example.com \
-initial-advertise-peer-urls http://10.0.1.11:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster-state new \
-advertise-client-urls http://10.0.1.11:2379 \
-listen-client-urls http://10.0.1.11:2379 \
-listen-peer-urls http://10.0.1.11:2380
```
```
$ etcd -name infra2 \
-discovery-srv example.com \
-initial-advertise-peer-urls http://10.0.1.12:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster-state new \
-advertise-client-urls http://10.0.1.12:2379 \
-listen-client-urls http://10.0.1.12:2379 \
-listen-peer-urls http://10.0.1.12:2380
```
#### etcd proxy configuration
DNS SRV records can also be used to configure the list of peers for an etcd server running in proxy mode:
```
$ etcd --proxy on -discovery-srv example.com
```
# 0.4 to 2.0+ Migration Guide
In etcd 2.0 we introduced the ability to listen on more than one address and to advertise multiple addresses. This makes using etcd easier when you have complex networking, such as private and public networks on various cloud providers.
To make understanding this feature easier, we changed the naming of some flags, but we support the old flags to make the migration from the old to new version easier.
|Old Flag |New Flag |Migration Behavior |
|-----------------------|-----------------------|---------------------------------------------------------------------------------------|
|-peer-addr |-initial-advertise-peer-urls |If specified, peer-addr will be used as the only peer URL. Error if both flags specified.|
|-addr |-advertise-client-urls |If specified, addr will be used as the only client URL. Error if both flags specified.|
|-peer-bind-addr |-listen-peer-urls |If specified, peer-bind-addr will be used as the only peer bind URL. Error if both flags specified.|
|-bind-addr |-listen-client-urls |If specified, bind-addr will be used as the only client bind URL. Error if both flags specified.|
|-peers |none |Deprecated. The -initial-cluster flag provides a similar concept with different semantics. Please read this guide on cluster startup.|
|-peers-file |none |Deprecated. The -initial-cluster flag provides a similar concept with different semantics. Please read this guide on cluster startup.|

View File

@ -1,153 +0,0 @@
## Configuration Flags
etcd is configurable through command-line flags and environment variables. Options set on the command line take precedence over those from the environment.
The format of environment variable for flag `-my-flag` is `ETCD_MY_FLAG`. It applies to all flags.
To start etcd automatically using custom settings at startup in Linux, using a [systemd][systemd-intro] unit is highly recommended.
[systemd-intro]: http://freedesktop.org/wiki/Software/systemd/
### Member Flags
##### -name
+ Human-readable name for this member.
+ default: "default"
##### -data-dir
+ Path to the data directory.
+ default: "${name}.etcd"
##### -snapshot-count
+ Number of committed transactions to trigger a snapshot to disk.
+ default: "10000"
##### -heartbeat-interval
+ Time (in milliseconds) of a heartbeat interval.
+ default: "100"
##### -election-timeout
+ Time (in milliseconds) for an election to timeout.
+ default: "1000"
##### -listen-peer-urls
+ List of URLs to listen on for peer traffic.
+ default: "http://localhost:2380,http://localhost:7001"
##### -listen-client-urls
+ List of URLs to listen on for client traffic.
+ default: "http://localhost:2379,http://localhost:4001"
##### -max-snapshots
+ Maximum number of snapshot files to retain (0 is unlimited)
+ default: 5
+ The default for users on Windows is unlimited, and manual purging down to 5 (or your preference for safety) is recommended.
##### -max-wals
+ Maximum number of wal files to retain (0 is unlimited)
+ default: 5
+ The default for users on Windows is unlimited, and manual purging down to 5 (or your preference for safety) is recommended.
##### -cors
+ Comma-separated white list of origins for CORS (cross-origin resource sharing).
+ default: none
### Clustering Flags
`-initial` prefix flags are used in bootstrapping ([static bootstrap][build-cluster], [discovery-service bootstrap][discovery] or [runtime reconfiguration][reconfig]) a new member, and ignored when restarting an existing member.
`-discovery` prefix flags need to be set when using [discovery service][discovery].
##### -initial-advertise-peer-urls
+ List of this member's peer URLs to advertise to the rest of the cluster. These addresses are used for communicating etcd data around the cluster. At least one must be routable to all cluster members.
+ default: "http://localhost:2380,http://localhost:7001"
##### -initial-cluster
+ Initial cluster configuration for bootstrapping.
+ default: "default=http://localhost:2380,default=http://localhost:7001"
##### -initial-cluster-state
+ Initial cluster state ("new" or "existing").
+ default: "new"
##### -initial-cluster-token
+ Initial cluster token for the etcd cluster during bootstrap.
+ default: "etcd-cluster"
##### -advertise-client-urls
+ List of this member's client URLs to advertise to the rest of the cluster.
+ default: "http://localhost:2379,http://localhost:4001"
##### -discovery
+ Discovery URL used to bootstrap the cluster.
+ default: none
##### -discovery-srv
+ DNS srv domain used to bootstrap the cluster.
+ default: none
##### -discovery-fallback
+ Expected behavior ("exit" or "proxy") when discovery services fails.
+ default: "proxy"
##### -discovery-proxy
+ HTTP proxy to use for traffic to discovery service.
+ default: none
### Proxy Flags
`-proxy` prefix flags configures etcd to run in [proxy mode][proxy].
##### -proxy
+ Proxy mode setting ("off", "readonly" or "on").
+ default: "off"
### Security Flags
The security flags help to [build a secure etcd cluster][security].
##### -ca-file
+ Path to the client server TLS CA file.
+ default: none
##### -cert-file
+ Path to the client server TLS cert file.
+ default: none
##### -key-file
+ Path to the client server TLS key file.
+ default: none
##### -peer-ca-file
+ Path to the peer server TLS CA file.
+ default: none
##### -peer-cert-file
+ Path to the peer server TLS cert file.
+ default: none
##### -peer-key-file
+ Path to the peer server TLS key file.
+ default: none
### Unsafe Flags
Be CAUTIOUS to use unsafe flags because it will break the guarantee given by consensus protocol. For example, it may panic if other members in the cluster are still alive. Follow the instructions when using these falgs.
##### -force-new-cluster
+ Force to create a new one-member cluster. It commits configuration changes in force to remove all existing members in the cluster and add itself. It needs to be set to [restore a backup][restore].
+ default: false
### Miscellaneous Flags
##### -version
+ Print the version and exit.
+ default: false
[build-cluster]: https://github.com/coreos/etcd/blob/master/Documentation/clustering.md#static
[reconfig]: https://github.com/coreos/etcd/blob/master/Documentation/runtime-configuration.md
[discovery]: https://github.com/coreos/etcd/blob/master/Documentation/clustering.md#discovery
[proxy]: https://github.com/coreos/etcd/blob/master/Documentation/proxy.md
[security]: https://github.com/coreos/etcd/blob/master/Documentation/security.md
[restore]: https://github.com/coreos/etcd/blob/master/Documentation/admin_guide.md#restoring-a-backup

454
Documentation/demo.md Normal file
View File

@ -0,0 +1,454 @@
# Demo
This series of examples shows the basic procedures for working with an etcd cluster.
## Set up a cluster
<img src="https://storage.googleapis.com/etcd/demo/01_etcd_clustering_2016051001.gif" alt="01_etcd_clustering_2016050601"/>
On each etcd node, specify the cluster members:
```
TOKEN=token-01
CLUSTER_STATE=new
NAME_1=machine-1
NAME_2=machine-2
NAME_3=machine-3
HOST_1=10.240.0.17
HOST_2=10.240.0.18
HOST_3=10.240.0.19
CLUSTER=${NAME_1}=http://${HOST_1}:2380,${NAME_2}=http://${HOST_2}:2380,${NAME_3}=http://${HOST_3}:2380
```
Run this on each machine:
```
# For machine 1
THIS_NAME=${NAME_1}
THIS_IP=${HOST_1}
etcd --data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN}
# For machine 2
THIS_NAME=${NAME_2}
THIS_IP=${HOST_2}
etcd --data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN}
# For machine 3
THIS_NAME=${NAME_3}
THIS_IP=${HOST_3}
etcd --data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN}
```
Or use our public discovery service:
```
curl https://discovery.etcd.io/new?size=3
https://discovery.etcd.io/a81b5818e67a6ea83e9d4daea5ecbc92
# grab this token
TOKEN=token-01
CLUSTER_STATE=new
NAME_1=machine-1
NAME_2=machine-2
NAME_3=machine-3
HOST_1=10.240.0.17
HOST_2=10.240.0.18
HOST_3=10.240.0.19
DISCOVERY=https://discovery.etcd.io/a81b5818e67a6ea83e9d4daea5ecbc92
THIS_NAME=${NAME_1}
THIS_IP=${HOST_1}
etcd --data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \
--discovery ${DISCOVERY} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN}
THIS_NAME=${NAME_2}
THIS_IP=${HOST_2}
etcd --data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \
--discovery ${DISCOVERY} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN}
THIS_NAME=${NAME_3}
THIS_IP=${HOST_3}
etcd --data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \
--discovery ${DISCOVERY} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN}
```
Now etcd is ready! To connect to etcd with etcdctl:
```
export ETCDCTL_API=3
HOST_1=10.240.0.17
HOST_2=10.240.0.18
HOST_3=10.240.0.19
ENDPOINTS=$HOST_1:2379,$HOST_2:2379,$HOST_3:2379
etcdctl --endpoints=$ENDPOINTS member list
```
## Access etcd
<img src="https://storage.googleapis.com/etcd/demo/02_etcdctl_access_etcd_2016051001.gif" alt="02_etcdctl_access_etcd_2016051001"/>
`put` command to write:
```
etcdctl --endpoints=$ENDPOINTS put foo "Hello World!"
```
`get` to read from etcd:
```
etcdctl --endpoints=$ENDPOINTS get foo
etcdctl --endpoints=$ENDPOINTS --write-out="json" get foo
```
## Get by prefix
<img src="https://storage.googleapis.com/etcd/demo/03_etcdctl_get_by_prefix_2016050501.gif" alt="03_etcdctl_get_by_prefix_2016050501"/>
```
etcdctl --endpoints=$ENDPOINTS put web1 value1
etcdctl --endpoints=$ENDPOINTS put web2 value2
etcdctl --endpoints=$ENDPOINTS put web3 value3
etcdctl --endpoints=$ENDPOINTS get web --prefix
```
## Delete
<img src="https://storage.googleapis.com/etcd/demo/04_etcdctl_delete_2016050601.gif" alt="04_etcdctl_delete_2016050601"/>
```
etcdctl --endpoints=$ENDPOINTS put key myvalue
etcdctl --endpoints=$ENDPOINTS del key
etcdctl --endpoints=$ENDPOINTS put k1 value1
etcdctl --endpoints=$ENDPOINTS put k2 value2
etcdctl --endpoints=$ENDPOINTS del k --prefix
```
## Transactional write
`txn` to wrap multiple requests into one transaction:
<img src="https://storage.googleapis.com/etcd/demo/05_etcdctl_transaction_2016050501.gif" alt="05_etcdctl_transaction_2016050501"/>
```
etcdctl --endpoints=$ENDPOINTS put user1 bad
etcdctl --endpoints=$ENDPOINTS txn --interactive
compares:
value("user1") = "bad"
success requests (get, put, delete):
del user1
failure requests (get, put, delete):
put user1 good
```
## Watch
`watch` to get notified of future changes:
<img src="https://storage.googleapis.com/etcd/demo/06_etcdctl_watch_2016050501.gif" alt="06_etcdctl_watch_2016050501"/>
```
etcdctl --endpoints=$ENDPOINTS watch stock1
etcdctl --endpoints=$ENDPOINTS put stock1 1000
etcdctl --endpoints=$ENDPOINTS watch stock --prefix
etcdctl --endpoints=$ENDPOINTS put stock1 10
etcdctl --endpoints=$ENDPOINTS put stock2 20
```
## Lease
`lease` to write with TTL:
<img src="https://storage.googleapis.com/etcd/demo/07_etcdctl_lease_2016050501.gif" alt="07_etcdctl_lease_2016050501"/>
```
etcdctl --endpoints=$ENDPOINTS lease grant 300
# lease 2be7547fbc6a5afa granted with TTL(300s)
etcdctl --endpoints=$ENDPOINTS put sample value --lease=2be7547fbc6a5afa
etcdctl --endpoints=$ENDPOINTS get sample
etcdctl --endpoints=$ENDPOINTS lease keep-alive 2be7547fbc6a5afa
etcdctl --endpoints=$ENDPOINTS lease revoke 2be7547fbc6a5afa
# or after 300 seconds
etcdctl --endpoints=$ENDPOINTS get sample
```
## Distributed locks
`lock` for distributed lock:
<img src="https://storage.googleapis.com/etcd/demo/08_etcdctl_lock_2016050501.gif" alt="08_etcdctl_lock_2016050501"/>
```
etcdctl --endpoints=$ENDPOINTS lock mutex1
# another client with the same name blocks
etcdctl --endpoints=$ENDPOINTS lock mutex1
```
## Elections
`elect` for leader election:
<img src="https://storage.googleapis.com/etcd/demo/09_etcdctl_elect_2016050501.gif" alt="09_etcdctl_elect_2016050501"/>
```
etcdctl --endpoints=$ENDPOINTS elect one p1
# another client with the same name blocks
etcdctl --endpoints=$ENDPOINTS elect one p2
```
## Cluster status
Specify the initial cluster configuration for each machine:
<img src="https://storage.googleapis.com/etcd/demo/10_etcdctl_endpoint_2016050501.gif" alt="10_etcdctl_endpoint_2016050501"/>
```
etcdctl --write-out=table --endpoints=$ENDPOINTS endpoint status
+------------------+------------------+---------+---------+-----------+-----------+------------+
| ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | RAFT TERM | RAFT INDEX |
+------------------+------------------+---------+---------+-----------+-----------+------------+
| 10.240.0.17:2379 | 4917a7ab173fabe7 | 3.0.0 | 45 kB | true | 4 | 16726 |
| 10.240.0.18:2379 | 59796ba9cd1bcd72 | 3.0.0 | 45 kB | false | 4 | 16726 |
| 10.240.0.19:2379 | 94df724b66343e6c | 3.0.0 | 45 kB | false | 4 | 16726 |
+------------------+------------------+---------+---------+-----------+-----------+------------+
```
```
etcdctl --endpoints=$ENDPOINTS endpoint health
10.240.0.17:2379 is healthy: successfully committed proposal: took = 3.345431ms
10.240.0.19:2379 is healthy: successfully committed proposal: took = 3.767967ms
10.240.0.18:2379 is healthy: successfully committed proposal: took = 4.025451ms
```
## Snapshot
`snapshot` to save point-in-time snapshot of etcd database:
<img src="https://storage.googleapis.com/etcd/demo/11_etcdctl_snapshot_2016051001.gif" alt="11_etcdctl_snapshot_2016051001"/>
```
etcdctl --endpoints=$ENDPOINTS snapshot save my.db
Snapshot saved at my.db
```
```
etcdctl --write-out=table --endpoints=$ENDPOINTS snapshot status my.db
+---------+----------+------------+------------+
| HASH | REVISION | TOTAL KEYS | TOTAL SIZE |
+---------+----------+------------+------------+
| c55e8b8 | 9 | 13 | 25 kB |
+---------+----------+------------+------------+
```
## Migrate
`migrate` to transform etcd v2 to v3 data:
<img src="https://storage.googleapis.com/etcd/demo/12_etcdctl_migrate_2016061602.gif" alt="12_etcdctl_migrate_2016061602"/>
```
# write key in etcd version 2 store
export ETCDCTL_API=2
etcdctl --endpoints=http://$ENDPOINT set foo bar
# read key in etcd v2
etcdctl --endpoints=$ENDPOINTS --output="json" get foo
# stop etcd node to migrate, one by one
# migrate v2 data
export ETCDCTL_API=3
etcdctl --endpoints=$ENDPOINT migrate --data-dir="default.etcd" --wal-dir="default.etcd/member/wal"
# restart etcd node after migrate, one by one
# confirm that the key got migrated
etcdctl --endpoints=$ENDPOINTS get /foo
```
## Member
`member` to add,remove,update membership:
<img src="https://storage.googleapis.com/etcd/demo/13_etcdctl_member_2016062301.gif" alt="13_etcdctl_member_2016062301"/>
```
# For each machine
TOKEN=my-etcd-token-1
CLUSTER_STATE=new
NAME_1=etcd-node-1
NAME_2=etcd-node-2
NAME_3=etcd-node-3
HOST_1=10.240.0.13
HOST_2=10.240.0.14
HOST_3=10.240.0.15
CLUSTER=${NAME_1}=http://${HOST_1}:2380,${NAME_2}=http://${HOST_2}:2380,${NAME_3}=http://${HOST_3}:2380
# For node 1
THIS_NAME=${NAME_1}
THIS_IP=${HOST_1}
etcd --data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 \
--listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 \
--listen-client-urls http://${THIS_IP}:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} \
--initial-cluster-token ${TOKEN}
# For node 2
THIS_NAME=${NAME_2}
THIS_IP=${HOST_2}
etcd --data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 \
--listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 \
--listen-client-urls http://${THIS_IP}:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} \
--initial-cluster-token ${TOKEN}
# For node 3
THIS_NAME=${NAME_3}
THIS_IP=${HOST_3}
etcd --data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 \
--listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 \
--listen-client-urls http://${THIS_IP}:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} \
--initial-cluster-token ${TOKEN}
```
Then replace a member with `member remove` and `member add` commands:
```
# get member ID
export ETCDCTL_API=3
HOST_1=10.240.0.13
HOST_2=10.240.0.14
HOST_3=10.240.0.15
etcdctl --endpoints=${HOST_1}:2379,${HOST_2}:2379,${HOST_3}:2379 member list
# remove the member
MEMBER_ID=278c654c9a6dfd3b
etcdctl --endpoints=${HOST_1}:2379,${HOST_2}:2379,${HOST_3}:2379 \
member remove ${MEMBER_ID}
# add a new member (node 4)
export ETCDCTL_API=3
NAME_1=etcd-node-1
NAME_2=etcd-node-2
NAME_4=etcd-node-4
HOST_1=10.240.0.13
HOST_2=10.240.0.14
HOST_4=10.240.0.16 # new member
etcdctl --endpoints=${HOST_1}:2379,${HOST_2}:2379 \
member add ${NAME_4} \
--peer-urls=http://${HOST_4}:2380
```
Next, start the new member with `--initial-cluster-state existing` flag:
```
# [WARNING] If the new member starts from the same disk space,
# make sure to remove the data directory of the old member
#
# restart with 'existing' flag
TOKEN=my-etcd-token-1
CLUSTER_STATE=existing
NAME_1=etcd-node-1
NAME_2=etcd-node-2
NAME_4=etcd-node-4
HOST_1=10.240.0.13
HOST_2=10.240.0.14
HOST_4=10.240.0.16 # new member
CLUSTER=${NAME_1}=http://${HOST_1}:2380,${NAME_2}=http://${HOST_2}:2380,${NAME_4}=http://${HOST_4}:2380
THIS_NAME=${NAME_4}
THIS_IP=${HOST_4}
etcd --data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 \
--listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 \
--listen-client-urls http://${THIS_IP}:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} \
--initial-cluster-token ${TOKEN}
```
## Auth
`auth`,`user`,`role` for authentication:
<img src="https://storage.googleapis.com/etcd/demo/14_etcdctl_auth_2016062301.gif" alt="14_etcdctl_auth_2016062301"/>
```
export ETCDCTL_API=3
ENDPOINTS=localhost:2379
etcdctl --endpoints=${ENDPOINTS} role add root
etcdctl --endpoints=${ENDPOINTS} role grant-permission root readwrite foo
etcdctl --endpoints=${ENDPOINTS} role get root
etcdctl --endpoints=${ENDPOINTS} user add root
etcdctl --endpoints=${ENDPOINTS} user grant-role root root
etcdctl --endpoints=${ENDPOINTS} user get root
etcdctl --endpoints=${ENDPOINTS} auth enable
# now all client requests go through auth
etcdctl --endpoints=${ENDPOINTS} --user=root:123 put foo bar
etcdctl --endpoints=${ENDPOINTS} get foo
etcdctl --endpoints=${ENDPOINTS} --user=root:123 get foo
etcdctl --endpoints=${ENDPOINTS} --user=root:123 get foo1
```

View File

@ -0,0 +1,53 @@
## Why grpc-gateway
etcd v3 uses [gRPC][grpc] for its messaging protocol. The etcd project includes a gRPC-based [Go client][go-client] and a command line utility, [etcdctl][etcdctl], for communicating with an etcd cluster through gRPC. For languages with no gRPC support, etcd provides a JSON [grpc-gateway][grpc-gateway]. This gateway serves a RESTful proxy that translates HTTP/JSON requests into gRPC messages.
## Using grpc-gateway
The gateway accepts a [JSON mapping][json-mapping] for etcd's [protocol buffer][api-ref] message definitions. Note that `key` and `value` fields are defined as byte arrays and therefore must be base64 encoded in JSON.
Use `curl` to put and get a key:
```bash
<<COMMENT
https://www.base64encode.org/
foo is 'Zm9v' in Base64
bar is 'YmFy'
COMMENT
curl -L http://localhost:2379/v3alpha/kv/put \
-X POST -d '{"key": "Zm9v", "value": "YmFy"}'
# {"header":{"cluster_id":"12585971608760269493","member_id":"13847567121247652255","revision":"2","raft_term":"3"}}
curl -L http://localhost:2379/v3alpha/kv/range \
-X POST -d '{"key": "Zm9v"}'
# {"header":{"cluster_id":"12585971608760269493","member_id":"13847567121247652255","revision":"2","raft_term":"3"},"kvs":[{"key":"Zm9v","create_revision":"2","mod_revision":"2","version":"1","value":"YmFy"}],"count":"1"}
```
Use `curl` to watch a key:
```bash
curl http://localhost:2379/v3alpha/watch \
-X POST -d '{"create_request": {"key":"Zm9v"} }' &
# {"result":{"header":{"cluster_id":"12585971608760269493","member_id":"13847567121247652255","revision":"1","raft_term":"2"},"created":true}}
curl -L http://localhost:2379/v3alpha/kv/put \
-X POST -d '{"key": "Zm9v", "value": "YmFy"}' >/dev/null 2>&1
# {"result":{"header":{"cluster_id":"12585971608760269493","member_id":"13847567121247652255","revision":"2","raft_term":"2"},"events":[{"kv":{"key":"Zm9v","create_revision":"2","mod_revision":"2","version":"1","value":"YmFy"}}]}}
```
## Swagger
Generated [Swagger][swagger] API definitions can be found at [rpc.swagger.json][swagger-doc].
[api-ref]: ./api_reference_v3.md
[go-client]: https://github.com/coreos/etcd/tree/master/clientv3
[etcdctl]: https://github.com/coreos/etcd/tree/master/etcdctl
[grpc]: http://www.grpc.io/
[grpc-gateway]: https://github.com/grpc-ecosystem/grpc-gateway
[json-mapping]: https://developers.google.com/protocol-buffers/docs/proto3#json
[swagger]: http://swagger.io/
[swagger-doc]: apispec/swagger/rpc.swagger.json

View File

@ -0,0 +1,878 @@
### etcd API Reference
This is a generated documentation. Please read the proto files for more.
##### service `Auth` (etcdserver/etcdserverpb/rpc.proto)
| Method | Request Type | Response Type | Description |
| ------ | ------------ | ------------- | ----------- |
| AuthEnable | AuthEnableRequest | AuthEnableResponse | AuthEnable enables authentication. |
| AuthDisable | AuthDisableRequest | AuthDisableResponse | AuthDisable disables authentication. |
| Authenticate | AuthenticateRequest | AuthenticateResponse | Authenticate processes an authenticate request. |
| UserAdd | AuthUserAddRequest | AuthUserAddResponse | UserAdd adds a new user. |
| UserGet | AuthUserGetRequest | AuthUserGetResponse | UserGet gets detailed user information. |
| UserList | AuthUserListRequest | AuthUserListResponse | UserList gets a list of all users. |
| UserDelete | AuthUserDeleteRequest | AuthUserDeleteResponse | UserDelete deletes a specified user. |
| UserChangePassword | AuthUserChangePasswordRequest | AuthUserChangePasswordResponse | UserChangePassword changes the password of a specified user. |
| UserGrantRole | AuthUserGrantRoleRequest | AuthUserGrantRoleResponse | UserGrant grants a role to a specified user. |
| UserRevokeRole | AuthUserRevokeRoleRequest | AuthUserRevokeRoleResponse | UserRevokeRole revokes a role of specified user. |
| RoleAdd | AuthRoleAddRequest | AuthRoleAddResponse | RoleAdd adds a new role. |
| RoleGet | AuthRoleGetRequest | AuthRoleGetResponse | RoleGet gets detailed role information. |
| RoleList | AuthRoleListRequest | AuthRoleListResponse | RoleList gets lists of all roles. |
| RoleDelete | AuthRoleDeleteRequest | AuthRoleDeleteResponse | RoleDelete deletes a specified role. |
| RoleGrantPermission | AuthRoleGrantPermissionRequest | AuthRoleGrantPermissionResponse | RoleGrantPermission grants a permission of a specified key or range to a specified role. |
| RoleRevokePermission | AuthRoleRevokePermissionRequest | AuthRoleRevokePermissionResponse | RoleRevokePermission revokes a key or range permission of a specified role. |
##### service `Cluster` (etcdserver/etcdserverpb/rpc.proto)
| Method | Request Type | Response Type | Description |
| ------ | ------------ | ------------- | ----------- |
| MemberAdd | MemberAddRequest | MemberAddResponse | MemberAdd adds a member into the cluster. |
| MemberRemove | MemberRemoveRequest | MemberRemoveResponse | MemberRemove removes an existing member from the cluster. |
| MemberUpdate | MemberUpdateRequest | MemberUpdateResponse | MemberUpdate updates the member configuration. |
| MemberList | MemberListRequest | MemberListResponse | MemberList lists all the members in the cluster. |
##### service `KV` (etcdserver/etcdserverpb/rpc.proto)
for grpc-gateway
| Method | Request Type | Response Type | Description |
| ------ | ------------ | ------------- | ----------- |
| Range | RangeRequest | RangeResponse | Range gets the keys in the range from the key-value store. |
| Put | PutRequest | PutResponse | Put puts the given key into the key-value store. A put request increments the revision of the key-value store and generates one event in the event history. |
| DeleteRange | DeleteRangeRequest | DeleteRangeResponse | DeleteRange deletes the given range from the key-value store. A delete request increments the revision of the key-value store and generates a delete event in the event history for every deleted key. |
| Txn | TxnRequest | TxnResponse | Txn processes multiple requests in a single transaction. A txn request increments the revision of the key-value store and generates events with the same revision for every completed request. It is not allowed to modify the same key several times within one txn. |
| Compact | CompactionRequest | CompactionResponse | Compact compacts the event history in the etcd key-value store. The key-value store should be periodically compacted or the event history will continue to grow indefinitely. |
##### service `Lease` (etcdserver/etcdserverpb/rpc.proto)
| Method | Request Type | Response Type | Description |
| ------ | ------------ | ------------- | ----------- |
| LeaseGrant | LeaseGrantRequest | LeaseGrantResponse | LeaseGrant creates a lease which expires if the server does not receive a keepAlive within a given time to live period. All keys attached to the lease will be expired and deleted if the lease expires. Each expired key generates a delete event in the event history. |
| LeaseRevoke | LeaseRevokeRequest | LeaseRevokeResponse | LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. |
| LeaseKeepAlive | LeaseKeepAliveRequest | LeaseKeepAliveResponse | LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client to the server and streaming keep alive responses from the server to the client. |
| LeaseTimeToLive | LeaseTimeToLiveRequest | LeaseTimeToLiveResponse | LeaseTimeToLive retrieves lease information. |
##### service `Maintenance` (etcdserver/etcdserverpb/rpc.proto)
| Method | Request Type | Response Type | Description |
| ------ | ------------ | ------------- | ----------- |
| Alarm | AlarmRequest | AlarmResponse | Alarm activates, deactivates, and queries alarms regarding cluster health. |
| Status | StatusRequest | StatusResponse | Status gets the status of the member. |
| Defragment | DefragmentRequest | DefragmentResponse | Defragment defragments a member's backend database to recover storage space. |
| Hash | HashRequest | HashResponse | Hash returns the hash of the local KV state for consistency checking purpose. This is designed for testing; do not use this in production when there are ongoing transactions. |
| Snapshot | SnapshotRequest | SnapshotResponse | Snapshot sends a snapshot of the entire backend from a member over a stream to a client. |
##### service `Watch` (etcdserver/etcdserverpb/rpc.proto)
| Method | Request Type | Response Type | Description |
| ------ | ------------ | ------------- | ----------- |
| Watch | WatchRequest | WatchResponse | Watch watches for events happening or that have happened. Both input and output are streams; the input stream is for creating and canceling watchers and the output stream sends events. One watch RPC can watch on multiple key ranges, streaming events for several watches at once. The entire event history can be watched starting from the last compaction revision. |
##### message `AlarmMember` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| memberID | memberID is the ID of the member associated with the raised alarm. | uint64 |
| alarm | alarm is the type of alarm which has been raised. | AlarmType |
##### message `AlarmRequest` (etcdserver/etcdserverpb/rpc.proto)
default, used to query if any alarm is active space quota is exhausted
| Field | Description | Type |
| ----- | ----------- | ---- |
| action | action is the kind of alarm request to issue. The action may GET alarm statuses, ACTIVATE an alarm, or DEACTIVATE a raised alarm. | AlarmAction |
| memberID | memberID is the ID of the member associated with the alarm. If memberID is 0, the alarm request covers all members. | uint64 |
| alarm | alarm is the type of alarm to consider for this request. | AlarmType |
##### message `AlarmResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| alarms | alarms is a list of alarms associated with the alarm request. | (slice of) AlarmMember |
##### message `AuthDisableRequest` (etcdserver/etcdserverpb/rpc.proto)
Empty field.
##### message `AuthDisableResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthEnableRequest` (etcdserver/etcdserverpb/rpc.proto)
Empty field.
##### message `AuthEnableResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthRoleAddRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| name | name is the name of the role to add to the authentication system. | string |
##### message `AuthRoleAddResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthRoleDeleteRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| role | | string |
##### message `AuthRoleDeleteResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthRoleGetRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| role | | string |
##### message `AuthRoleGetResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| perm | | (slice of) authpb.Permission |
##### message `AuthRoleGrantPermissionRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| name | name is the name of the role which will be granted the permission. | string |
| perm | perm is the permission to grant to the role. | authpb.Permission |
##### message `AuthRoleGrantPermissionResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthRoleListRequest` (etcdserver/etcdserverpb/rpc.proto)
Empty field.
##### message `AuthRoleListResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| roles | | (slice of) string |
##### message `AuthRoleRevokePermissionRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| role | | string |
| key | | string |
| range_end | | string |
##### message `AuthRoleRevokePermissionResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthUserAddRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| name | | string |
| password | | string |
##### message `AuthUserAddResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthUserChangePasswordRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| name | name is the name of the user whose password is being changed. | string |
| password | password is the new password for the user. | string |
##### message `AuthUserChangePasswordResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthUserDeleteRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| name | name is the name of the user to delete. | string |
##### message `AuthUserDeleteResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthUserGetRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| name | | string |
##### message `AuthUserGetResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| roles | | (slice of) string |
##### message `AuthUserGrantRoleRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| user | user is the name of the user which should be granted a given role. | string |
| role | role is the name of the role to grant to the user. | string |
##### message `AuthUserGrantRoleResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthUserListRequest` (etcdserver/etcdserverpb/rpc.proto)
Empty field.
##### message `AuthUserListResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| users | | (slice of) string |
##### message `AuthUserRevokeRoleRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| name | | string |
| role | | string |
##### message `AuthUserRevokeRoleResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `AuthenticateRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| name | | string |
| password | | string |
##### message `AuthenticateResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| token | token is an authorized token that can be used in succeeding RPCs | string |
##### message `CompactionRequest` (etcdserver/etcdserverpb/rpc.proto)
CompactionRequest compacts the key-value store up to a given revision. All superseded keys with a revision less than the compaction revision will be removed.
| Field | Description | Type |
| ----- | ----------- | ---- |
| revision | revision is the key-value store revision for the compaction operation. | int64 |
| physical | physical is set so the RPC will wait until the compaction is physically applied to the local database such that compacted entries are totally removed from the backend database. | bool |
##### message `CompactionResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `Compare` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| result | result is logical comparison operation for this comparison. | CompareResult |
| target | target is the key-value field to inspect for the comparison. | CompareTarget |
| key | key is the subject key for the comparison operation. | bytes |
| target_union | | oneof |
| version | version is the version of the given key | int64 |
| create_revision | create_revision is the creation revision of the given key | int64 |
| mod_revision | mod_revision is the last modified revision of the given key. | int64 |
| value | value is the value of the given key, in bytes. | bytes |
##### message `DefragmentRequest` (etcdserver/etcdserverpb/rpc.proto)
Empty field.
##### message `DefragmentResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `DeleteRangeRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| key | key is the first key to delete in the range. | bytes |
| range_end | range_end is the key following the last key to delete for the range [key, range_end). If range_end is not given, the range is defined to contain only the key argument. If range_end is one bit larger than the given key, then the range is all the all keys with the prefix (the given key). If range_end is '\0', the range is all keys greater than or equal to the key argument. | bytes |
| prev_kv | If prev_kv is set, etcd gets the previous key-value pairs before deleting it. The previous key-value pairs will be returned in the delte response. | bool |
##### message `DeleteRangeResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| deleted | deleted is the number of keys deleted by the delete range request. | int64 |
| prev_kvs | if prev_kv is set in the request, the previous key-value pairs will be returned. | (slice of) mvccpb.KeyValue |
##### message `HashRequest` (etcdserver/etcdserverpb/rpc.proto)
Empty field.
##### message `HashResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| hash | hash is the hash value computed from the responding member's key-value store. | uint32 |
##### message `LeaseGrantRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| TTL | TTL is the advisory time-to-live in seconds. | int64 |
| ID | ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. | int64 |
##### message `LeaseGrantResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| ID | ID is the lease ID for the granted lease. | int64 |
| TTL | TTL is the server chosen lease time-to-live in seconds. | int64 |
| error | | string |
##### message `LeaseKeepAliveRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| ID | ID is the lease ID for the lease to keep alive. | int64 |
##### message `LeaseKeepAliveResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| ID | ID is the lease ID from the keep alive request. | int64 |
| TTL | TTL is the new time-to-live for the lease. | int64 |
##### message `LeaseRevokeRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| ID | ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. | int64 |
##### message `LeaseRevokeResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `LeaseTimeToLiveRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| ID | ID is the lease ID for the lease. | int64 |
| keys | keys is true to query all the keys attached to this lease. | bool |
##### message `LeaseTimeToLiveResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| ID | ID is the lease ID from the keep alive request. | int64 |
| TTL | TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds. | int64 |
| grantedTTL | GrantedTTL is the initial granted time in seconds upon lease creation/renewal. | int64 |
| keys | Keys is the list of keys attached to this lease. | (slice of) bytes |
##### message `Member` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| ID | ID is the member ID for this member. | uint64 |
| name | name is the human-readable name of the member. If the member is not started, the name will be an empty string. | string |
| peerURLs | peerURLs is the list of URLs the member exposes to the cluster for communication. | (slice of) string |
| clientURLs | clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty. | (slice of) string |
##### message `MemberAddRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| peerURLs | peerURLs is the list of URLs the added member will use to communicate with the cluster. | (slice of) string |
##### message `MemberAddResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| member | member is the member information for the added member. | Member |
##### message `MemberListRequest` (etcdserver/etcdserverpb/rpc.proto)
Empty field.
##### message `MemberListResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| members | members is a list of all members associated with the cluster. | (slice of) Member |
##### message `MemberRemoveRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| ID | ID is the member ID of the member to remove. | uint64 |
##### message `MemberRemoveResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `MemberUpdateRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| ID | ID is the member ID of the member to update. | uint64 |
| peerURLs | peerURLs is the new list of URLs the member will use to communicate with the cluster. | (slice of) string |
##### message `MemberUpdateResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
##### message `PutRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| key | key is the key, in bytes, to put into the key-value store. | bytes |
| value | value is the value, in bytes, to associate with the key in the key-value store. | bytes |
| lease | lease is the lease ID to associate with the key in the key-value store. A lease value of 0 indicates no lease. | int64 |
| prev_kv | If prev_kv is set, etcd gets the previous key-value pair before changing it. The previous key-value pair will be returned in the put response. | bool |
##### message `PutResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| prev_kv | if prev_kv is set in the request, the previous key-value pair will be returned. | mvccpb.KeyValue |
##### message `RangeRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| key | default, no sorting lowest target value first highest target value first key is the first key for the range. If range_end is not given, the request only looks up key. | bytes |
| range_end | range_end is the upper bound on the requested range [key, range_end). If range_end is '\0', the range is all keys >= key. If the range_end is one bit larger than the given key, then the range requests get the all keys with the prefix (the given key). If both key and range_end are '\0', then range requests returns all keys. | bytes |
| limit | limit is a limit on the number of keys returned for the request. | int64 |
| revision | revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response. | int64 |
| sort_order | sort_order is the order for returned sorted results. | SortOrder |
| sort_target | sort_target is the key-value field to use for sorting. | SortTarget |
| serializable | serializable sets the range request to use serializable member-local reads. Range requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable range request is served locally without needing to reach consensus with other nodes in the cluster. | bool |
| keys_only | keys_only when set returns only the keys and not the values. | bool |
| count_only | count_only when set returns only the count of the keys in the range. | bool |
| min_mod_revision | min_mod_revision is the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away. | int64 |
| max_mod_revision | max_mod_revision is the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away. | int64 |
| min_create_revision | min_create_revision is the lower bound for returned key create revisions; all keys with lesser create trevisions will be filtered away. | int64 |
| max_create_revision | max_create_revision is the upper bound for returned key create revisions; all keys with greater create revisions will be filtered away. | int64 |
##### message `RangeResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| kvs | kvs is the list of key-value pairs matched by the range request. kvs is empty when count is requested. | (slice of) mvccpb.KeyValue |
| more | more indicates if there are more keys to return in the requested range. | bool |
| count | count is set to the number of keys within the range when requested. | int64 |
##### message `RequestOp` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| request | request is a union of request types accepted by a transaction. | oneof |
| request_range | | RangeRequest |
| request_put | | PutRequest |
| request_delete_range | | DeleteRangeRequest |
##### message `ResponseHeader` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| cluster_id | cluster_id is the ID of the cluster which sent the response. | uint64 |
| member_id | member_id is the ID of the member which sent the response. | uint64 |
| revision | revision is the key-value store revision when the request was applied. | int64 |
| raft_term | raft_term is the raft term when the request was applied. | uint64 |
##### message `ResponseOp` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| response | response is a union of response types returned by a transaction. | oneof |
| response_range | | RangeResponse |
| response_put | | PutResponse |
| response_delete_range | | DeleteRangeResponse |
##### message `SnapshotRequest` (etcdserver/etcdserverpb/rpc.proto)
Empty field.
##### message `SnapshotResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | header has the current key-value store information. The first header in the snapshot stream indicates the point in time of the snapshot. | ResponseHeader |
| remaining_bytes | remaining_bytes is the number of blob bytes to be sent after this message | uint64 |
| blob | blob contains the next chunk of the snapshot in the snapshot stream. | bytes |
##### message `StatusRequest` (etcdserver/etcdserverpb/rpc.proto)
Empty field.
##### message `StatusResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| version | version is the cluster protocol version used by the responding member. | string |
| dbSize | dbSize is the size of the backend database, in bytes, of the responding member. | int64 |
| leader | leader is the member ID which the responding member believes is the current leader. | uint64 |
| raftIndex | raftIndex is the current raft index of the responding member. | uint64 |
| raftTerm | raftTerm is the current raft term of the responding member. | uint64 |
##### message `TxnRequest` (etcdserver/etcdserverpb/rpc.proto)
From google paxosdb paper: Our implementation hinges around a powerful primitive which we call MultiOp. All other database operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically and consists of three components: 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check for the absence or presence of a value, or compare with a given value. Two different tests in the guard may apply to the same or different entries in the database. All tests in the guard are applied and MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise it executes f op (see item 3 below). 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or lookup operation, and applies to a single database entry. Two different operations in the list may apply to the same or different entries in the database. These operations are executed if guard evaluates to true. 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false.
| Field | Description | Type |
| ----- | ----------- | ---- |
| compare | compare is a list of predicates representing a conjunction of terms. If the comparisons succeed, then the success requests will be processed in order, and the response will contain their respective responses in order. If the comparisons fail, then the failure requests will be processed in order, and the response will contain their respective responses in order. | (slice of) Compare |
| success | success is a list of requests which will be applied when compare evaluates to true. | (slice of) RequestOp |
| failure | failure is a list of requests which will be applied when compare evaluates to false. | (slice of) RequestOp |
##### message `TxnResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| succeeded | succeeded is set to true if the compare evaluated to true or false otherwise. | bool |
| responses | responses is a list of responses corresponding to the results from applying success if succeeded is true or failure if succeeded is false. | (slice of) ResponseOp |
##### message `WatchCancelRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| watch_id | watch_id is the watcher id to cancel so that no more events are transmitted. | int64 |
##### message `WatchCreateRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| key | key is the key to register for watching. | bytes |
| range_end | range_end is the end of the range [key, range_end) to watch. If range_end is not given, only the key argument is watched. If range_end is equal to '\0', all keys greater than or equal to the key argument are watched. If the range_end is one bit larger than the given key, then all keys with the prefix (the given key) will be watched. | bytes |
| start_revision | start_revision is an optional revision to watch from (inclusive). No start_revision is "now". | int64 |
| progress_notify | progress_notify is set so that the etcd server will periodically send a WatchResponse with no events to the new watcher if there are no recent events. It is useful when clients wish to recover a disconnected watcher starting from a recent known revision. The etcd server may decide how often it will send notifications based on current load. | bool |
| filters | filter out put event. filter out delete event. filters filter the events at server side before it sends back to the watcher. | (slice of) FilterType |
| prev_kv | If prev_kv is set, created watcher gets the previous KV before the event happens. If the previous KV is already compacted, nothing will be returned. | bool |
##### message `WatchRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| request_union | request_union is a request to either create a new watcher or cancel an existing watcher. | oneof |
| create_request | | WatchCreateRequest |
| cancel_request | | WatchCancelRequest |
##### message `WatchResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| watch_id | watch_id is the ID of the watcher that corresponds to the response. | int64 |
| created | created is set to true if the response is for a create watch request. The client should record the watch_id and expect to receive events for the created watcher from the same stream. All events sent to the created watcher will attach with the same watch_id. | bool |
| canceled | canceled is set to true if the response is for a cancel watch request. No further events will be sent to the canceled watcher. | bool |
| compact_revision | compact_revision is set to the minimum index if a watcher tries to watch at a compacted index. This happens when creating a watcher at a compacted revision or the watcher cannot catch up with the progress of the key-value store. The client should treat the watcher as canceled and should not try to create any watcher with the same start_revision again. | int64 |
| events | | (slice of) mvccpb.Event |
##### message `Event` (mvcc/mvccpb/kv.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| type | type is the kind of event. If type is a PUT, it indicates new data has been stored to the key. If type is a DELETE, it indicates the key was deleted. | EventType |
| kv | kv holds the KeyValue for the event. A PUT event contains current kv pair. A PUT event with kv.Version=1 indicates the creation of a key. A DELETE/EXPIRE event contains the deleted key with its modification revision set to the revision of deletion. | KeyValue |
| prev_kv | prev_kv holds the key-value pair before the event happens. | KeyValue |
##### message `KeyValue` (mvcc/mvccpb/kv.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| key | key is the key in bytes. An empty key is not allowed. | bytes |
| create_revision | create_revision is the revision of last creation on this key. | int64 |
| mod_revision | mod_revision is the revision of last modification on this key. | int64 |
| version | version is the version of the key. A deletion resets the version to zero and any modification of the key increases its version. | int64 |
| value | value is the value held by the key, in bytes. | bytes |
| lease | lease is the ID of the lease that attached to key. When the attached lease expires, the key will be deleted. If lease is 0, then no lease is attached to the key. | int64 |
##### message `Lease` (lease/leasepb/lease.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| ID | | int64 |
| TTL | | int64 |
##### message `LeaseInternalRequest` (lease/leasepb/lease.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| LeaseTimeToLiveRequest | | etcdserverpb.LeaseTimeToLiveRequest |
##### message `LeaseInternalResponse` (lease/leasepb/lease.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| LeaseTimeToLiveResponse | | etcdserverpb.LeaseTimeToLiveResponse |
##### message `Permission` (auth/authpb/auth.proto)
Permission is a single entity
| Field | Description | Type |
| ----- | ----------- | ---- |
| permType | | Type |
| key | | bytes |
| range_end | | bytes |
##### message `Role` (auth/authpb/auth.proto)
Role is a single entry in the bucket authRoles
| Field | Description | Type |
| ----- | ----------- | ---- |
| name | | bytes |
| keyPermission | | (slice of) Permission |
##### message `User` (auth/authpb/auth.proto)
User is a single entry in the bucket authUsers
| Field | Description | Type |
| ----- | ----------- | ---- |
| name | | bytes |
| password | | bytes |
| roles | | (slice of) string |

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
# Experimental APIs and features
For the most part, the etcd project is stable, but we are still moving fast! We believe in the release fast philosophy. We want to get early feedback on features still in development and stabilizing. Thus, there are, and will be more, experimental features and APIs. We plan to improve these features based on the early feedback from the community, or abandon them if there is little interest, in the next few releases. Please do not rely on any experimental features or APIs in production environment.
## The current experimental API/features are:
- [gateway][gateway]: beta, to be stable in 3.2 release
- [gRPC proxy][grpc-proxy]: alpha, to be stable in 3.2 release
[gateway]: ../op-guide/gateway.md
[grpc-proxy]: ../op-guide/grpc_proxy.md

View File

@ -0,0 +1,65 @@
# gRPC naming and discovery
etcd provides a gRPC resolver to support an alternative name system that fetches endpoints from etcd for discovering gRPC services. The underlying mechanism is based on watching updates to keys prefixed with the service name.
## Using etcd discovery with go-grpc
The etcd client provides a gRPC resolver for resolving gRPC endpoints with an etcd backend. The resolver is initialized with an etcd client and given a target for resolution:
```go
import (
"github.com/coreos/etcd/clientv3"
etcdnaming "github.com/coreos/etcd/clientv3/naming"
"google.golang.org/grpc"
)
...
cli, cerr := clientv3.NewFromURL("http://localhost:2379")
r := &etcdnaming.GRPCResolver{Client: cli}
b := grpc.RoundRobin(r)
conn, gerr := grpc.Dial("my-service", grpc.WithBalancer(b))
```
## Managing service endpoints
The etcd resolver treats all keys under the prefix of the resolution target following a "/" (e.g., "my-service/") with JSON-encoded go-grpc `naming.Update` values as potential service endpoints. Endpoints are added to the service by creating new keys and removed from the service by deleting keys.
### Adding an endpoint
New endpoints can be added to the service through `etcdctl`:
```sh
ETCDCTL_API=3 etcdctl put my-service/1.2.3.4 '{"Addr":"1.2.3.4","Metadata":"..."}'
```
The etcd client's `GRPCResolver.Update` method can also register new endpoints with a key matching the `Addr`:
```go
r.Update(context.TODO(), "my-service", naming.Update{Op: naming.Add, Addr: "1.2.3.4", Metadata: "..."})
```
### Deleting an endpoint
Hosts can be deleted from the service through `etcdctl`:
```sh
ETCDCTL_API=3 etcdctl del my-service/1.2.3.4
```
The etcd client's `GRPCResolver.Update` method also supports deleting endpoints:
```go
r.Update(context.TODO(), "my-service", naming.Update{Op: naming.Delete, Addr: "1.2.3.4"})
```
### Registering an endpoint with a lease
Registering an endpoint with a lease ensures that if the host can't maintain a keepalive heartbeat (e.g., its machine fails), it will be removed from the service:
```sh
lease=`ETCDCTL_API=3 etcdctl lease grant 5 | cut -f2 -d' '`
ETCDCTL_API=3 etcdctl put --lease=$lease my-service/1.2.3.4 '{"Addr":"1.2.3.4","Metadata":"..."}'
ETCDCTL_API=3 etcdctl lease keep-alive $lease
```

View File

@ -0,0 +1,475 @@
# Interacting with etcd
Users mostly interact with etcd by putting or getting the value of a key. This section describes how to do that by using etcdctl, a command line tool for interacting with etcd server. The concepts described here should apply to the gRPC APIs or client library APIs.
By default, etcdctl talks to the etcd server with the v2 API for backward compatibility. For etcdctl to speak to etcd using the v3 API, the API version must be set to version 3 via the `ETCDCTL_API` environment variable.
```bash
export ETCDCTL_API=3
```
## Find versions
etcdctl version and Server API version can be useful in finding the appropriate commands to be used for performing various opertions on etcd.
Here is the command to find the versions:
```bash
$ etcdctl version
etcdctl version: 3.1.0-alpha.0+git
API version: 3.1
```
## Write a key
Applications store keys into the etcd cluster by writing to keys. Every stored key is replicated to all etcd cluster members through the Raft protocol to achieve consistency and reliability.
Here is the command to set the value of key `foo` to `bar`:
```bash
$ etcdctl put foo bar
OK
```
Also a key can be set for a specified interval of time by attaching lease to it.
Here is the command to set the value of key `foo1` to `bar1` for 10s.
```bash
$ etcdctl put foo1 bar1 --lease=1234abcd
OK
```
Note: The lease id `1234abcd` in the above command refers to id returned on creating the lease of 10s. This id can then be attached to the key.
## Read keys
Applications can read values of keys from an etcd cluster. Queries may read a single key, or a range of keys.
Suppose the etcd cluster has stored the following keys:
```bash
foo = bar
foo1 = bar1
foo2 = bar2
foo3 = bar3
```
Here is the command to read the value of key `foo`:
```bash
$ etcdctl get foo
foo
bar
```
Here is the command to read the value of key `foo` in hex format:
```bash
$ etcdctl get foo --hex
\x66\x6f\x6f # Key
\x62\x61\x72 # Value
```
Here is the command to read only the value of key `foo`:
```bash
$ etcdctl get foo --print-value-only
bar
```
Here is the command to range over the keys from `foo` to `foo3`:
```bash
$ etcdctl get foo foo3
foo
bar
foo1
bar1
foo2
bar2
```
Note that `foo3` is excluded since the range is over the half-open interval `[foo, foo3)`, excluding `foo3`.
Here is the command to range over all keys prefixed with `foo`:
```bash
$ etcdctl get --prefix foo
foo
bar
foo1
bar1
foo2
bar2
foo3
bar3
```
Here is the command to range over all keys prefixed with `foo`, limiting the number of results to 2:
```bash
$ etcdctl get --prefix --limit=2 foo
foo
bar
foo1
bar1
```
## Read past version of keys
Applications may want to read superseded versions of a key. For example, an application may wish to roll back to an old configuration by accessing an earlier version of a key. Alternatively, an application may want a consistent view over multiple keys through multiple requests by accessing key history.
Since every modification to the etcd cluster key-value store increments the global revision of an etcd cluster, an application can read superseded keys by providing an older etcd revision.
Suppose an etcd cluster already has the following keys:
```bash
foo = bar # revision = 2
foo1 = bar1 # revision = 3
foo = bar_new # revision = 4
foo1 = bar1_new # revision = 5
```
Here are an example to access the past versions of keys:
```bash
$ etcdctl get --prefix foo # access the most recent versions of keys
foo
bar_new
foo1
bar1_new
$ etcdctl get --prefix --rev=4 foo # access the versions of keys at revision 4
foo
bar_new
foo1
bar1
$ etcdctl get --prefix --rev=3 foo # access the versions of keys at revision 3
foo
bar
foo1
bar1
$ etcdctl get --prefix --rev=2 foo # access the versions of keys at revision 2
foo
bar
$ etcdctl get --prefix --rev=1 foo # access the versions of keys at revision 1
```
## Read keys which are greater than or equal to the byte value of the specified key
Applications may want to read keys which are greater than or equal to the byte value of the specified key.
Suppose an etcd cluster already has the following keys:
```bash
a = 123
b = 456
z = 789
```
Here is the command to read keys which are greater than or equal to the byte value of key `b` :
```bash
$ etcdctl get --from-key b
b
456
z
789
```
## Delete keys
Applications can delete a key or a range of keys from an etcd cluster.
Suppose an etcd cluster already has the following keys:
```bash
foo = bar
foo1 = bar1
foo3 = bar3
zoo = val
zoo1 = val1
zoo2 = val2
a = 123
b = 456
z = 789
```
Here is the command to delete key `foo`:
```bash
$ etcdctl del foo
1 # one key is deleted
```
Here is the command to delete keys ranging from `foo` to `foo9`:
```bash
$ etcdctl del foo foo9
2 # two keys are deleted
```
Here is the command to delete key `zoo` with the deleted key value pair returned:
```bash
$ etcdctl del --prev-kv zoo
1 # one key is deleted
zoo # deleted key
val # the value of the deleted key
```
Here is the command to delete keys having prefix as `zoo`:
```bash
$ etcdctl del --prefix zoo
2 # two keys are deleted
```
Here is the command to delete keys which are greater than or equal to the byte value of key `b` :
```bash
$ etcdctl del --from-key b
2 # two keys are deleted
```
## Watch key changes
Applications can watch on a key or a range of keys to monitor for any updates.
Here is the command to watch on key `foo`:
```bash
$ etcdctl watch foo
# in another terminal: etcdctl put foo bar
PUT
foo
bar
```
Here is the command to watch on key `foo` in hex format:
```bash
$ etcdctl watch foo --hex
# in another terminal: etcdctl put foo bar
PUT
\x66\x6f\x6f # Key
\x62\x61\x72 # Value
```
Here is the command to watch on a range key from `foo` to `foo9`:
```bash
$ etcdctl watch foo foo9
# in another terminal: etcdctl put foo bar
PUT
foo
bar
# in another terminal: etcdctl put foo1 bar1
PUT
foo1
bar1
```
Here is the command to watch on keys having prefix `foo`:
```bash
$ etcdctl watch --prefix foo
# in another terminal: etcdctl put foo bar
PUT
foo
bar
# in another terminal: etcdctl put fooz1 barz1
PUT
fooz1
barz1
```
Here is the command to watch on multiple keys `foo` and `zoo`:
```bash
$ etcdctl watch -i
$ watch foo
$ watch zoo
# in another terminal: etcdctl put foo bar
PUT
foo
bar
# in another terminal: etcdctl put zoo val
PUT
zoo
val
```
## Watch historical changes of keys
Applications may want to watch for historical changes of keys in etcd. For example, an application may wish to receive all the modifications of a key; if the application stays connected to etcd, then `watch` is good enough. However, if the application or etcd fails, a change may happen during the failure, and the application will not receive the update in real time. To guarantee the update is delivered, the application must be able to watch for historical changes to keys. To do this, an application can specify a historical revision on a watch, just like reading past version of keys.
Suppose we finished the following sequence of operations:
```bash
$ etcdctl put foo bar # revision = 2
OK
$ etcdctl put foo1 bar1 # revision = 3
OK
$ etcdctl put foo bar_new # revision = 4
OK
$ etcdctl put foo1 bar1_new # revision = 5
OK
```
Here is an example to watch the historical changes:
```bash
# watch for changes on key `foo` since revision 2
$ etcdctl watch --rev=2 foo
PUT
foo
bar
PUT
foo
bar_new
```
```bash
# watch for changes on key `foo` since revision 3
$ etcdctl watch --rev=3 foo
PUT
foo
bar_new
```
Here is an example to watch only from the last historical change:
```bash
# watch for changes on key `foo` and return last revision value along with modified value
$ etcdctl watch --prev-kv foo
# in another terminal: etcdctl put foo bar_latest
PUT
foo # key
bar_new # last value of foo key before modification
foo # key
bar_latest # value of foo key after modification
```
## Compacted revisions
As we mentioned, etcd keeps revisions so that applications can read past versions of keys. However, to avoid accumulating an unbounded amount of history, it is important to compact past revisions. After compacting, etcd removes historical revisions, releasing resources for future use. All superseded data with revisions before the compacted revision will be unavailable.
Here is the command to compact the revisions:
```bash
$ etcdctl compact 5
compacted revision 5
# any revisions before the compacted one are not accessible
$ etcdctl get --rev=4 foo
Error: rpc error: code = 11 desc = etcdserver: mvcc: required revision has been compacted
```
Note: The current revision of etcd server can be found using get command on any key (existent or non-existent) in json format. Example is shown below for mykey which does not exist in etcd server:
```bash
$ etcdctl get mykey -w=json
{"header":{"cluster_id":14841639068965178418,"member_id":10276657743932975437,"revision":15,"raft_term":4}}
```
## Grant leases
Applications can grant leases for keys from an etcd cluster. When a key is attached to a lease, its lifetime is bound to the lease's lifetime which in turn is governed by a time-to-live (TTL). Each lease has a minimum time-to-live (TTL) value specified by the application at grant time. The lease's actual TTL value is at least the minimum TTL and is chosen by the etcd cluster. Once a lease's TTL elapses, the lease expires and all attached keys are deleted.
Here is the command to grant a lease:
```bash
# grant a lease with 10 second TTL
$ etcdctl lease grant 10
lease 32695410dcc0ca06 granted with TTL(10s)
# attach key foo to lease 32695410dcc0ca06
$ etcdctl put --lease=32695410dcc0ca06 foo bar
OK
```
## Revoke leases
Applications revoke leases by lease ID. Revoking a lease deletes all of its attached keys.
Suppose we finished the following sequence of operations:
```bash
$ etcdctl lease grant 10
lease 32695410dcc0ca06 granted with TTL(10s)
$ etcdctl put --lease=32695410dcc0ca06 foo bar
OK
```
Here is the command to revoke the same lease:
```bash
$ etcdctl lease revoke 32695410dcc0ca06
lease 32695410dcc0ca06 revoked
$ etcdctl get foo
# empty response since foo is deleted due to lease revocation
```
## Keep leases alive
Applications can keep a lease alive by refreshing its TTL so it does not expire.
Suppose we finished the following sequence of operations:
```bash
$ etcdctl lease grant 10
lease 32695410dcc0ca06 granted with TTL(10s)
```
Here is the command to keep the same lease alive:
```bash
$ etcdctl lease keep-alive 32695410dcc0ca06
lease 32695410dcc0ca06 keepalived with TTL(100)
lease 32695410dcc0ca06 keepalived with TTL(100)
lease 32695410dcc0ca06 keepalived with TTL(100)
...
```
## Get lease information
Applications may want to know about lease information, so that they can be renewed or to check if the lease still exists or it has expired. Applications may also want to know the keys to which a particular lease is attached.
Suppose we finished the following sequence of operations:
```bash
# grant a lease with 500 second TTL
$ etcdctl lease grant 500
lease 694d5765fc71500b granted with TTL(500s)
# attach key zoo1 to lease 694d5765fc71500b
$ etcdctl put zoo1 val1 --lease=694d5765fc71500b
OK
# attach key zoo2 to lease 694d5765fc71500b
$ etcdctl put zoo2 val2 --lease=694d5765fc71500b
OK
```
Here is the command to get information about the lease:
```bash
$ etcdctl lease timetolive 694d5765fc71500b
lease 694d5765fc71500b granted with TTL(500s), remaining(258s)
```
Here is the command to get information about the lease along with the keys attached with the lease:
```bash
$ etcdctl lease timetolive --keys 694d5765fc71500b
lease 694d5765fc71500b granted with TTL(500s), remaining(132s), attached keys([zoo2 zoo1])
# if the lease has expired or does not exist it will give the below response:
Error: etcdserver: requested lease not found
```

View File

@ -0,0 +1,10 @@
# System limits
## Request size limit
etcd is designed to handle small key value pairs typical for metadata. Larger requests will work, but may increase the latency of other requests. For the time being, etcd guarantees to support RPC requests with up to 1MB of data. In the future, the size limit may be loosened or made it configurable.
## Storage size limit
The default storage size limit is 2GB, configurable with `--quota-backend-bytes` flag; supports up to 8GB.

View File

@ -0,0 +1,90 @@
# Setup a local cluster
For testing and development deployments, the quickest and easiest way is to set up a local cluster. For a production deployment, refer to the [clustering][clustering] section.
## Local standalone cluster
Deploying an etcd cluster as a standalone cluster is straightforward. Start it with just one command:
```
$ ./etcd
...
```
The started etcd member listens on `localhost:2379` for client requests.
To interact with the started cluster by using etcdctl:
```
# use API version 3
$ export ETCDCTL_API=3
$ ./etcdctl put foo bar
OK
$ ./etcdctl get foo
bar
```
## Local multi-member cluster
A `Procfile` at the base of this git repo is provided to easily set up a local multi-member cluster. To start a multi-member cluster go to the root of an etcd source tree and run:
```
# install goreman program to control Profile-based applications.
$ go get github.com/mattn/goreman
$ goreman -f Procfile start
...
```
The started members listen on `localhost:2379`, `localhost:22379`, and `localhost:32379` for client requests respectively.
To interact with the started cluster by using etcdctl:
```
# use API version 3
$ export ETCDCTL_API=3
$ etcdctl --write-out=table --endpoints=localhost:2379 member list
+------------------+---------+--------+------------------------+------------------------+
| ID | STATUS | NAME | PEER ADDRS | CLIENT ADDRS |
+------------------+---------+--------+------------------------+------------------------+
| 8211f1d0f64f3269 | started | infra1 | http://127.0.0.1:2380 | http://127.0.0.1:2379 |
| 91bc3c398fb3c146 | started | infra2 | http://127.0.0.1:22380 | http://127.0.0.1:22379 |
| fd422379fda50e48 | started | infra3 | http://127.0.0.1:32380 | http://127.0.0.1:32379 |
+------------------+---------+--------+------------------------+------------------------+
$ etcdctl put foo bar
OK
```
To exercise etcd's fault tolerance, kill a member:
```
# kill etcd2
$ goreman run stop etcd2
$ etcdctl put key hello
OK
$ etcdctl get key
hello
# try to get key from the killed member
$ etcdctl --endpoints=localhost:22379 get key
2016/04/18 23:07:35 grpc: Conn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp 127.0.0.1:22379: getsockopt: connection refused"; Reconnecting to "localhost:22379"
Error: grpc: timed out trying to connect
# restart the killed member
$ goreman run restart etcd2
# get the key from restarted member
$ etcdctl --endpoints=localhost:22379 get key
hello
```
To learn more about interacting with etcd, read [interacting with etcd section][interacting].
[interacting]: ./interacting_v3.md
[clustering]: ../op-guide/clustering.md

View File

@ -0,0 +1,113 @@
# Discovery service protocol
Discovery service protocol helps new etcd member to discover all other members in cluster bootstrap phase using a shared discovery URL.
Discovery service protocol is _only_ used in cluster bootstrap phase, and cannot be used for runtime reconfiguration or cluster monitoring.
The protocol uses a new discovery token to bootstrap one _unique_ etcd cluster. Remember that one discovery token can represent only one etcd cluster. As long as discovery protocol on this token starts, even if it fails halfway, it must not be used to bootstrap another etcd cluster.
The rest of this article will walk through the discovery process with examples that correspond to a self-hosted discovery cluster. The public discovery service, discovery.etcd.io, functions the same way, but with a layer of polish to abstract away ugly URLs, generate UUIDs automatically, and provide some protections against excessive requests. At its core, the public discovery service still uses an etcd cluster as the data store as described in this document.
## Protocol workflow
The idea of discovery protocol is to use an internal etcd cluster to coordinate bootstrap of a new cluster. First, all new members interact with discovery service and help to generate the expected member list. Then each new member bootstraps its server using this list, which performs the same functionality as -initial-cluster flag.
In the following example workflow, we will list each step of protocol in curl format for ease of understanding.
By convention the etcd discovery protocol uses the key prefix `_etcd/registry`. If `http://example.com` hosts an etcd cluster for discovery service, a full URL to discovery keyspace will be `http://example.com/v2/keys/_etcd/registry`. We will use this as the URL prefix in the example.
### Creating a new discovery token
Generate a unique token that will identify the new cluster. This will be used as a unique prefix in discovery keyspace in the following steps. An easy way to do this is to use `uuidgen`:
```
UUID=$(uuidgen)
```
### Specifying the expected cluster size
The discovery token expects a cluster size that must be specified. The size is used by the discovery service to know when it has found all members that will initially form the cluster.
```
curl -X PUT http://example.com/v2/keys/_etcd/registry/${UUID}/_config/size -d value=${cluster_size}
```
Usually the cluster size is 3, 5 or 7. Check [optimal cluster size][cluster-size] for more details.
### Bringing up etcd processes
Given the discovery URL, use it as `-discovery` flag and bring up etcd processes. Every etcd process will follow this next few steps internally if given a `-discovery` flag.
### Registering itself
The first thing for etcd process is to register itself into the discovery URL as a member. This is done by creating member ID as a key in the discovery URL.
```
curl -X PUT http://example.com/v2/keys/_etcd/registry/${UUID}/${member_id}?prevExist=false -d value="${member_name}=${member_peer_url_1}&${member_name}=${member_peer_url_2}"
```
### Checking the status
It checks the expected cluster size and registration status in discovery URL, and decides what the next action is.
```
curl -X GET http://example.com/v2/keys/_etcd/registry/${UUID}/_config/size
curl -X GET http://example.com/v2/keys/_etcd/registry/${UUID}
```
If registered members are still not enough, it will wait for left members to appear.
If the number of registered members is bigger than the expected size N, it treats the first N registered members as the member list for the cluster. If the member itself is in the member list, the discovery procedure succeeds and it fetches all peers through the member list. If it is not in the member list, the discovery procedure finishes with the failure that the cluster has been full.
In etcd implementation, the member may check the cluster status even before registering itself. So it could fail quickly if the cluster has been full.
### Waiting for all members
The wait process is described in detail in the [etcd API documentation][api].
```
curl -X GET http://example.com/v2/keys/_etcd/registry/${UUID}?wait=true&waitIndex=${current_etcd_index}
```
It keeps waiting until finding all members.
## Public discovery service
CoreOS Inc. hosts a public discovery service at https://discovery.etcd.io/ , which provides some nice features for ease of use.
### Mask key prefix
Public discovery service will redirect `https://discovery.etcd.io/${UUID}` to etcd cluster behind for the key at `/v2/keys/_etcd/registry`. It masks register key prefix for short and readable discovery url.
### Get new token
```
GET /new
Sent query:
size=${cluster_size}
Possible status codes:
200 OK
400 Bad Request
200 Body:
generated discovery url
```
The generation process in the service follows the steps from [Creating a New Discovery Token][new-discovery-token] to [Specifying the Expected Cluster Size][expected-cluster-size].
### Check discovery status
```
GET /${UUID}
```
The status for this discovery token, including the machines that have been registered, can be checked by requesting the value of the UUID.
### Open-source repository
The repository is located at https://github.com/coreos/discovery.etcd.io. It could be used to build a custom discovery service.
[api]: ../v2/api.md#waiting-for-a-change
[cluster-size]: ../v2/admin_guide.md#optimal-cluster-size
[expected-cluster-size]: #specifying-the-expected-cluster-size
[new-discovery-token]: #creating-a-new-discovery-token

View File

@ -0,0 +1,29 @@
# Logging conventions
etcd uses the [capnslog][capnslog] library for logging application output categorized into *levels*. A log message's level is determined according to these conventions:
* Error: Data has been lost, a request has failed for a bad reason, or a required resource has been lost
* Examples:
* A failure to allocate disk space for WAL
* Warning: (Hopefully) Temporary conditions that may cause errors, but may work fine. A replica disappearing (that may reconnect) is a warning.
* Examples:
* Failure to send raft message to a remote peer
* Failure to receive heartbeat message within the configured election timeout
* Notice: Normal, but important (uncommon) log information.
* Examples:
* Add a new node into the cluster
* Add a new user into auth subsystem
* Info: Normal, working log information, everything is fine, but helpful notices for auditing or common operations.
* Examples:
* Startup configuration
* Start to do snapshot
* Debug: Everything is still fine, but even common operations may be logged, and less helpful but more quantity of notices.
* Examples:
* Send a normal message to a remote peer
* Write a log entry to disk
[capnslog]: [https://github.com/coreos/pkg/tree/master/capnslog]

View File

@ -0,0 +1,109 @@
# etcd release guide
The guide talks about how to release a new version of etcd.
The procedure includes some manual steps for sanity checking but it can probably be further scripted. Please keep this document up-to-date if making changes to the release process.
## Prepare release
Set desired version as environment variable for following steps. Here is an example to release 2.3.0:
```
export VERSION=v2.3.0
export PREV_VERSION=v2.2.5
```
All releases version numbers follow the format of [semantic versioning 2.0.0](http://semver.org/).
### Major, minor version release, or its pre-release
- Ensure the relevant milestone on GitHub is complete. All referenced issues should be closed, or moved elsewhere.
- Remove this release from [roadmap](https://github.com/coreos/etcd/blob/master/ROADMAP.md), if necessary.
- Ensure the latest upgrade documentation is available.
- Bump [hardcoded MinClusterVerion in the repository](https://github.com/coreos/etcd/blob/master/version/version.go#L29), if necessary.
- Add feature capability maps for the new version, if necessary.
### Patch version release
- Discuss about commits that are backported to the patch release. The commits should not include merge commits.
- Cherry-pick these commits starting from the oldest one into stable branch.
## Write release note
- Write introduction for the new release. For example, what major bug we fix, what new features we introduce or what performance improvement we make.
- Put `[GH XXXX]` at the head of change line to reference Pull Request that introduces the change. Moreover, add a link on it to jump to the Pull Request.
- Find PRs with `release-note` label and explain them in `NEWS` file, as a straightforward summary of changes for end-users.
## Tag version
- Bump [hardcoded Version in the repository](https://github.com/coreos/etcd/blob/master/version/version.go#L30) to the latest version `${VERSION}`.
- Ensure all tests on CI system are passed.
- Manually check etcd is buildable in Linux, Darwin and Windows.
- Manually check upgrade etcd cluster of previous minor version works well.
- Manually check new features work well.
- Add a signed tag through `git tag -s ${VERSION}`.
- Sanity check tag correctness through `git show tags/$VERSION`.
- Push the tag to GitHub through `git push origin tags/$VERSION`. This assumes `origin` corresponds to "https://github.com/coreos/etcd".
## Build release binaries and images
- Ensure `acbuild` is available.
- Ensure `docker` is available.
Run release script in root directory:
```
./scripts/release.sh ${VERSION}
```
It generates all release binaries and images under directory ./release.
## Sign binaries and images
etcd project key must be used to sign the generated binaries and images.`$SUBKEYID` is the key ID of etcd project Yubikey. Connect the key and run `gpg2 --card-status` to get the ID.
The following commands are used for public release sign:
```
cd release
for i in etcd-*{.zip,.tar.gz}; do gpg2 --default-key $SUBKEYID --armor --output ${i}.asc --detach-sign ${i}; done
for i in etcd-*{.zip,.tar.gz}; do gpg2 --verify ${i}.asc ${i}; done
```
The public key for GPG signing can be found at [CoreOS Application Signing Key](https://coreos.com/security/app-signing-key)
## Publish release page in GitHub
- Set release title as the version name.
- Follow the format of previous release pages.
- Attach the generated binaries, aci image and signatures.
- Select whether it is a pre-release.
- Publish the release!
## Publish docker image in Quay.io
- Push docker image:
```
docker login quay.io
docker push quay.io/coreos/etcd:${VERSION}
```
- Add `latest` tag to the new image on [quay.io](https://quay.io/repository/coreos/etcd?tag=latest&tab=tags) if this is a stable release.
## Announce to the etcd-dev Googlegroup
- Follow the format of [previous release emails](https://groups.google.com/forum/#!forum/etcd-dev).
- Make sure to include a list of authors that contributed since the previous release - something like the following might be handy:
```
git log ...${PREV_VERSION} --pretty=format:"%an" | sort | uniq | tr '\n' ',' | sed -e 's#,#, #g' -e 's#, $##'
```
- Send email to etcd-dev@googlegroups.com
## Post release
- Create new stable branch through `git push origin ${VERSION_MAJOR}.${VERSION_MINOR}` if this is a major stable release. This assumes `origin` corresponds to "https://github.com/coreos/etcd".
- Bump [hardcoded Version in the repository](https://github.com/coreos/etcd/blob/master/version/version.go#L30) to the version `${VERSION}+git`.

76
Documentation/dl_build.md Normal file
View File

@ -0,0 +1,76 @@
# Download and build
## System requirements
The etcd performance benchmarks run etcd on 8 vCPU, 16GB RAM, 50GB SSD GCE instances, but any relatively modern machine with low latency storage and a few gigabytes of memory should suffice for most use cases. Applications with large v2 data stores will require more memory than a large v3 data store since data is kept in anonymous memory instead of memory mapped from a file. than For running etcd on a cloud provider, we suggest at least a medium instance on AWS or a standard-1 instance on GCE.
## Download the pre-built binary
The easiest way to get etcd is to use one of the pre-built release binaries which are available for OSX, Linux, Windows, appc, and Docker. Instructions for using these binaries are on the [GitHub releases page][github-release].
## Build the latest version
For those wanting to try the very latest version, build etcd from the `master` branch. [Go](https://golang.org/) version 1.7+ is required to build the latest version of etcd. To ensure etcd is built against well-tested libraries, etcd vendors its dependencies for official release binaries. However, etcd's vendoring is also optional to avoid potential import conflicts when embedding the etcd server or using the etcd client.
First, confirm go 1.7+ is installed:
```sh
# go is required
$ go version
go version go1.7.3 darwin/amd64
```
To build `etcd` from the `master` branch without a `GOPATH` using the official `build` script:
```sh
$ git clone https://github.com/coreos/etcd.git
$ cd etcd
$ ./build
$ ./bin/etcd
```
To build a vendored `etcd` from the `master` branch via `go get`:
```sh
# GOPATH should be set
$ echo $GOPATH
/Users/example/go
$ go get github.com/coreos/etcd/cmd/etcd
$ $GOPATH/bin/etcd
```
To build `etcd` from the `master` branch without vendoring (may not build due to upstream conflicts):
```sh
# GOPATH should be set
$ echo $GOPATH
/Users/example/go
$ go get github.com/coreos/etcd
$ $GOPATH/bin/etcd
```
## Test the installation
Check the etcd binary is built correctly by starting etcd and setting a key.
Start etcd:
```
$ ./bin/etcd
```
Set a key:
```
$ ETCDCTL_API=3 ./bin/etcdctl put foo bar
OK
```
If OK is printed, then etcd is working!
[github-release]: https://github.com/coreos/etcd/releases/
[go]: https://golang.org/doc/install
[build-script]: ../build
[cmd-directory]: ../cmd

92
Documentation/docs.md Normal file
View File

@ -0,0 +1,92 @@
# Documentation
etcd is a distributed key-value store designed to reliably and quickly preserve and provide access to critical data. It enables reliable distributed coordination through distributed locking, leader elections, and write barriers. An etcd cluster is intended for high availability and permanent data storage and retrieval.
## Getting started
New etcd users and developers should get started by [downloading and building][download_build] etcd. After getting etcd, follow this [quick demo][demo] to see the basics of creating and working with an etcd cluster.
## Developing with etcd
The easiest way to get started using etcd as a distributed key-value store is to [set up a local cluster][local_cluster].
- [Setting up local clusters][local_cluster]
- [Interacting with etcd][interacting]
- [API references][api_ref]
- [gRPC gateway][api_grpc_gateway]
- [gRPC naming and discovery][grpc_naming]
- [Embedding etcd][embed_etcd]
- [Experimental features and APIs][experimental]
- [System limits][system-limit]
## Operating etcd clusters
Administrators who need to create reliable and scalable key-value stores for the developers they support should begin with a [cluster on multiple machines][clustering].
- [Setting up etcd clusters][clustering]
- [Setting up etcd gateways][gateway]
- [Setting up etcd gRPC proxy (pre-alpha)][grpc_proxy]
- [Run etcd clusters inside containers][container]
- [Hardware recommendations][hardware]
- [Configuration][conf]
- [Security][security]
- [Monitoring][monitoring]
- [Maintenance][maintenance]
- [Understand failures][failures]
- [Disaster recovery][recovery]
- [Performance][performance]
- [Versioning][versioning]
- [Supported platform][supported_platform]
## Learning
To learn more about the concepts and internals behind etcd, read the following pages:
- [Why etcd][why] (TODO)
- [Understand data model][data_model]
- [Understand APIs][understand_apis]
- [Glossary][glossary]
- Internals (TODO)
## Upgrading and compatibility
- [Migrate applications from using API v2 to API v3][v2_migration]
- [Updating v2.3 to v3.0][v3_upgrade]
- [Updating v3.0 to v3.1][v31_upgrade]
## Frequently Asked Questions (FAQ)
Answers to [common questions] about etcd.
[api_ref]: dev-guide/api_reference_v3.md
[api_grpc_gateway]: dev-guide/api_grpc_gateway.md
[clustering]: op-guide/clustering.md
[conf]: op-guide/configuration.md
[system-limit]: dev-guide/limit.md
[common questions]: faq.md
[why]: learning/why.md
[data_model]: learning/data_model.md
[demo]: demo.md
[download_build]: dl_build.md
[embed_etcd]: https://godoc.org/github.com/coreos/etcd/embed
[grpc_naming]: dev-guide/grpc_naming.md
[failures]: op-guide/failures.md
[gateway]: op-guide/gateway.md
[glossary]: learning/glossary.md
[grpc_proxy]: op-guide/grpc_proxy.md
[hardware]: op-guide/hardware.md
[interacting]: dev-guide/interacting_v3.md
[local_cluster]: dev-guide/local_cluster.md
[performance]: op-guide/performance.md
[recovery]: op-guide/recovery.md
[maintenance]: op-guide/maintenance.md
[security]: op-guide/security.md
[monitoring]: op-guide/monitoring.md
[v2_migration]: op-guide/v2-migration.md
[container]: op-guide/container.md
[understand_apis]: learning/api.md
[versioning]: op-guide/versioning.md
[supported_platform]: op-guide/supported-platform.md
[experimental]: dev-guide/experimental_apis.md
[v3_upgrade]: upgrades/upgrade_3_0.md
[v31_upgrade]: upgrades/upgrade_3_1.md

128
Documentation/faq.md Normal file
View File

@ -0,0 +1,128 @@
## Frequently Asked Questions (FAQ)
### etcd, general
#### Do clients have to send requests to the etcd leader?
[Raft][raft] is leader-based; the leader handles all client requests which need cluster consensus. However, the client does not need to know which node is the leader. Any request that requires consensus sent to a follower is automatically forwarded to the leader. Requests that do not require consensus (e.g., serialized reads) can be processed by any cluster member.
### Configuration
#### What is the difference between advertise-urls and listen-urls?
`listen-urls` specifies the local addresses etcd server binds to for accepting incoming connections. To listen on a port for all interfaces, specify `0.0.0.0` as the listen IP address.
`advertise-urls` specifies the addresses etcd clients or other etcd members should use to contact the etcd server. The advertise addresses must be reachable from the remote machines. Do not advertise addresses like `localhost` or `0.0.0.0` for a production setup since these addresses are unreachable from remote machines.
### Deployment
#### System requirements
Since etcd writes data to disk, SSD is highly recommended. To prevent performance degradation or unintentionally overloading the key-value store, etcd enforces a 2GB default storage size quota, configurable up to 8GB. To avoid swapping or running out of memory, the machine should have at least as much RAM to cover the quota. At CoreOS, an etcd cluster is usually deployed on dedicated CoreOS Container Linux machines with dual-core processors, 2GB of RAM, and 80GB of SSD *at the very least*. **Note that performance is intrinsically workload dependent; please test before production deployment**. See [hardware][hardware-setup] for more recommendations.
Most stable production environment is Linux operating system with amd64 architecture; see [supported platform][supported-platform] for more.
#### Why an odd number of cluster members?
An etcd cluster needs a majority of nodes, a quorum, to agree on updates to the cluster state. For a cluster with n members, quorum is (n/2)+1. For any odd-sized cluster, adding one node will always increase the number of nodes necessary for quorum. Although adding a node to an odd-sized cluster appears better since there are more machines, the fault tolerance is worse since exactly the same number of nodes may fail without losing quorum but there are more nodes that can fail. If the cluster is in a state where it can't tolerate any more failures, adding a node before removing nodes is dangerous because if the new node fails to register with the cluster (e.g., the address is misconfigured), quorum will be permanently lost.
#### What is maximum cluster size?
Theoretically, there is no hard limit. However, an etcd cluster probably should have no more than seven nodes. [Google Chubby lock service][chubby], similar to etcd and widely deployed within Google for many years, suggests running five nodes. A 5-member etcd cluster can tolerate two member failures, which is enough in most cases. Although larger clusters provide better fault tolerance, the write performance suffers because data must be replicated across more machines.
#### What is failure tolerance?
An etcd cluster operates so long as a member quorum can be established. If quorum is lost through transient network failures (e.g., partitions), etcd automatically and safely resumes once the network recovers and restores quorum; Raft enforces cluster consistency. For power loss, etcd persists the Raft log to disk; etcd replays the log to the point of failure and resumes cluster participation. For permanent hardware failure, the node may be removed from the cluster through [runtime reconfiguration][runtime reconfiguration].
It is recommended to have an odd number of members in a cluster. An odd-size cluster tolerates the same number of failures as an even-size cluster but with fewer nodes. The difference can be seen by comparing even and odd sized clusters:
| Cluster Size | Majority | Failure Tolerance |
|:-:|:-:|:-:|
| 1 | 1 | 0 |
| 2 | 2 | 0 |
| 3 | 2 | 1 |
| 4 | 3 | 1 |
| 5 | 3 | 2 |
| 6 | 4 | 2 |
| 7 | 4 | 3 |
| 8 | 5 | 3 |
| 9 | 5 | 4 |
Adding a member to bring the size of cluster up to an even number doesn't buy additional fault tolerance. Likewise, during a network partition, an odd number of members guarantees that there will always be a majority partition that can continue to operate and be the source of truth when the partition ends.
#### Does etcd work in cross-region or cross data center deployments?
Deploying etcd across regions improves etcd's fault tolerance since members are in separate failure domains. The cost is higher consensus request latency from crossing data center boundaries. Since etcd relies on a member quorum for consensus, the latency from crossing data centers will be somewhat pronounced because at least a majority of cluster members must respond to consensus requests. Additionally, cluster data must be replicated across all peers, so there will be bandwidth cost as well.
With longer latencies, the default etcd configuration may cause frequent elections or heartbeat timeouts. See [tuning] for adjusting timeouts for high latency deployments.
### Operation
#### How to backup a etcd cluster?
etcdctl provides a `snapshot` command to create backups. See [backup][backup] for more details.
#### Should I add a member before removing an unhealthy member?
When replacing an etcd node, it's important to remove the member first and then add its replacement.
etcd employs distributed consensus based on a quorum model; (n+1)/2 members, a majority, must agree on a proposal before it can be committed to the cluster. These proposals include key-value updates and membership changes. This model totally avoids any possibility of split brain inconsistency. The downside is permanent quorum loss is catastrophic.
How this applies to membership: If a 3-member cluster has 1 downed member, it can still make forward progress because the quorum is 2 and 2 members are still live. However, adding a new member to a 3-member cluster will increase the quorum to 3 because 3 votes are required for a majority of 4 members. Since the quorum increased, this extra member buys nothing in terms of fault tolerance; the cluster is still one node failure away from being unrecoverable.
Additionally, that new member is risky because it may turn out to be misconfigured or incapable of joining the cluster. In that case, there's no way to recover quorum because the cluster has two members down and two members up, but needs three votes to change membership to undo the botched membership addition. etcd will by default reject member add attempts that could take down the cluster in this manner.
On the other hand, if the downed member is removed from cluster membership first, the number of members becomes 2 and the quorum remains at 2. Following that removal by adding a new member will also keep the quorum steady at 2. So, even if the new node can't be brought up, it's still possible to remove the new member through quorum on the remaining live members.
#### Why won't etcd accept my membership changes?
etcd sets `strict-reconfig-check` in order to reject reconfiguration requests that would cause quorum loss. Abandoning quorum is really risky (especially when the cluster is already unhealthy). Although it may be tempting to disable quorum checking if there's quorum loss to add a new member, this could lead to full fledged cluster inconsistency. For many applications, this will make the problem even worse ("disk geometry corruption" being a candidate for most terrifying).
### Performance
#### How should I benchmark etcd?
Try the [benchmark] tool. Current [benchmark results][benchmark-result] are available for comparison.
#### What does the etcd warning "apply entries took too long" mean?
After a majority of etcd members agree to commit a request, each etcd server applies the request to its data store and persists the result to disk. Even with a slow mechanical disk or a virtualized network disk, such as Amazons EBS or Googles PD, applying a request should normally take fewer than 50 milliseconds. If the average apply duration exceeds 100 milliseconds, etcd will warn that entries are taking too long to apply.
Usually this issue is caused by a slow disk. The disk could be experiencing contention among etcd and other applications, or the disk is too simply slow (e.g., a shared virtualized disk). To rule out a slow disk from causing this warning, monitor [backend_commit_duration_seconds][backend_commit_metrics] (p99 duration should be less than 25ms) to confirm the disk is reasonably fast. If the disk is too slow, assigning a dedicated disk to etcd or using faster disk will typically solve the problem.
The second most common cause is CPU starvation. If monitoring of the machines CPU usage shows heavy utilization, there may not be enough compute capacity for etcd. Moving etcd to dedicated machine, increasing process resource isolation cgroups, or renicing the etcd server process into a higher priority can usually solve the problem.
Expensive user requests which access too many keys (e.g., fetching the entire keyspace) can also cause long apply latencies. Accessing fewer than a several hundred keys per request, however, should always be performant.
If none of the above suggestions clear the warnings, please [open an issue][new_issue] with detailed logging, monitoring, metrics and optionally workload information.
#### What does the etcd warning "failed to send out heartbeat on time" mean?
etcd uses a leader-based consensus protocol for consistent data replication and log execution. Cluster members elect a single leader, all other members become followers. The elected leader must periodically send heartbeats to its followers to maintain its leadership. Followers infer leader failure if no heartbeats are received within an election interval and trigger an election. If a leader doesnt send its heartbeats in time but is still running, the election is spurious and likely caused by insufficient resources. To catch these soft failures, if the leader skips two heartbeat intervals, etcd will warn it failed to send a heartbeat on time.
Usually this issue is caused by a slow disk. Before the leader sends heartbeats attached with metadata, it may need to persist the metadata to disk. The disk could be experiencing contention among etcd and other applications, or the disk is too simply slow (e.g., a shared virtualized disk). To rule out a slow disk from causing this warning, monitor [wal_fsync_duration_seconds][wal_fsync_duration_seconds] (p99 duration should be less than 10ms) to confirm the disk is reasonably fast. If the disk is too slow, assigning a dedicated disk to etcd or using faster disk will typically solve the problem.
The second most common cause is CPU starvation. If monitoring of the machines CPU usage shows heavy utilization, there may not be enough compute capacity for etcd. Moving etcd to dedicated machine, increasing process resource isolation with cgroups, or renicing the etcd server process into a higher priority can usually solve the problem.
A slow network can also cause this issue. If network metrics among the etcd machines shows long latencies or high drop rate, there may not be enough network capacity for etcd. Moving etcd members to a less congested network will typically solve the problem. However, if the etcd cluster is deployed across data centers, long latency between members is expected. For such deployments, tune the `heartbeat-interval` configuration to roughly match the round trip time between the machines, and the `election-timeout` configuration to be at least 5 * `heartbeat-interval`. See [tuning documentation][tuning] for detailed information.
If none of the above suggestions clear the warnings, please [open an issue][new_issue] with detailed logging, monitoring, metrics and optionally workload information.
#### What does the etcd warning "request ignored (cluster ID mismatch)" mean?
Every new etcd cluster generates a new cluster ID based on the initial cluster configuration and a user-provided unique `initial-cluster-token` value. By having unique cluster ID's, etcd is protected from cross-cluster interaction which could corrupt the cluster.
Usually this warning happens after tearing down an old cluster, then reusing some of the peer addresses for the new cluster. If any etcd process from the old cluster is still running it will try to contact the new cluster. The new cluster will recognize a cluster ID mismatch, then ignore the request and emit this warning. This warning is often cleared by ensuring peer addresses among distinct clusters are disjoint.
[hardware-setup]: ./op-guide/hardware.md
[supported-platform]: ./op-guide/supported-platform.md
[wal_fsync_duration_seconds]: ./metrics.md#disk
[tuning]: ./tuning.md
[new_issue]: https://github.com/coreos/etcd/issues/new
[backend_commit_metrics]: ./metrics.md#disk
[raft]: https://raft.github.io/raft.pdf
[backup]: https://github.com/coreos/etcd/blob/master/Documentation/op-guide/recovery.md#snapshotting-the-keyspace
[chubby]: http://static.googleusercontent.com/media/research.google.com/en//archive/chubby-osdi06.pdf
[runtime reconfiguration]: https://github.com/coreos/etcd/blob/master/Documentation/op-guide/runtime-configuration.md
[benchmark]: https://github.com/coreos/etcd/tree/master/tools/benchmark
[benchmark-result]: https://github.com/coreos/etcd/blob/master/Documentation/op-guide/performance.md

View File

@ -0,0 +1,57 @@
# etcd3 API
NOTE: this doc is not finished!
## Response header
All Responses from etcd API have a [response header][response_header] attached. The response header includes the metadata of the response.
```proto
message ResponseHeader {
uint64 cluster_id = 1;
uint64 member_id = 2;
int64 revision = 3;
uint64 raft_term = 4;
}
```
* Cluster_ID - the ID of the cluster that generates the response
* Member_ID - the ID of the member that generates the response
* Revision - the revision of the key-value store when the response is generated
* Raft_Term - the Raft term of the member when the response is generated
An application may read the Cluster_ID (Member_ID) field to ensure it is communicating with the intended cluster (member).
Applications can use the `Revision` to know the latest revision of the key-value store. This is especially useful when applications specify a historical revision to make time `travel query` and wishes to know the latest revision at the time of the request.
Applications can use `Raft_Term` to detect when the cluster completes a new leader election.
## Key-Value API
Key-Value API is used to manipulate key-value pairs stored inside etcd. The key-value API is defined as a [gRPC service][kv-service]. The Key-Value pair is defined as structured data in [protobuf format][kv-proto].
### Key-Value pair
A key-value pair is the smallest unit that the key-value API can manipulate. Each key-value pair has a number of fields:
```protobuf
message KeyValue {
bytes key = 1;
int64 create_revision = 2;
int64 mod_revision = 3;
int64 version = 4;
bytes value = 5;
int64 lease = 6;
}
```
* Key - key in bytes. An empty key is not allowed.
* Value - value in bytes.
* Version - version is the version of the key. A deletion resets the version to zero and any modification of the key increases its version.
* Create_Revision - revision of the last creation on the key.
* Mod_Revision - revision of the last modification on the key.
* Lease - the ID of the lease attached to the key. If lease is 0, then no lease is attached to the key.
[kv-proto]: https://github.com/coreos/etcd/blob/master/mvcc/mvccpb/kv.proto
[kv-service]: https://github.com/coreos/etcd/blob/master/etcdserver/etcdserverpb/rpc.proto
[response_header]: https://github.com/coreos/etcd/blob/master/etcdserver/etcdserverpb/rpc.proto

View File

@ -0,0 +1,63 @@
# KV API guarantees
etcd is a consistent and durable key value store with mini-transaction(TODO: link to txn doc when we have it) support. The key value store is exposed through the KV APIs. etcd tries to ensure the strongest consistency and durability guarantees for a distributed system. This specification enumerates the KV API guarantees made by etcd.
### APIs to consider
* Read APIs
* range
* watch
* Write APIs
* put
* delete
* Combination (read-modify-write) APIs
* txn
### etcd specific definitions
#### Operation completed
An etcd operation is considered complete when it is committed through consensus, and therefore “executed” -- permanently stored -- by the etcd storage engine. The client knows an operation is completed when it receives a response from the etcd server. Note that the client may be uncertain about the status of an operation if it times out, or there is a network disruption between the client and the etcd member. etcd may also abort operations when there is a leader election. etcd does not send `abort` responses to clients outstanding requests in this event.
#### Revision
An etcd operation that modifies the key value store is assigned with a single increasing revision. A transaction operation might modifies the key value store multiple times, but only one revision is assigned. The revision attribute of a key value pair that modified by the operation has the same value as the revision of the operation. The revision can be used as a logical clock for key value store. A key value pair that has a larger revision is modified after a key value pair with a smaller revision. Two key value pairs that have the same revision are modified by an operation "concurrently".
### Guarantees provided
#### Atomicity
All API requests are atomic; an operation either completes entirely or not at all. For watch requests, all events generated by one operation will be in one watch response. Watch never observes partial events for a single operation.
#### Consistency
All API calls ensure [sequential consistency][seq_consistency], the strongest consistency guarantee available from distributed systems. No matter which etcd member server a client makes requests to, a client reads the same events in the same order. If two members complete the same number of operations, the state of the two members is consistent.
For watch operations, etcd guarantees to return the same value for the same key across all members for the same revision. For range operations, etcd has a similar guarantee for [linearized][Linearizability] access; serialized access may be behind the quorum state, so that the later revision is not yet available.
As with all distributed systems, it is impossible for etcd to ensure [strict consistency][strict_consistency]. etcd does not guarantee that it will return to a read the “most recent” value (as measured by a wall clock when a request is completed) available on any cluster member.
#### Isolation
etcd ensures [serializable isolation][serializable_isolation], which is the highest isolation level available in distributed systems. Read operations will never observe any intermediate data.
#### Durability
Any completed operations are durable. All accessible data is also durable data. A read will never return data that has not been made durable.
#### Linearizability
Linearizability (also known as Atomic Consistency or External Consistency) is a consistency level between strict consistency and sequential consistency.
For linearizability, suppose each operation receives a timestamp from a loosely synchronized global clock. Operations are linearized if and only if they always complete as though they were executed in a sequential order and each operation appears to complete in the order specified by the program. Likewise, if an operations timestamp precedes another, that operation must also precede the other operation in the sequence.
For example, consider a client completing a write at time point 1 (*t1*). A client issuing a read at *t2* (for *t2* > *t1*) should receive a value at least as recent as the previous write, completed at *t1*. However, the read might actually complete only by *t3*, and the returned value, current at *t2* when the read began, might be "stale" by *t3*.
etcd does not ensure linearizability for watch operations. Users are expected to verify the revision of watch responses to ensure correct ordering.
etcd ensures linearizability for all other operations by default. Linearizability comes with a cost, however, because linearized requests must go through the Raft consensus process. To obtain lower latencies and higher throughput for read requests, clients can configure a requests consistency mode to `serializable`, which may access stale data with respect to quorum, but removes the performance penalty of linearized accesses' reliance on live consensus.
[seq_consistency]: https://en.wikipedia.org/wiki/Consistency_model#Sequential_consistency
[strict_consistency]: https://en.wikipedia.org/wiki/Consistency_model#Strict_consistency
[serializable_isolation]: https://en.wikipedia.org/wiki/Isolation_(database_systems)#Serializable
[Linearizability]: #Linearizability

View File

@ -0,0 +1,25 @@
# Data model
etcd is designed to reliably store infrequently updated data and provide reliable watch queries. etcd exposes previous versions of key-value pairs to support inexpensive snapshots and watch history events (“time travel queries”). A persistent, multi-version, concurrency-control data model is a good fit for these use cases.
etcd stores data in a multiversion [persistent][persistent-ds] key-value store. The persistent key-value store preserves the previous version of a key-value pair when its value is superseded with new data. The key-value store is effectively immutable; its operations do not update the structure in-place, but instead always generates a new updated structure. All past versions of keys are still accessible and watchable after modification. To prevent the data store from growing indefinitely over time from maintaining old versions, the store may be compacted to shed the oldest versions of superseded data.
### Logical view
The stores logical view is a flat binary key space. The key space has a lexically sorted index on byte string keys so range queries are inexpensive.
The key space maintains multiple revisions. Each atomic mutative operation (e.g., a transaction operation may contain multiple operations) creates a new revision on the key space. All data held by previous revisions remains unchanged. Old versions of key can still be accessed through previous revisions. Likewise, revisions are indexed as well; ranging over revisions with watchers is efficient. If the store is compacted to recover space, revisions before the compact revision will be removed.
A keys lifetime spans a generation. Each key may have one or multiple generations. Creating a key increments the generation of that key, starting at 1 if the key never existed. Deleting a key generates a key tombstone, concluding the keys current generation. Each modification of a key creates a new version of the key. Once a compaction happens, any generation ended before the given revision will be removed and values set before the compaction revision except the latest one will be removed.
### Physical view
etcd stores the physical data as key-value pairs in a persistent [b+tree][b+tree]. Each revision of the stores state only contains the delta from its previous revision to be efficient. A single revision may correspond to multiple keys in the tree.
The key of key-value pair is a 3-tuple (major, sub, type). Major is the store revision holding the key. Sub differentiates among keys within the same revision. Type is an optional suffix for special value (e.g., `t` if the value contains a tombstone). The value of the key-value pair contains the modification from previous revision, thus one delta from previous revision. The b+tree is ordered by key in lexical byte-order. Ranged lookups over revision deltas are fast; this enables quickly finding modifications from one specific revision to another. Compaction removes out-of-date keys-value pairs.
etcd also keeps a secondary in-memory [btree][btree] index to speed up range queries over keys. The keys in the btree index are the keys of the store exposed to user. The value is a pointer to the modification of the persistent b+tree. Compaction removes dead pointers.
[persistent-ds]: https://en.wikipedia.org/wiki/Persistent_data_structure
[btree]: https://en.wikipedia.org/wiki/B-tree
[b+tree]: https://en.wikipedia.org/wiki/B%2B_tree

View File

@ -0,0 +1,97 @@
# Glossary
This document defines the various terms used in etcd documentation, command line and source code.
## Alarm
The etcd server raises an alarm whenever the cluster needs operator intervention to remain reliable.
## Authentication
Authentication manages user access permissions for etcd resources.
## Client
A client connects to the etcd cluster to issue service requests such as fetching key-value pairs, writing data, or watching for updates.
## Cluster
Cluster consists of several members.
The node in each member follows raft consensus protocol to replicate logs. Cluster receives proposals from members, commits them and apply to local store.
## Compaction
Compaction discards all etcd event history and superseded keys prior to a given revision. It is used to reclaim storage space in the etcd backend database.
## Election
The etcd cluster holds elections among its members to choose a leader as part of the raft consensus protocol.
## Endpoint
A URL pointing to an etcd service or resource.
## Key
A user-defined identifier for storing and retrieving user-defined values in etcd.
## Key range
A set of keys containing either an individual key, a lexical interval for all x such that a < x <= b, or all keys greater than a given key.
## Keyspace
The set of all keys in an etcd cluster.
## Lease
A short-lived renewable contract that deletes keys associated with it on its expiry.
## Member
A logical etcd server that participates in serving an etcd cluster.
## Modification Revision
The first revision to hold the last write to a given key.
## Peer
Peer is another member of the same cluster.
## Proposal
A proposal is a request (for example a write request, a configuration change request) that needs to go through raft protocol.
## Quorum
The number of active members needed for consensus to modify the cluster state. etcd requires a member majority to reach quorum.
## Revision
A 64-bit cluster-wide counter that is incremented each time the keyspace is modified.
## Role
A unit of permissions over a set of key ranges which may be granted to a set of users for access control.
## Snapshot
A point-in-time backup of the etcd cluster state.
## Store
The physical storage backing the cluster keyspace.
## Transaction
An atomically executed set of operations. All modified keys in a transaction share the same modification revision.
## Key Version
The number of writes to a key since it was created, starting at 1. The version of a nonexistent or deleted key is 0.
## Watcher
A client opens a watcher to observe updates on a given key range.

View File

@ -0,0 +1,21 @@
# Why etcd
The name "etcd" originated from two ideas, the unix "/etc" folder and "d"istibuted systems. The "/etc" folder is a place to store configuration data for a single system whereas etcd stores configuration information for large scale distributed systems. Hence, a "d"istributed "/etc" is "etcd".
etcd stores metadata in a consistent and fault-tolerant way. Distributed systems use etcd as a consistent key-value store for configuration management, service discovery, and coordinating distributed work. Common distributed patterns using etcd include leader election, [distributed locks][etcd-concurrency], and monitoring machine liveness.
## Use cases
- Container Linux by CoreOS: Application running on [Container Linux][container-linux] gets automatic, zero-downtime Linux kernel updates. Container Linux uses [locksmith] to coordinate updates. locksmith implements a distributed semaphore over etcd to ensure only a subset of a cluster is rebooting at any given time.
- [Kubernetes][kubernetes] stores configuration data into etcd for service discovery and cluster management; etcd's consistency is crucial for correctly scheduling and operating services. The Kubernetes API server persists cluster state into etcd. It uses etcd's watch API to monitor the cluster and roll out critical configuration changes.
## Features and system comparisons
TODO
[etcd-concurrency]: https://godoc.org/github.com/coreos/etcd/clientv3/concurrency
[container-linux]: https://coreos.com/why
[locksmith]: https://github.com/coreos/locksmith
[kubernetes]: http://kubernetes.io/docs/whatisk8s

View File

@ -1,28 +1,45 @@
## Libraries and Tools
# Libraries and tools
**Tools**
- [etcdctl](https://github.com/coreos/etcdctl) - A command line client for etcd
- [etcdctl](https://github.com/coreos/etcd/tree/master/etcdctl) - A command line client for etcd
- [etcd-backup](https://github.com/fanhattan/etcd-backup) - A powerful command line utility for dumping/restoring etcd - Supports v2
- [etcd-dump](https://npmjs.org/package/etcd-dump) - Command line utility for dumping/restoring etcd.
- [etcd-fs](https://github.com/xetorthio/etcd-fs) - FUSE filesystem for etcd
- [etcddir](https://github.com/rekby/etcddir) - Realtime sync etcd and local directory. Work with windows and linux.
- [etcd-browser](https://github.com/henszey/etcd-browser) - A web-based key/value editor for etcd using AngularJS
- [etcd-lock](https://github.com/datawisesystems/etcd-lock) - A lock implementation for etcd
- [etcd-lock](https://github.com/datawisesystems/etcd-lock) - Master election & distributed r/w lock implementation using etcd - Supports v2
- [etcd-console](https://github.com/matishsiao/etcd-console) - A web-base key/value editor for etcd using PHP
- [etcd-viewer](https://github.com/nikfoundas/etcd-viewer) - An etcd key-value store editor/viewer written in Java
- [etcdtool](https://github.com/mickep76/etcdtool) - Export/Import/Edit etcd directory as JSON/YAML/TOML and Validate directory using JSON schema
- [etcd-rest](https://github.com/mickep76/etcd-rest) - Create generic REST API in Go using etcd as a backend with validation using JSON schema
- [etcdsh](https://github.com/kamilhark/etcdsh) - A command line client with support of command history and tab completion. Supports v2
- [etcdloadtest](https://github.com/sinsharat/etcdloadtest) - A command line load test client for etcd version 3.0 and above.
**Go libraries**
- [go-etcd](https://github.com/coreos/go-etcd) - Supports v2
- [etcd/clientv3](https://github.com/coreos/etcd/blob/master/clientv3) - the officially maintained Go client for v3
- [etcd/client](https://github.com/coreos/etcd/blob/master/client) - the officially maintained Go client for v2
- [go-etcd](https://github.com/coreos/go-etcd) - the deprecated official client. May be useful for older (<2.0.0) versions of etcd.
**Java libraries**
- [coreos/jetcd](https://github.com/coreos/jetcd) - Supports v3
- [boonproject/etcd](https://github.com/boonproject/boon/blob/master/etcd/README.md) - Supports v2, Async/Sync and waits
- [justinsb/jetcd](https://github.com/justinsb/jetcd)
- [diwakergupta/jetcd](https://github.com/diwakergupta/jetcd) - Supports v2
- [jurmous/etcd4j](https://github.com/jurmous/etcd4j) - Supports v2, Async/Sync, waits and SSL
- [AdoHe/etcd4j](http://github.com/AdoHe/etcd4j) - Supports v2 (enhance for real production cluster)
- [cdancy/etcd-rest](https://github.com/cdancy/etcd-rest) - Uses jclouds to provide a complete implementation of v2 API.
**Scala libraries**
- [maciej/etcd-client](https://github.com/maciej/etcd-client) - Supports v2. Akka HTTP-based fully async client
- [eiipii/etcdhttpclient](https://bitbucket.org/eiipii/etcdhttpclient) - Supports v2. Async HTTP client based on Netty and Scala Futures.
**Python libraries**
- [kragniz/python-etcd3](https://github.com/kragniz/python-etcd3) - Work in progress client for v3
- [jplana/python-etcd](https://github.com/jplana/python-etcd) - Supports v2
- [russellhaering/txetcd](https://github.com/russellhaering/txetcd) - a Twisted Python library
- [cholcombe973/autodock](https://github.com/cholcombe973/autodock) - A docker deployment automation tool
@ -32,6 +49,7 @@
- [stianeikeland/node-etcd](https://github.com/stianeikeland/node-etcd) - Supports v2 (w Coffeescript)
- [lavagetto/nodejs-etcd](https://github.com/lavagetto/nodejs-etcd) - Supports v2
- [deedubs/node-etcd-config](https://github.com/deedubs/node-etcd-config) - Supports v2
**Ruby libraries**
@ -42,9 +60,13 @@
**C libraries**
- [jdarcy/etcd-api](https://github.com/jdarcy/etcd-api) - Supports v2
- [shafreeck/cetcd](https://github.com/shafreeck/cetcd) - Supports v2
**C++ libraries**
- [edwardcapriolo/etcdcpp](https://github.com/edwardcapriolo/etcdcpp) - Supports v2
- [suryanathan/etcdcpp](https://github.com/suryanathan/etcdcpp) - Supports v2 (with waits)
- [nokia/etcd-cpp-api](https://github.com/nokia/etcd-cpp-api) - Supports v2
- [nokia/etcd-cpp-apiv3](https://github.com/nokia/etcd-cpp-apiv3) - Supports v3
**Clojure libraries**
@ -58,23 +80,33 @@
**.Net Libraries**
- [wangjia184/etcdnet](https://github.com/wangjia184/etcdnet) - Supports v2
- [drusellers/etcetera](https://github.com/drusellers/etcetera)
**PHP Libraries**
- [linkorb/etcd-php](https://github.com/linkorb/etcd-php)
- [activecollab/etcd](https://github.com/activecollab/etcd)
**Haskell libraries**
- [wereHamster/etcd-hs](https://github.com/wereHamster/etcd-hs)
**R libraries**
- [ropensci/etseed](https://github.com/ropensci/etseed)
**Nim libraries**
- [etcd_client](https://github.com/FedericoCeratto/nim-etcd-client)
**Tcl libraries**
- [efrecon/etcd-tcl](https://github.com/efrecon/etcd-tcl) - Supports v2, except wait.
A detailed recap of client functionalities can be found in the [clients compatibility matrix][clients-matrix.md].
**Gradle Plugins**
[clients-matrix.md]: https://github.com/coreos/etcd/blob/master/Documentation/clients-matrix.md
- [gradle-etcd-rest-plugin](https://github.com/cdancy/gradle-etcd-rest-plugin) - Supports v2
**Chef Integration**
@ -92,7 +124,9 @@ A detailed recap of client functionalities can be found in the [clients compatib
**Projects using etcd**
- [binocarlos/yoda](https://github.com/binocarlos/yoda) - etcd + ZeroMQ
- [blox/blox](https://github.com/blox/blox) - a collection of open source projects for container management and orchestration with AWS ECS
- [calavera/active-proxy](https://github.com/calavera/active-proxy) - HTTP Proxy configured with etcd
- [chain/chain](https://github.com/chain/chain) - software designed to operate and connect to highly scalable permissioned blockchain networks
- [derekchiang/etcdplus](https://github.com/derekchiang/etcdplus) - A set of distributed synchronization primitives built upon etcd
- [go-discover](https://github.com/flynn/go-discover) - service discovery in Go
- [gleicon/goreman](https://github.com/gleicon/goreman/tree/etcd) - Branch of the Go Foreman clone with etcd support
@ -103,9 +137,12 @@ A detailed recap of client functionalities can be found in the [clients compatib
- [configdb](https://git.autistici.org/ai/configdb/tree/master) - A REST relational abstraction on top of arbitrary database backends, aimed at storing configs and inventories.
- [scrz](https://github.com/scrz/scrz) - Container manager, stores configuration in etcd.
- [fleet](https://github.com/coreos/fleet) - Distributed init system
- [GoogleCloudPlatform/kubernetes](https://github.com/GoogleCloudPlatform/kubernetes) - Container cluster manager.
- [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes) - Container cluster manager introduced by Google.
- [mailgun/vulcand](https://github.com/mailgun/vulcand) - HTTP proxy that uses etcd as a configuration backend.
- [duedil-ltd/discodns](https://github.com/duedil-ltd/discodns) - Simple DNS nameserver using etcd as a database for names and records.
- [skynetservices/skydns](https://github.com/skynetservices/skydns) - RFC compliant DNS server
- [xordataexchange/crypt](https://github.com/xordataexchange/crypt) - Securely store values in etcd using GPG encryption
- [spf13/viper](https://github.com/spf13/viper) - Go configuration library, reads values from ENV, pflags, files, and etcd with optional encryption
- [lytics/metafora](https://github.com/lytics/metafora) - Go distributed task library
- [ryandoyle/nss-etcd](https://github.com/ryandoyle/nss-etcd) - A GNU libc NSS module for resolving names from etcd.
- [Gru](https://github.com/dnaeon/gru) - Orchestration made easy with Go

116
Documentation/metrics.md Normal file
View File

@ -0,0 +1,116 @@
# Metrics
etcd uses [Prometheus][prometheus] for metrics reporting. The metrics can be used for real-time monitoring and debugging. etcd does not persist its metrics; if a member restarts, the metrics will be reset.
The simplest way to see the available metrics is to cURL the metrics endpoint `/metrics`. The format is described [here](http://prometheus.io/docs/instrumenting/exposition_formats/).
Follow the [Prometheus getting started doc][prometheus-getting-started] to spin up a Prometheus server to collect etcd metrics.
The naming of metrics follows the suggested [Prometheus best practices][prometheus-naming]. A metric name has an `etcd` or `etcd_debugging` prefix as its namespace and a subsystem prefix (for example `wal` and `etcdserver`).
## etcd namespace metrics
The metrics under the `etcd` prefix are for monitoring and alerting. They are stable high level metrics. If there is any change of these metrics, it will be included in release notes.
Metrics that are etcd2 related are documented [v2 metrics guide][v2-http-metrics].
### Server
These metrics describe the status of the etcd server. In order to detect outages or problems for troubleshooting, the server metrics of every production etcd cluster should be closely monitored.
All these metrics are prefixed with `etcd_server_`
| Name | Description | Type |
|---------------------------|----------------------------------------------------------|---------|
| has_leader | Whether or not a leader exists. 1 is existence, 0 is not.| Gauge |
| leader_changes_seen_total | The number of leader changes seen. | Counter |
| proposals_committed_total | The total number of consensus proposals committed. | Gauge |
| proposals_applied_total | The total number of consensus proposals applied. | Gauge |
| proposals_pending | The current number of pending proposals. | Gauge |
| proposals_failed_total | The total number of failed proposals seen. | Counter |
`has_leader` indicates whether the member has a leader. If a member does not have a leader, it is
totally unavailable. If all the members in the cluster do not have any leader, the entire cluster
is totally unavailable.
`leader_changes_seen_total` counts the number of leader changes the member has seen since its start. Rapid leadership changes impact the performance of etcd significantly. It also signals that the leader is unstable, perhaps due to network connectivity issues or excessive load hitting the etcd cluster.
`proposals_committed_total` records the total number of consensus proposals committed. This gauge should increase over time if the cluster is healthy. Several healthy members of an etcd cluster may have different total committed proposals at once. This discrepancy may be due to recovering from peers after starting, lagging behind the leader, or being the leader and therefore having the most commits. It is important to monitor this metric across all the members in the cluster; a consistently large lag between a single member and its leader indicates that member is slow or unhealthy.
`proposals_applied_total` records the total number of consensus proposals applied. The etcd server applies every committed proposal asynchronously. The difference between `proposals_committed_total` and `proposals_applied_total` should usually be small (within a few thousands even under high load). If the difference between them continues to rise, it indicates that the etcd server is overloaded. This might happen when applying expensive queries like heavy range queries or large txn operations.
`proposals_pending` indicates how many proposals are queued to commit. Rising pending proposals suggests there is a high client load or the member cannot commit proposals.
`proposals_failed_total` are normally related to two issues: temporary failures related to a leader election or longer downtime caused by a loss of quorum in the cluster.
### Disk
These metrics describe the status of the disk operations.
All these metrics are prefixed with `etcd_disk_`.
| Name | Description | Type |
|------------------------------------|-------------------------------------------------------|-----------|
| wal_fsync_duration_seconds | The latency distributions of fsync called by wal | Histogram |
| backend_commit_duration_seconds | The latency distributions of commit called by backend.| Histogram |
A `wal_fsync` is called when etcd persists its log entries to disk before applying them.
A `backend_commit` is called when etcd commits an incremental snapshot of its most recent changes to disk.
High disk operation latencies (`wal_fsync_duration_seconds` or `backend_commit_duration_seconds`) often indicate disk issues. It may cause high request latency or make the cluster unstable.
### Network
These metrics describe the status of the network.
All these metrics are prefixed with `etcd_network_`
| Name | Description | Type |
|---------------------------|--------------------------------------------------------------------|---------------|
| peer_sent_bytes_total | The total number of bytes sent to the peer with ID `To`. | Counter(To) |
| peer_received_bytes_total | The total number of bytes received from the peer with ID `From`. | Counter(From) |
| peer_sent_failures_total | The total number of send failures from the peer with ID `To`. | Counter(To) |
| peer_received_failures_total | The total number of receive failures from the peer with ID `From`. | Counter(From) |
| peer_round_trip_time_seconds | Round-Trip-Time histogram between peers. | Histogram(To) |
| client_grpc_sent_bytes_total | The total number of bytes sent to grpc clients. | Counter |
| client_grpc_received_bytes_total| The total number of bytes received to grpc clients. | Counter |
`peer_sent_bytes_total` counts the total number of bytes sent to a specific peer. Usually the leader member sends more data than other members since it is responsible for transmitting replicated data.
`peer_received_bytes_total` counts the total number of bytes received from a specific peer. Usually follower members receive data only from the leader member.
### gRPC requests
These metrics are exposed via [go-grpc-prometheus][go-grpc-prometheus].
## etcd_debugging namespace metrics
The metrics under the `etcd_debugging` prefix are for debugging. They are very implementation dependent and volatile. They might be changed or removed without any warning in new etcd releases. Some of the metrics might be moved to the `etcd` prefix when they become more stable.
### Snapshot
| Name | Description | Type |
|--------------------------------------------|------------------------------------------------------------|-----------|
| snapshot_save_total_duration_seconds | The total latency distributions of save called by snapshot | Histogram |
Abnormally high snapshot duration (`snapshot_save_total_duration_seconds`) indicates disk issues and might cause the cluster to be unstable.
## Prometheus supplied metrics
The Prometheus client library provides a number of metrics under the `go` and `process` namespaces. There are a few that are particlarly interesting.
| Name | Description | Type |
|-----------------------------------|--------------------------------------------|--------------|
| process_open_fds | Number of open file descriptors. | Gauge |
| process_max_fds | Maximum number of open file descriptors. | Gauge |
Heavy file descriptor (`process_open_fds`) usage (i.e., near the process's file descriptor limit, `process_max_fds`) indicates a potential file descriptor exhaustion issue. If the file descriptors are exhausted, etcd may panic because it cannot create new WAL files.
[glossary-proposal]: learning/glossary.md#proposal
[prometheus]: http://prometheus.io/
[prometheus-getting-started]: http://prometheus.io/docs/introduction/getting_started/
[prometheus-naming]: http://prometheus.io/docs/practices/naming/
[v2-http-metrics]: v2/metrics.md#http-requests
[go-grpc-prometheus]: https://github.com/grpc-ecosystem/go-grpc-prometheus

View File

@ -0,0 +1,479 @@
# Clustering Guide
## Overview
Starting an etcd cluster statically requires that each member knows another in the cluster. In a number of cases, the IPs of the cluster members may be unknown ahead of time. In these cases, the etcd cluster can be bootstrapped with the help of a discovery service.
Once an etcd cluster is up and running, adding or removing members is done via [runtime reconfiguration][runtime-conf]. To better understand the design behind runtime reconfiguration, we suggest reading [the runtime configuration design document][runtime-reconf-design].
This guide will cover the following mechanisms for bootstrapping an etcd cluster:
* [Static](#static)
* [etcd Discovery](#etcd-discovery)
* [DNS Discovery](#dns-discovery)
Each of the bootstrapping mechanisms will be used to create a three machine etcd cluster with the following details:
|Name|Address|Hostname|
|------|---------|------------------|
|infra0|10.0.1.10|infra0.example.com|
|infra1|10.0.1.11|infra1.example.com|
|infra2|10.0.1.12|infra2.example.com|
## Static
As we know the cluster members, their addresses and the size of the cluster before starting, we can use an offline bootstrap configuration by setting the `initial-cluster` flag. Each machine will get either the following environment variables or command line:
```
ETCD_INITIAL_CLUSTER="infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380"
ETCD_INITIAL_CLUSTER_STATE=new
```
```
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state new
```
Note that the URLs specified in `initial-cluster` are the _advertised peer URLs_, i.e. they should match the value of `initial-advertise-peer-urls` on the respective nodes.
If spinning up multiple clusters (or creating and destroying a single cluster) with same configuration for testing purpose, it is highly recommended that each cluster is given a unique `initial-cluster-token`. By doing this, etcd can generate unique cluster IDs and member IDs for the clusters even if they otherwise have the exact same configuration. This can protect etcd from cross-cluster-interaction, which might corrupt the clusters.
etcd listens on [`listen-client-urls`][conf-listen-client] to accept client traffic. etcd member advertises the URLs specified in [`advertise-client-urls`][conf-adv-client] to other members, proxies, clients. Please make sure the `advertise-client-urls` are reachable from intended clients. A common mistake is setting `advertise-client-urls` to localhost or leave it as default if the remote clients should reach etcd.
On each machine, start etcd with these flags:
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state new
```
```
$ etcd --name infra1 --initial-advertise-peer-urls http://10.0.1.11:2380 \
--listen-peer-urls http://10.0.1.11:2380 \
--listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.11:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state new
```
```
$ etcd --name infra2 --initial-advertise-peer-urls http://10.0.1.12:2380 \
--listen-peer-urls http://10.0.1.12:2380 \
--listen-client-urls http://10.0.1.12:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.12:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state new
```
The command line parameters starting with `--initial-cluster` will be ignored on subsequent runs of etcd. Feel free to remove the environment variables or command line flags after the initial bootstrap process. If the configuration needs changes later (for example, adding or removing members to/from the cluster), see the [runtime configuration][runtime-conf] guide.
### TLS
etcd supports encrypted communication through the TLS protocol. TLS channels can be used for encrypted internal cluster communication between peers as well as encrypted client traffic. This section provides examples for setting up a cluster with peer and client TLS. Additional information detailing etcd's TLS support can be found in the [security guide][security-guide].
#### Self-signed certificates
A cluster using self-signed certificates both encrypts traffic and authenticates its connections. To start a cluster with self-signed certificates, each cluster member should have a unique key pair (`member.crt`, `member.key`) signed by a shared cluster CA certificate (`ca.crt`) for both peer connections and client connections. Certificates may be generated by following the etcd [TLS setup][tls-setup] example.
On each machine, etcd would be started with these flags:
```
$ etcd --name infra0 --initial-advertise-peer-urls https://10.0.1.10:2380 \
--listen-peer-urls https://10.0.1.10:2380 \
--listen-client-urls https://10.0.1.10:2379,https://127.0.0.1:2379 \
--advertise-client-urls https://10.0.1.10:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=https://10.0.1.10:2380,infra1=https://10.0.1.11:2380,infra2=https://10.0.1.12:2380 \
--initial-cluster-state new \
--client-cert-auth --trusted-ca-file=/path/to/ca-client.crt \
--cert-file=/path/to/infra0-client.crt --key-file=/path/to/infra0-client.key \
--peer-client-cert-auth --peer-trusted-ca-file=ca-peer.crt \
--peer-cert-file=/path/to/infra0-peer.crt --peer-key-file=/path/to/infra0-peer.key
```
```
$ etcd --name infra1 --initial-advertise-peer-urls https://10.0.1.11:2380 \
--listen-peer-urls https://10.0.1.11:2380 \
--listen-client-urls https://10.0.1.11:2379,https://127.0.0.1:2379 \
--advertise-client-urls https://10.0.1.11:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=https://10.0.1.10:2380,infra1=https://10.0.1.11:2380,infra2=https://10.0.1.12:2380 \
--initial-cluster-state new \
--client-cert-auth --trusted-ca-file=/path/to/ca-client.crt \
--cert-file=/path/to/infra1-client.crt --key-file=/path/to/infra1-client.key \
--peer-client-cert-auth --peer-trusted-ca-file=ca-peer.crt \
--peer-cert-file=/path/to/infra1-peer.crt --peer-key-file=/path/to/infra1-peer.key
```
```
$ etcd --name infra2 --initial-advertise-peer-urls https://10.0.1.12:2380 \
--listen-peer-urls https://10.0.1.12:2380 \
--listen-client-urls https://10.0.1.12:2379,https://127.0.0.1:2379 \
--advertise-client-urls https://10.0.1.12:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=https://10.0.1.10:2380,infra1=https://10.0.1.11:2380,infra2=https://10.0.1.12:2380 \
--initial-cluster-state new \
--client-cert-auth --trusted-ca-file=/path/to/ca-client.crt \
--cert-file=/path/to/infra2-client.crt --key-file=/path/to/infra2-client.key \
--peer-client-cert-auth --peer-trusted-ca-file=ca-peer.crt \
--peer-cert-file=/path/to/infra2-peer.crt --peer-key-file=/path/to/infra2-peer.key
```
#### Automatic certificates
If the cluster needs encrypted communication but does not require authenticated connections, etcd can be configured to automatically generate its keys. On initialization, each member creates its own set of keys based on its advertised IP addresses and hosts.
On each machine, etcd would be started with these flags:
```
$ etcd --name infra0 --initial-advertise-peer-urls https://10.0.1.10:2380 \
--listen-peer-urls https://10.0.1.10:2380 \
--listen-client-urls https://10.0.1.10:2379,https://127.0.0.1:2379 \
--advertise-client-urls https://10.0.1.10:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=https://10.0.1.10:2380,infra1=https://10.0.1.11:2380,infra2=https://10.0.1.12:2380 \
--initial-cluster-state new \
--auto-tls \
--peer-auto-tls
```
```
$ etcd --name infra1 --initial-advertise-peer-urls https://10.0.1.11:2380 \
--listen-peer-urls https://10.0.1.11:2380 \
--listen-client-urls https://10.0.1.11:2379,https://127.0.0.1:2379 \
--advertise-client-urls https://10.0.1.11:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=https://10.0.1.10:2380,infra1=https://10.0.1.11:2380,infra2=https://10.0.1.12:2380 \
--initial-cluster-state new \
--auto-tls \
--peer-auto-tls
```
```
$ etcd --name infra2 --initial-advertise-peer-urls https://10.0.1.12:2380 \
--listen-peer-urls https://10.0.1.12:2380 \
--listen-client-urls https://10.0.1.12:2379,https://127.0.0.1:2379 \
--advertise-client-urls https://10.0.1.12:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=https://10.0.1.10:2380,infra1=https://10.0.1.11:2380,infra2=https://10.0.1.12:2380 \
--initial-cluster-state new \
--auto-tls \
--peer-auto-tls
```
### Error cases
In the following example, we have not included our new host in the list of enumerated nodes. If this is a new cluster, the node _must_ be added to the list of initial cluster members.
```
$ etcd --name infra1 --initial-advertise-peer-urls http://10.0.1.11:2380 \
--listen-peer-urls https://10.0.1.11:2380 \
--listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.11:2379 \
--initial-cluster infra0=http://10.0.1.10:2380 \
--initial-cluster-state new
etcd: infra1 not listed in the initial cluster config
exit 1
```
In this example, we are attempting to map a node (infra0) on a different address (127.0.0.1:2380) than its enumerated address in the cluster list (10.0.1.10:2380). If this node is to listen on multiple addresses, all addresses _must_ be reflected in the "initial-cluster" configuration directive.
```
$ etcd --name infra0 --initial-advertise-peer-urls http://127.0.0.1:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state=new
etcd: error setting up initial cluster: infra0 has different advertised URLs in the cluster and advertised peer URLs list
exit 1
```
If a peer is configured with a different set of configuration arguments and attempts to join this cluster, etcd will report a cluster ID mismatch will exit.
```
$ etcd --name infra3 --initial-advertise-peer-urls http://10.0.1.13:2380 \
--listen-peer-urls http://10.0.1.13:2380 \
--listen-client-urls http://10.0.1.13:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.13:2379 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra3=http://10.0.1.13:2380 \
--initial-cluster-state=new
etcd: conflicting cluster ID to the target cluster (c6ab534d07e8fcc4 != bc25ea2a74fb18b0). Exiting.
exit 1
```
## Discovery
In a number of cases, the IPs of the cluster peers may not be known ahead of time. This is common when utilizing cloud providers or when the network uses DHCP. In these cases, rather than specifying a static configuration, use an existing etcd cluster to bootstrap a new one. This process is called "discovery".
There two methods that can be used for discovery:
* etcd discovery service
* DNS SRV records
### etcd discovery
To better understand the design of the discovery service protocol, we suggest reading the discovery service protocol [documentation][discovery-proto].
#### Lifetime of a discovery URL
A discovery URL identifies a unique etcd cluster. Instead of reusing an existing discovery URL, each etcd instance shares a new discovery URL to bootstrap the new cluster.
Moreover, discovery URLs should ONLY be used for the initial bootstrapping of a cluster. To change cluster membership after the cluster is already running, see the [runtime reconfiguration][runtime-conf] guide.
#### Custom etcd discovery service
Discovery uses an existing cluster to bootstrap itself. If using a private etcd cluster, create a URL like so:
```
$ curl -X PUT https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83/_config/size -d value=3
```
By setting the size key to the URL, a discovery URL is created with an expected cluster size of 3.
The URL to use in this case will be `https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83` and the etcd members will use the `https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83` directory for registration as they start.
**Each member must have a different name flag specified. `Hostname` or `machine-id` can be a good choice. Or discovery will fail due to duplicated name.**
Now we start etcd with those relevant flags for each member:
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83
```
```
$ etcd --name infra1 --initial-advertise-peer-urls http://10.0.1.11:2380 \
--listen-peer-urls http://10.0.1.11:2380 \
--listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.11:2379 \
--discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83
```
```
$ etcd --name infra2 --initial-advertise-peer-urls http://10.0.1.12:2380 \
--listen-peer-urls http://10.0.1.12:2380 \
--listen-client-urls http://10.0.1.12:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.12:2379 \
--discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83
```
This will cause each member to register itself with the custom etcd discovery service and begin the cluster once all machines have been registered.
#### Public etcd discovery service
If no exiting cluster is available, use the public discovery service hosted at `discovery.etcd.io`. To create a private discovery URL using the "new" endpoint, use the command:
```
$ curl https://discovery.etcd.io/new?size=3
https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
This will create the cluster with an initial size of 3 members. If no size is specified, a default of 3 is used.
```
ETCD_DISCOVERY=https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
```
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
**Each member must have a different name flag specified or else discovery will fail due to duplicated names. `Hostname` or `machine-id` can be a good choice. **
Now we start etcd with those relevant flags for each member:
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
```
$ etcd --name infra1 --initial-advertise-peer-urls http://10.0.1.11:2380 \
--listen-peer-urls http://10.0.1.11:2380 \
--listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.11:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
```
$ etcd --name infra2 --initial-advertise-peer-urls http://10.0.1.12:2380 \
--listen-peer-urls http://10.0.1.12:2380 \
--listen-client-urls http://10.0.1.12:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.12:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
This will cause each member to register itself with the discovery service and begin the cluster once all members have been registered.
Use the environment variable `ETCD_DISCOVERY_PROXY` to cause etcd to use an HTTP proxy to connect to the discovery service.
#### Error and warning cases
##### Discovery server errors
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
etcd: error: the cluster doesnt have a size configuration value in https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de/_config
exit 1
```
##### Warnings
This is a harmless warning indicating the discovery URL will be ignored on this machine.
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
etcdserver: discovery token ignored since a cluster has already been initialized. Valid log found at /var/lib/etcd
```
### DNS discovery
DNS [SRV records][rfc-srv] can be used as a discovery mechanism.
The `-discovery-srv` flag can be used to set the DNS domain name where the discovery SRV records can be found.
The following DNS SRV records are looked up in the listed order:
* _etcd-server-ssl._tcp.example.com
* _etcd-server._tcp.example.com
If `_etcd-server-ssl._tcp.example.com` is found then etcd will attempt the bootstrapping process over TLS.
To help clients discover the etcd cluster, the following DNS SRV records are looked up in the listed order:
* _etcd-client._tcp.example.com
* _etcd-client-ssl._tcp.example.com
If `_etcd-client-ssl._tcp.example.com` is found, clients will attempt to communicate with the etcd cluster over SSL/TLS.
If etcd is using TLS without a custom certificate authority, the discovery domain (e.g., example.com) must match the SRV record domain (e.g., infra1.example.com). This is to mitigate attacks that forge SRV records to point to a different domain; the domain would have a valid certificate under PKI but be controlled by an unknown third party.
#### Create DNS SRV records
```
$ dig +noall +answer SRV _etcd-server._tcp.example.com
_etcd-server._tcp.example.com. 300 IN SRV 0 0 2380 infra0.example.com.
_etcd-server._tcp.example.com. 300 IN SRV 0 0 2380 infra1.example.com.
_etcd-server._tcp.example.com. 300 IN SRV 0 0 2380 infra2.example.com.
```
```
$ dig +noall +answer SRV _etcd-client._tcp.example.com
_etcd-client._tcp.example.com. 300 IN SRV 0 0 2379 infra0.example.com.
_etcd-client._tcp.example.com. 300 IN SRV 0 0 2379 infra1.example.com.
_etcd-client._tcp.example.com. 300 IN SRV 0 0 2379 infra2.example.com.
```
```
$ dig +noall +answer infra0.example.com infra1.example.com infra2.example.com
infra0.example.com. 300 IN A 10.0.1.10
infra1.example.com. 300 IN A 10.0.1.11
infra2.example.com. 300 IN A 10.0.1.12
```
#### Bootstrap the etcd cluster using DNS
etcd cluster members can listen on domain names or IP address, the bootstrap process will resolve DNS A records.
The resolved address in `--initial-advertise-peer-urls` *must match* one of the resolved addresses in the SRV targets. The etcd member reads the resolved address to find out if it belongs to the cluster defined in the SRV records.
```
$ etcd --name infra0 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://infra0.example.com:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://infra0.example.com:2379 \
--listen-client-urls http://infra0.example.com:2379 \
--listen-peer-urls http://infra0.example.com:2380
```
```
$ etcd --name infra1 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://infra1.example.com:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://infra1.example.com:2379 \
--listen-client-urls http://infra1.example.com:2379 \
--listen-peer-urls http://infra1.example.com:2380
```
```
$ etcd --name infra2 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://infra2.example.com:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://infra2.example.com:2379 \
--listen-client-urls http://infra2.example.com:2379 \
--listen-peer-urls http://infra2.example.com:2380
```
The cluster can also bootstrap using IP addresses instead of domain names:
```
$ etcd --name infra0 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://10.0.1.10:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://10.0.1.10:2379 \
--listen-client-urls http://10.0.1.10:2379 \
--listen-peer-urls http://10.0.1.10:2380
```
```
$ etcd --name infra1 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://10.0.1.11:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://10.0.1.11:2379 \
--listen-client-urls http://10.0.1.11:2379 \
--listen-peer-urls http://10.0.1.11:2380
```
```
$ etcd --name infra2 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://10.0.1.12:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://10.0.1.12:2379 \
--listen-client-urls http://10.0.1.12:2379 \
--listen-peer-urls http://10.0.1.12:2380
```
### Gateway
etcd gateway is a simple TCP proxy that forwards network data to the etcd cluster. Please read [gateway guide] for more information.
### Proxy
When the `--proxy` flag is set, etcd runs in [proxy mode][proxy]. This proxy mode only supports the etcd v2 API; there are no plans to support the v3 API. Instead, for v3 API support, there will be a new proxy with enhanced features following the etcd 3.0 release.
To setup an etcd cluster with proxies of v2 API, please read the the [clustering doc in etcd 2.3 release][clustering_etcd2].
[conf-adv-client]: configuration.md#--advertise-client-urls
[conf-listen-client]: configuration.md#--listen-client-urls
[discovery-proto]: ../dev-internal/discovery_protocol.md
[rfc-srv]: http://www.ietf.org/rfc/rfc2052.txt
[runtime-conf]: runtime-configuration.md
[runtime-reconf-design]: runtime-reconf-design.md
[proxy]: https://github.com/coreos/etcd/blob/release-2.3/Documentation/proxy.md
[clustering_etcd2]: https://github.com/coreos/etcd/blob/release-2.3/Documentation/clustering.md
[security-guide]: security.md
[tls-setup]: /hack/tls-setup
[gateway]: gateway.md

View File

@ -0,0 +1,294 @@
# Configuration flags
etcd is configurable through command-line flags and environment variables. Options set on the command line take precedence over those from the environment.
The format of environment variable for flag `--my-flag` is `ETCD_MY_FLAG`. It applies to all flags.
The [official etcd ports][iana-ports] are 2379 for client requests and 2380 for peer communication. The etcd ports can be set to accept TLS traffic, non-TLS traffic, or both TLS and non-TLS traffic.
To start etcd automatically using custom settings at startup in Linux, using a [systemd][systemd-intro] unit is highly recommended.
## Member flags
### --name
+ Human-readable name for this member.
+ default: "default"
+ env variable: ETCD_NAME
+ This value is referenced as this node's own entries listed in the `--initial-cluster` flag (e.g., `default=http://localhost:2380`). This needs to match the key used in the flag if using [static bootstrapping][build-cluster]. When using discovery, each member must have a unique name. `Hostname` or `machine-id` can be a good choice.
### --data-dir
+ Path to the data directory.
+ default: "${name}.etcd"
+ env variable: ETCD_DATA_DIR
### --wal-dir
+ Path to the dedicated wal directory. If this flag is set, etcd will write the WAL files to the walDir rather than the dataDir. This allows a dedicated disk to be used, and helps avoid io competition between logging and other IO operations.
+ default: ""
+ env variable: ETCD_WAL_DIR
### --snapshot-count
+ Number of committed transactions to trigger a snapshot to disk.
+ default: "10000"
+ env variable: ETCD_SNAPSHOT_COUNT
### --heartbeat-interval
+ Time (in milliseconds) of a heartbeat interval.
+ default: "100"
+ env variable: ETCD_HEARTBEAT_INTERVAL
### --election-timeout
+ Time (in milliseconds) for an election to timeout. See [Documentation/tuning.md][tuning] for details.
+ default: "1000"
+ env variable: ETCD_ELECTION_TIMEOUT
### --listen-peer-urls
+ List of URLs to listen on for peer traffic. This flag tells the etcd to accept incoming requests from its peers on the specified scheme://IP:port combinations. Scheme can be either http or https.If 0.0.0.0 is specified as the IP, etcd listens to the given port on all interfaces. If an IP address is given as well as a port, etcd will listen on the given port and interface. Multiple URLs may be used to specify a number of addresses and ports to listen on. The etcd will respond to requests from any of the listed addresses and ports.
+ default: "http://localhost:2380"
+ env variable: ETCD_LISTEN_PEER_URLS
+ example: "http://10.0.0.1:2380"
+ invalid example: "http://example.com:2380" (domain name is invalid for binding)
### --listen-client-urls
+ List of URLs to listen on for client traffic. This flag tells the etcd to accept incoming requests from the clients on the specified scheme://IP:port combinations. Scheme can be either http or https. If 0.0.0.0 is specified as the IP, etcd listens to the given port on all interfaces. If an IP address is given as well as a port, etcd will listen on the given port and interface. Multiple URLs may be used to specify a number of addresses and ports to listen on. The etcd will respond to requests from any of the listed addresses and ports.
+ default: "http://localhost:2379"
+ env variable: ETCD_LISTEN_CLIENT_URLS
+ example: "http://10.0.0.1:2379"
+ invalid example: "http://example.com:2379" (domain name is invalid for binding)
### --max-snapshots
+ Maximum number of snapshot files to retain (0 is unlimited)
+ default: 5
+ env variable: ETCD_MAX_SNAPSHOTS
+ The default for users on Windows is unlimited, and manual purging down to 5 (or some preference for safety) is recommended.
### --max-wals
+ Maximum number of wal files to retain (0 is unlimited)
+ default: 5
+ env variable: ETCD_MAX_WALS
+ The default for users on Windows is unlimited, and manual purging down to 5 (or some preference for safety) is recommended.
### --cors
+ Comma-separated white list of origins for CORS (cross-origin resource sharing).
+ default: none
+ env variable: ETCD_CORS
## Clustering flags
`--initial` prefix flags are used in bootstrapping ([static bootstrap][build-cluster], [discovery-service bootstrap][discovery] or [runtime reconfiguration][reconfig]) a new member, and ignored when restarting an existing member.
`--discovery` prefix flags need to be set when using [discovery service][discovery].
### --initial-advertise-peer-urls
+ List of this member's peer URLs to advertise to the rest of the cluster. These addresses are used for communicating etcd data around the cluster. At least one must be routable to all cluster members. These URLs can contain domain names.
+ default: "http://localhost:2380"
+ env variable: ETCD_INITIAL_ADVERTISE_PEER_URLS
+ example: "http://example.com:2380, http://10.0.0.1:2380"
### --initial-cluster
+ Initial cluster configuration for bootstrapping.
+ default: "default=http://localhost:2380"
+ env variable: ETCD_INITIAL_CLUSTER
+ The key is the value of the `--name` flag for each node provided. The default uses `default` for the key because this is the default for the `--name` flag.
### --initial-cluster-state
+ Initial cluster state ("new" or "existing"). Set to `new` for all members present during initial static or DNS bootstrapping. If this option is set to `existing`, etcd will attempt to join the existing cluster. If the wrong value is set, etcd will attempt to start but fail safely.
+ default: "new"
+ env variable: ETCD_INITIAL_CLUSTER_STATE
[static bootstrap]: clustering.md#static
### --initial-cluster-token
+ Initial cluster token for the etcd cluster during bootstrap.
+ default: "etcd-cluster"
+ env variable: ETCD_INITIAL_CLUSTER_TOKEN
### --advertise-client-urls
+ List of this member's client URLs to advertise to the rest of the cluster. These URLs can contain domain names.
+ default: "http://localhost:2379"
+ env variable: ETCD_ADVERTISE_CLIENT_URLS
+ example: "http://example.com:2379, http://10.0.0.1:2379"
+ Be careful if advertising URLs such as http://localhost:2379 from a cluster member and are using the proxy feature of etcd. This will cause loops, because the proxy will be forwarding requests to itself until its resources (memory, file descriptors) are eventually depleted.
### --discovery
+ Discovery URL used to bootstrap the cluster.
+ default: none
+ env variable: ETCD_DISCOVERY
### --discovery-srv
+ DNS srv domain used to bootstrap the cluster.
+ default: none
+ env variable: ETCD_DISCOVERY_SRV
### --discovery-fallback
+ Expected behavior ("exit" or "proxy") when discovery services fails. "proxy" supports v2 API only.
+ default: "proxy"
+ env variable: ETCD_DISCOVERY_FALLBACK
### --discovery-proxy
+ HTTP proxy to use for traffic to discovery service.
+ default: none
+ env variable: ETCD_DISCOVERY_PROXY
### --strict-reconfig-check
+ Reject reconfiguration requests that would cause quorum loss.
+ default: false
+ env variable: ETCD_STRICT_RECONFIG_CHECK
### --auto-compaction-retention
+ Auto compaction retention for mvcc key value store in hour. 0 means disable auto compaction.
+ default: 0
+ env variable: ETCD_AUTO_COMPACTION_RETENTION
## Proxy flags
`--proxy` prefix flags configures etcd to run in [proxy mode][proxy]. "proxy" supports v2 API only.
### --proxy
+ Proxy mode setting ("off", "readonly" or "on").
+ default: "off"
+ env variable: ETCD_PROXY
### --proxy-failure-wait
+ Time (in milliseconds) an endpoint will be held in a failed state before being reconsidered for proxied requests.
+ default: 5000
+ env variable: ETCD_PROXY_FAILURE_WAIT
### --proxy-refresh-interval
+ Time (in milliseconds) of the endpoints refresh interval.
+ default: 30000
+ env variable: ETCD_PROXY_REFRESH_INTERVAL
### --proxy-dial-timeout
+ Time (in milliseconds) for a dial to timeout or 0 to disable the timeout
+ default: 1000
+ env variable: ETCD_PROXY_DIAL_TIMEOUT
### --proxy-write-timeout
+ Time (in milliseconds) for a write to timeout or 0 to disable the timeout.
+ default: 5000
+ env variable: ETCD_PROXY_WRITE_TIMEOUT
### --proxy-read-timeout
+ Time (in milliseconds) for a read to timeout or 0 to disable the timeout.
+ Don't change this value if using watches because use long polling requests.
+ default: 0
+ env variable: ETCD_PROXY_READ_TIMEOUT
## Security flags
The security flags help to [build a secure etcd cluster][security].
### --ca-file [DEPRECATED]
+ Path to the client server TLS CA file. `--ca-file ca.crt` could be replaced by `--trusted-ca-file ca.crt --client-cert-auth` and etcd will perform the same.
+ default: none
+ env variable: ETCD_CA_FILE
### --cert-file
+ Path to the client server TLS cert file.
+ default: none
+ env variable: ETCD_CERT_FILE
### --key-file
+ Path to the client server TLS key file.
+ default: none
+ env variable: ETCD_KEY_FILE
### --client-cert-auth
+ Enable client cert authentication.
+ default: false
+ env variable: ETCD_CLIENT_CERT_AUTH
### --trusted-ca-file
+ Path to the client server TLS trusted CA key file.
+ default: none
+ env variable: ETCD_TRUSTED_CA_FILE
### --auto-tls
+ Client TLS using generated certificates
+ default: false
+ env variable: ETCD_AUTO_TLS
### --peer-ca-file [DEPRECATED]
+ Path to the peer server TLS CA file. `--peer-ca-file ca.crt` could be replaced by `--peer-trusted-ca-file ca.crt --peer-client-cert-auth` and etcd will perform the same.
+ default: none
+ env variable: ETCD_PEER_CA_FILE
### --peer-cert-file
+ Path to the peer server TLS cert file.
+ default: none
+ env variable: ETCD_PEER_CERT_FILE
### --peer-key-file
+ Path to the peer server TLS key file.
+ default: none
+ env variable: ETCD_PEER_KEY_FILE
### --peer-client-cert-auth
+ Enable peer client cert authentication.
+ default: false
+ env variable: ETCD_PEER_CLIENT_CERT_AUTH
### --peer-trusted-ca-file
+ Path to the peer server TLS trusted CA file.
+ default: none
+ env variable: ETCD_PEER_TRUSTED_CA_FILE
### --peer-auto-tls
+ Peer TLS using generated certificates
+ default: false
+ env variable: ETCD_PEER_AUTO_TLS
## Logging flags
### --debug
+ Drop the default log level to DEBUG for all subpackages.
+ default: false (INFO for all packages)
+ env variable: ETCD_DEBUG
### --log-package-levels
+ Set individual etcd subpackages to specific log levels. An example being `etcdserver=WARNING,security=DEBUG`
+ default: none (INFO for all packages)
+ env variable: ETCD_LOG_PACKAGE_LEVELS
## Unsafe flags
Please be CAUTIOUS when using unsafe flags because it will break the guarantees given by the consensus protocol.
For example, it may panic if other members in the cluster are still alive.
Follow the instructions when using these flags.
### --force-new-cluster
+ Force to create a new one-member cluster. It commits configuration changes forcing to remove all existing members in the cluster and add itself. It needs to be set to [restore a backup][restore].
+ default: false
+ env variable: ETCD_FORCE_NEW_CLUSTER
## Miscellaneous flags
### --version
+ Print the version and exit.
+ default: false
### --config-file
+ Load server configuration from a file.
+ default: none
## Profiling flags
### --enable-pprof
+ Enable runtime profiling data via HTTP server. Address is at client URL + "/debug/pprof/"
+ default: false
### --metrics
+ Set level of detail for exported metrics, specify 'extensive' to include histogram metrics.
+ default: basic
[build-cluster]: clustering.md#static
[reconfig]: runtime-configuration.md
[discovery]: clustering.md#discovery
[iana-ports]: https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=etcd
[proxy]: ../v2/proxy.md
[restore]: ../v2/admin_guide.md#restoring-a-backup
[security]: security.md
[systemd-intro]: http://freedesktop.org/wiki/Software/systemd/
[tuning]: ../tuning.md#time-parameters

View File

@ -0,0 +1,127 @@
# Run etcd clusters inside containers
The following guide shows how to run etcd with rkt and Docker using the [static bootstrap process](clustering.md#static).
## rkt
### Running a single node etcd
The following rkt run command will expose the etcd client API on port 2379 and expose the peer API on port 2380.
Use the host IP address when configuring etcd.
```
export NODE1=192.168.1.21
```
Trust the CoreOS [App Signing Key](https://coreos.com/security/app-signing-key/).
```
sudo rkt trust --prefix coreos.com/etcd
# gpg key fingerprint is: 18AD 5014 C99E F7E3 BA5F 6CE9 50BD D3E0 FC8A 365E
```
Run the `v3.0.6` version of etcd or specify another release version.
```
sudo rkt run --net=default:IP=${NODE1} coreos.com/etcd:v3.0.6 -- -name=node1 -advertise-client-urls=http://${NODE1}:2379 -initial-advertise-peer-urls=http://${NODE1}:2380 -listen-client-urls=http://0.0.0.0:2379 -listen-peer-urls=http://${NODE1}:2380 -initial-cluster=node1=http://${NODE1}:2380
```
List the cluster member.
```
etcdctl --endpoints=http://192.168.1.21:2379 member list
```
### Running a 3 node etcd cluster
Setup a 3 node cluster with rkt locally, using the `-initial-cluster` flag.
```sh
export NODE1=172.16.28.21
export NODE2=172.16.28.22
export NODE3=172.16.28.23
```
```
# node 1
sudo rkt run --net=default:IP=${NODE1} coreos.com/etcd:v3.0.6 -- -name=node1 -advertise-client-urls=http://${NODE1}:2379 -initial-advertise-peer-urls=http://${NODE1}:2380 -listen-client-urls=http://0.0.0.0:2379 -listen-peer-urls=http://${NODE1}:2380 -initial-cluster=node1=http://${NODE1}:2380,node2=http://${NODE2}:2380,node3=http://${NODE3}:2380
# node 2
sudo rkt run --net=default:IP=${NODE2} coreos.com/etcd:v3.0.6 -- -name=node2 -advertise-client-urls=http://${NODE2}:2379 -initial-advertise-peer-urls=http://${NODE2}:2380 -listen-client-urls=http://0.0.0.0:2379 -listen-peer-urls=http://${NODE2}:2380 -initial-cluster=node1=http://${NODE1}:2380,node2=http://${NODE2}:2380,node3=http://${NODE3}:2380
# node 3
sudo rkt run --net=default:IP=${NODE3} coreos.com/etcd:v3.0.6 -- -name=node3 -advertise-client-urls=http://${NODE3}:2379 -initial-advertise-peer-urls=http://${NODE3}:2380 -listen-client-urls=http://0.0.0.0:2379 -listen-peer-urls=http://${NODE3}:2380 -initial-cluster=node1=http://${NODE1}:2380,node2=http://${NODE2}:2380,node3=http://${NODE3}:2380
```
Verify the cluster is healthy and can be reached.
```
ETCDCTL_API=3 etcdctl --endpoints=http://172.16.28.21:2379,http://172.16.28.22:2379,http://172.16.28.23:2379 endpoint health
```
### DNS
Production clusters which refer to peers by DNS name known to the local resolver must mount the [host's DNS configuration](https://coreos.com/kubernetes/docs/latest/kubelet-wrapper.html#customizing-rkt-options).
## Docker
In order to expose the etcd API to clients outside of Docker host, use the host IP address of the container. Please see [`docker inspect`](https://docs.docker.com/engine/reference/commandline/inspect) for more detail on how to get the IP address. Alternatively, specify `--net=host` flag to `docker run` command to skip placing the container inside of a separate network stack.
```
# For each machine
ETCD_VERSION=v3.0.0
TOKEN=my-etcd-token
CLUSTER_STATE=new
NAME_1=etcd-node-0
NAME_2=etcd-node-1
NAME_3=etcd-node-2
HOST_1=10.20.30.1
HOST_2=10.20.30.2
HOST_3=10.20.30.3
CLUSTER=${NAME_1}=http://${HOST_1}:2380,${NAME_2}=http://${HOST_2}:2380,${NAME_3}=http://${HOST_3}:2380
# For node 1
THIS_NAME=${NAME_1}
THIS_IP=${HOST_1}
sudo docker run --net=host --name etcd quay.io/coreos/etcd:${ETCD_VERSION} \
/usr/local/bin/etcd \
--data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN}
# For node 2
THIS_NAME=${NAME_2}
THIS_IP=${HOST_2}
sudo docker run --net=host --name etcd quay.io/coreos/etcd:${ETCD_VERSION} \
/usr/local/bin/etcd \
--data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN}
# For node 3
THIS_NAME=${NAME_3}
THIS_IP=${HOST_3}
sudo docker run --net=host --name etcd quay.io/coreos/etcd:${ETCD_VERSION} \
/usr/local/bin/etcd \
--data-dir=data.etcd --name ${THIS_NAME} \
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN}
```
To run `etcdctl` using API version 3:
```
docker exec etcd /bin/sh -c "export ETCDCTL_API=3 && /usr/local/bin/etcdctl put foo bar"
```
## Bare Metal
To provision a 3 node etcd cluster on bare-metal, you might find the examples in the [baremetal repo](https://github.com/coreos/coreos-baremetal/tree/master/examples) useful.

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -0,0 +1,44 @@
# Understand failures
Failures are common in a large deployment of machines. A machine fails when its hardware or software malfunctions. Multiple machines fail together when there are power failures or network issues. Multiple kinds of failures can also happen at once; it is almost impossible to enumerate all possible failure cases.
In this section, we catalog kinds of failures and discuss how etcd is designed to tolerate these failures. Most users, if not all, can map a particular failure into one kind of failure. To prepare for rare or [unrecoverable failures][unrecoverable], always [back up][backup] the etcd cluster.
## Minor followers failure
When fewer than half of the followers fail, the etcd cluster can still accept requests and make progress without any major disruption. For example, two follower failures will not affect a five member etcd clusters operation. However, clients will lose connectivity to the failed members. Client libraries should hide these interruptions from users for read requests by automatically reconnecting to other members. Operators should expect the system load on the other members to increase due to the reconnections.
## Leader failure
When a leader fails, the etcd cluster automatically elects a new leader. The election does not happen instantly once the leader fails. It takes about an election timeout to elect a new leader since the failure detection model is timeout based.
During the leader election the cluster cannot process any writes. Write requests sent during the election are queued for processing until a new leader is elected.
Writes already sent to the old leader but not yet committed may be lost. The new leader has the power to rewrite any uncommitted entries from the previous leader. From the user perspective, some write requests might time out after a new leader election. However, no committed writes are ever lost.
The new leader extends timeouts automatically for all leases. This mechanism ensures a lease will not expire before the granted TTL even if it was granted by the old leader.
## Majority failure
When the majority members of the cluster fail, the etcd cluster fails and cannot accept more writes.
The etcd cluster can only recover from a majority failure once the majority of members become available. If a majority of members cannot come back online, then the operator must start [disaster recovery][unrecoverable] to recover the cluster.
Once a majority of members works, the etcd cluster elects a new leader automatically and returns to a healthy state. The new leader extends timeouts automatically for all leases. This mechanism ensures no lease expires due to server side unavailability.
## Network partition
A network partition is similar to a minor followers failure or a leader failure. A network partition divides the etcd cluster into two parts; one with a member majority and the other with a member minority. The majority side becomes the available cluster and the minority side is unavailable; there is no “split-brain” in etcd.
If the leader is on the majority side, then from the majority point of view the failure is a minority follower failure. If the leader is on the minority side, then it is a leader failure. The leader on the minority side steps down and the majority side elects a new leader.
Once the network partition clears, the minority side automatically recognizes the leader from the majority side and recovers its state.
## Failure during bootstrapping
A cluster bootstrap is only successful if all required members successfully start. If any failure happens during bootstrapping, remove the data directories on all members and re-bootstrap the cluster with a new cluster-token or new discovery token.
Of course, it is possible to recover a failed bootstrapped cluster like recovering a running cluster. However, it almost always takes more time and resources to recover that cluster than bootstrapping a new one, since there is no data to recover.
[backup]: maintenance.md#snapshot-backup
[unrecoverable]: recovery.md#disaster-recovery

View File

@ -0,0 +1,66 @@
# etcd gateway
## What is etcd gateway
etcd gateway is a simple TCP proxy that forwards network data to the etcd cluster. The gateway is stateless and transparent; it neither inspects client requests nor interferes with cluster responses.
The gateway supports multiple etcd server endpoints. When the gateway starts, it randomly picks one etcd server endpoint and forwards all requests to that endpoint. This endpoint serves all requests until the gateway detects a network failure. If the gateway detects an endpoint failure, it will switch to a different endpoint, if available, to hide failures from its clients. Other retry policies, such as weighted round-robin, may be supported in the future.
## When to use etcd gateway
Every application that accesses etcd must first have the address of an etcd cluster client endpoint. If multiple applications on the same server access the same etcd cluster, every application still needs to know the advertised client endpoints of the etcd cluster. If the etcd cluster is reconfigured to have different endpoints, every application may also need to update its endpoint list. This wide-scale reconfiguration is both tedious and error prone.
etcd gateway solves this problem by serving as a stable local endpoint. A typical etcd gateway configuration has
each machine running a gateway listening on a local address and every etcd application connecting to its local gateway. The upshot is only the gateway needs to update its endpoints instead of updating each and every application.
In summary, to automatically propagate cluster endpoint changes, the etcd gateway runs on every machine serving multiple applications accessing same etcd cluster.
## When not to use etcd gateway
- Improving performance
The gateway is not designed for improving etcd cluster performance. It does not provide caching, watch coalescing or batching. The etcd team is developing a caching proxy designed for improving cluster scalability.
- Running on a cluster management system
Advanced cluster management systems like Kubernetes natively support service discovery. Applications can access an etcd cluster with a DNS name or a virtual IP address managed by the system. For example, kube-proxy is equivalent to etcd gateway.
## Start etcd gateway
Consider an etcd cluster with the following static endpoints:
|Name|Address|Hostname|
|------|---------|------------------|
|infra0|10.0.1.10|infra0.example.com|
|infra1|10.0.1.11|infra1.example.com|
|infra2|10.0.1.12|infra2.example.com|
Start the etcd gateway to use these static endpoints with the command:
```bash
$ etcd gateway start --endpoints=infra0.example.com,infra1.example.com,infra2.example.com
2016-08-16 11:21:18.867350 I | tcpproxy: ready to proxy client requests to [...]
```
Alternatively, if using DNS for service discovery, consider the DNS SRV entries:
```bash
$ dig +noall +answer SRV _etcd-client._tcp.example.com
_etcd-client._tcp.example.com. 300 IN SRV 0 0 2379 infra0.example.com.
_etcd-client._tcp.example.com. 300 IN SRV 0 0 2379 infra1.example.com.
_etcd-client._tcp.example.com. 300 IN SRV 0 0 2379 infra2.example.com.
```
```bash
$ dig +noall +answer infra0.example.com infra1.example.com infra2.example.com
infra0.example.com. 300 IN A 10.0.1.10
infra1.example.com. 300 IN A 10.0.1.11
infra2.example.com. 300 IN A 10.0.1.12
```
Start the etcd gateway to fetch the endpoints from the DNS SRV entries with the command:
```bash
$ etcd gateway --discovery-srv=example.com
2016-08-16 11:21:18.867350 I | tcpproxy: ready to proxy client requests to [...]
```

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
# gRPC proxy
*This is an alpha feature, we are looking for early feedback.*
The gRPC proxy is a stateless etcd reverse proxy operating at the gRPC layer (L7). The proxy is designed to reduce the total processing load on the core etcd cluster. For horizontal scalability, it coalesces watch and lease API requests. To protect the cluster against abusive clients, it caches key range requests.
The gRPC proxy supports multiple etcd server endpoints. When the proxy starts, it randomly picks one etcd server endpoint to use. This endpoint serves all requests until the proxy detects an endpoint failure. If the gRPC proxy detects an endpoint failure, it switches to a different endpoint, if available, to hide failures from its clients. Other retry policies, such as weighted round-robin, may be supported in the future.
## Scalable watch API
The gRPC proxy coalesces multiple client watchers (`c-watchers`) on the same key or range into a single watcher (`s-watcher`) connected to an etcd server. The proxy broadcasts all events from the `s-watcher` to its `c-watchers`.
Assuming N clients watch the same key, one gRPC proxy can reduce the watch load on the etcd server from N to 1. Users can deploy multiple gRPC proxies to further distribute server load.
In the following example, three clients watch on key A. The gRPC proxy coalesces the three watchers, creating a single watcher attached to the etcd server.
```
+-------------+
| etcd server |
+------+------+
^ watch key A (s-watcher)
|
+-------+-----+
| gRPC proxy | <-------+
| | |
++-----+------+ |watch key A (c-watcher)
watch key A ^ ^ watch key A |
(c-watcher) | | (c-watcher) |
+-------+-+ ++--------+ +----+----+
| client | | client | | client |
| | | | | |
+---------+ +---------+ +---------+
```
### Limitations
To effectively coalesce multiple client watchers into a single watcher, the gRPC proxy coalesces new `c-watchers` into an existing `s-watcher` when possible. This coalesced `s-watcher` may be out of sync with the etcd server due to network delays or buffered undelivered events. When the watch revision is unspecified, the gRPC proxy will not guarantee the `c-watcher` will start watching from the most recent store revision. For example, if a client watches from an etcd server with revision 1000, that watcher will begin at revision 1000. If a client watches from the gRPC proxy, may begin watching from revision 990.
Similar limitations apply to cancellation. When the watcher is cancelled, the etcd servers revision may be greater than the cancellation response revision.
These two limitations should not cause problems for most use cases. In the future, there may be additional options to force the watcher to bypass the gRPC proxy for more accurate revision responses.
## Scalable lease API
TODO
## Abusive clients protection
The gRPC proxy caches responses for requests when it does not break consistency requirements. This can protect the etcd server from abusive clients in tight for loops.
## Start etcd gRPC proxy
Consider an etcd cluster with the following static endpoints:
|Name|Address|Hostname|
|------|---------|------------------|
|infra0|10.0.1.10|infra0.example.com|
|infra1|10.0.1.11|infra1.example.com|
|infra2|10.0.1.12|infra2.example.com|
Start the etcd gRPC proxy to use these static endpoints with the command:
```bash
$ etcd grpc-proxy start --endpoints=infra0.example.com,infra1.example.com,infra2.example.com --listen-addr=127.0.0.1:2379
```
The etcd gRPC proxy starts and listens on port 8080. It forwards client requests to one of the three endpoints provided above.
Sending requests through the proxy:
```bash
$ ETCDCTL_API=3 ./etcdctl --endpoints=127.0.0.1:2379 put foo bar
OK
$ ETCDCTL_API=3 ./etcdctl --endpoints=127.0.0.1:2379 get foo
foo
bar
```

View File

@ -0,0 +1,93 @@
# Hardware recommendations
etcd usually runs well with limited resources for development or testing purposes; its common to develop with etcd on a laptop or a cheap cloud machine. However, when running etcd clusters in production, some hardware guidelines are useful for proper administration. These suggestions are not hard rules; they serve as a good starting point for a robust production deployment. As always, deployments should be tested with simulated workloads before running in production.
## CPUs
Few etcd deployments require a lot of CPU capacity. Typical clusters need two to four cores to run smoothly.
Heavily loaded etcd deployments, serving thousands of clients or tens of thousands of requests per second, tend to be CPU bound since etcd can serve requests from memory. Such heavy deployments usually need eight to sixteen dedicated cores.
## Memory
etcd has a relatively small memory footprint but its performance still depends on having enough memory. An etcd server will aggressively cache key-value data and spends most of the rest of its memory tracking watchers. Typically 8GB is enough. For heavy deployments with thousands of watchers and millions of keys, allocate 16GB to 64GB memory accordingly.
## Disks
Fast disks are the most critical factor for etcd deployment performance and stability.
A slow disk will increase etcd request latency and potentially hurt cluster stability. Since etcds consensus protocol depends on persistently storing metadata to a log, a majority of etcd cluster members must write every request down to disk. Additionally, etcd will also incrementally checkpoint its state to disk so it can truncate this log. If these writes take too long, heartbeats may time out and trigger an election, undermining the stability of the cluster.
etcd is very sensitive to disk write latency. Typically 50 sequential IOPS (e.g., a 7200 RPM disk) is required. For heavily loaded clusters, 500 sequential IOPS (e.g., a typical local SSD or a high performance virtualized block device) is recommended. Note that most cloud providers publish concurrent IOPS rather than sequential IOPS; the published concurrent IOPS can be 10x greater than the sequential IOPS. To measure actual sequential IOPS, we suggest using a disk benchmarking tool such as [diskbench][diskbench] or [fio][fio].
etcd requires only modest disk bandwidth but more disk bandwidth buys faster recovery times when a failed member has to catch up with the cluster. Typically 10MB/s will recover 100MB data within 15 seconds. For large clusters, 100MB/s or higher is suggested for recovering 1GB data within 15 seconds.
When possible, back etcds storage with a SSD. A SSD usually provides lower write latencies and with less variance than a spinning disk, thus improving the stability and reliability of etcd. If using spinning disk, get the fastest disks possible (15,000 RPM). Using RAID 0 is also an effective way to increase disk speed, for both spinning disks and SSD. With at least three cluster members, mirroring and/or parity variants of RAID are unnecessary; etcd's consistent replication already gets high availability.
## Network
Multi-member etcd deployments benefit from a fast and reliable network. In order for etcd to be both consistent and partition tolerant, an unreliable network with partitioning outages will lead to poor availability. Low latency ensures etcd members can communicate fast. High bandwidth can reduce the time to recover a failed etcd member. 1GbE is sufficient for common etcd deployments. For large etcd clusters, a 10GbE network will reduce mean time to recovery.
Deploy etcd members within a single data center when possible to avoid latency overheads and lessen the possibility of partitioning events. If a failure domain in another data center is required, choose a data center closer to the existing one. Please also read the [tuning][tuning] documentation for more information on cross data center deployment.
## Example hardware configurations
Here are a few example hardware setups on AWS and GCE environments. As mentioned before, but must be stressed regardless, administrators should test an etcd deployment with a simulated workload before putting it into production.
Note that these configurations assume these machines are totally dedicated to etcd. Running other applications along with etcd on these machines may cause resource contentions and lead to cluster instability.
### Small cluster
A small cluster serves fewer than 100 clients, fewer than 200 of requests per second, and stores no more than 100MB of data.
Example application workload: A 50-node Kubernetes cluster
| Provider | Type | vCPUs | Memory (GB) | Max concurrent IOPS | Disk bandwidth (MB/s) |
|----------|------|-------|--------|------|----------------|
| AWS | m4.large | 2 | 8 | 3600 | 56.25 |
| GCE | n1-standard-1 + 50GB PD SSD | 2 | 7.5 | 1500 | 25 |
### Medium cluster
A medium cluster serves fewer than 500 clients, fewer than 1,000 of requests per second, and stores no more than 500MB of data.
Example application workload: A 250-node Kubernetes cluster
| Provider | Type | vCPUs | Memory (GB) | Max concurrent IOPS | Disk bandwidth (MB/s) |
|----------|------|-------|--------|------|----------------|
| AWS | m4.xlarge | 4 | 16 | 6000 | 93.75 |
| GCE | n1-standard-4 + 150GB PD SSD | 4 | 15 | 4500 | 75 |
### Large cluster
A large cluster serves fewer than 1,500 clients, fewer than 10,000 of requests per second, and stores no more than 1GB of data.
Example application workload: A 1,000-node Kubernetes cluster
| Provider | Type | vCPUs | Memory (GB) | Max concurrent IOPS | Disk bandwidth (MB/s) |
|----------|------|-------|--------|------|----------------|
| AWS | m4.2xlarge | 8 | 32 | 8000 | 125 |
| GCE | n1-standard-8 + 250GB PD SSD | 8 | 30 | 7500 | 125 |
### xLarge cluster
An xLarge cluster serves more than 1,500 clients, more than 10,000 of requests per second, and stores more than 1GB data.
Example application workload: A 3,000 node Kubernetes cluster
| Provider | Type | vCPUs | Memory (GB) | Max concurrent IOPS | Disk bandwidth (MB/s) |
|----------|------|-------|--------|------|----------------|
| AWS | m4.4xlarge | 16 | 64 | 16,000 | 250 |
| GCE | n1-standard-16 + 500GB PD SSD | 16 | 60 | 15,000 | 250 |
[diskbench]: https://github.com/ongardie/diskbenchmark
[fio]: https://github.com/axboe/fio
[tuning]: ../tuning.md

View File

@ -0,0 +1,114 @@
# Maintenance
## Overview
An etcd cluster needs periodic maintenance to remain reliable. Depending on an etcd application's needs, this maintenance can usually be automated and performed without downtime or significantly degraded performance.
All etcd maintenance manages storage resources consumed by the etcd keyspace. Failure to adequately control the keyspace size is guarded by storage space quotas; if an etcd member runs low on space, a quota will trigger cluster-wide alarms which will put the system into a limited-operation maintenance mode. To avoid running out of space for writes to the keyspace, the etcd keyspace history must be compacted. Storage space itself may be reclaimed by defragmenting etcd members. Finally, periodic snapshot backups of etcd member state makes it possible to recover any unintended logical data loss or corruption caused by operational error.
## History compaction
Since etcd keeps an exact history of its keyspace, this history should be periodically compacted to avoid performance degradation and eventual storage space exhaustion. Compacting the keyspace history drops all information about keys superseded prior to a given keyspace revision. The space used by these keys then becomes available for additional writes to the keyspace.
The keyspace can be compacted automatically with `etcd`'s time windowed history retention policy, or manually with `etcdctl`. The `etcdctl` method provides fine-grained control over the compacting process whereas automatic compacting fits applications that only need key history for some length of time.
`etcd` can be set to automatically compact the keyspace with the `--auto-compaction` option with a period of hours:
```sh
# keep one hour of history
$ etcd --auto-compaction-retention=1
```
An `etcdctl` initiated compaction works as follows:
```sh
# compact up to revision 3
$ etcdctl compact 3
```
Revisions prior to the compaction revision become inaccessible:
```sh
$ etcdctl get --rev=2 somekey
Error: rpc error: code = 11 desc = etcdserver: mvcc: required revision has been compacted
```
## Defragmentation
After compacting the keyspace, the backend database may exhibit internal fragmentation. Any internal fragmentation is space that is free to use by the backend but still consumes storage space. The process of defragmentation releases this storage space back to the file system. Defragmentation is issued on a per-member so that cluster-wide latency spikes may be avoided.
Compacting old revisions internally fragments `etcd` by leaving gaps in backend database. Fragmented space is available for use by `etcd` but unavailable to the host filesystem.
To defragment an etcd member, use the `etcdctl defrag` command:
```sh
$ etcdctl defrag
Finished defragmenting etcd member[127.0.0.1:2379]
```
## Space quota
The space quota in `etcd` ensures the cluster operates in a reliable fashion. Without a space quota, `etcd` may suffer from poor performance if the keyspace grows excessively large, or it may simply run out of storage space, leading to unpredictable cluster behavior. If the keyspace's backend database for any member exceeds the space quota, `etcd` raises a cluster-wide alarm that puts the cluster into a maintenance mode which only accepts key reads and deletes. Only after freeing enough space in the keyspace and defragmenting the backend database, along with clearing the space quota alarm can the cluster resume normal operation.
By default, `etcd` sets a conservative space quota suitable for most applications, but it may be configured on the command line, in bytes:
```sh
# set a very small 16MB quota
$ etcd --quota-backend-bytes=$((16*1024*1024))
```
The space quota can be triggered with a loop:
```sh
# fill keyspace
$ while [ 1 ]; do dd if=/dev/urandom bs=1024 count=1024 | ETCDCTL_API=3 etcdctl put key || break; done
...
Error: rpc error: code = 8 desc = etcdserver: mvcc: database space exceeded
# confirm quota space is exceeded
$ ETCDCTL_API=3 etcdctl --write-out=table endpoint status
+----------------+------------------+-----------+---------+-----------+-----------+------------+
| ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | RAFT TERM | RAFT INDEX |
+----------------+------------------+-----------+---------+-----------+-----------+------------+
| 127.0.0.1:2379 | bf9071f4639c75cc | 2.3.0+git | 18 MB | true | 2 | 3332 |
+----------------+------------------+-----------+---------+-----------+-----------+------------+
# confirm alarm is raised
$ ETCDCTL_API=3 etcdctl alarm list
memberID:13803658152347727308 alarm:NOSPACE
```
Removing excessive keyspace data and defragmenting the backend database will put the cluster back within the quota limits:
```sh
# get current revision
$ rev=$(ETCDCTL_API=3 etcdctl --endpoints=:2379 endpoint status --write-out="json" | egrep -o '"revision":[0-9]*' | egrep -o '[0-9]*')
# compact away all old revisions
$ ETCDCTL_API=3 etcdctl compact $rev
compacted revision 1516
# defragment away excessive space
$ ETCDCTL_API=3 etcdctl defrag
Finished defragmenting etcd member[127.0.0.1:2379]
# disarm alarm
$ ETCDCTL_API=3 etcdctl alarm disarm
memberID:13803658152347727308 alarm:NOSPACE
# test puts are allowed again
$ ETCDCTL_API=3 etcdctl put newkey 123
OK
```
## Snapshot backup
Snapshotting the `etcd` cluster on a regular basis serves as a durable backup for an etcd keyspace. By taking periodic snapshots of an etcd member's backend database, an `etcd` cluster can be recovered to a point in time with a known good state.
A snapshot is taken with `etcdctl`:
```sh
$ etcdctl snapshot save backup.db
$ etcdctl --write-out=table snapshot status backup.db
+----------+----------+------------+------------+
| HASH | REVISION | TOTAL KEYS | TOTAL SIZE |
+----------+----------+------------+------------+
| fe01cf57 | 10 | 7 | 2.1 MB |
+----------+----------+------------+------------+
```

View File

@ -0,0 +1,82 @@
# Monitoring etcd
Each etcd server exports metrics under the `/metrics` path on its client port.
The metrics can be fetched with `curl`:
```sh
$ curl -L http://localhost:2379/metrics
# HELP etcd_debugging_mvcc_keys_total Total number of keys.
# TYPE etcd_debugging_mvcc_keys_total gauge
etcd_debugging_mvcc_keys_total 0
# HELP etcd_debugging_mvcc_pending_events_total Total number of pending events to be sent.
# TYPE etcd_debugging_mvcc_pending_events_total gauge
etcd_debugging_mvcc_pending_events_total 0
...
```
## Prometheus
Running a [Prometheus][prometheus] monitoring service is the easiest way to ingest and record etcd's metrics.
First, install Prometheus:
```sh
PROMETHEUS_VERSION="1.3.1"
wget https://github.com/prometheus/prometheus/releases/download/v$PROMETHEUS_VERSION/prometheus-$PROMETHEUS_VERSION.linux-amd64.tar.gz -O /tmp/prometheus-$PROMETHEUS_VERSION.linux-amd64.tar.gz
tar -xvzf /tmp/prometheus-$PROMETHEUS_VERSION.linux-amd64.tar.gz --directory /tmp/ --strip-components=1
/tmp/prometheus -version
```
Set Prometheus's scraper to target the etcd cluster endpoints:
```sh
cat > /tmp/test-etcd.yaml <<EOF
global:
scrape_interval: 10s
scrape_configs:
- job_name: test-etcd
static_configs:
- targets: ['10.240.0.32:2379','10.240.0.33:2379','10.240.0.34:2379']
EOF
cat /tmp/test-etcd.yaml
```
Set up the Prometheus handler:
```sh
nohup /tmp/prometheus \
-config.file /tmp/test-etcd.yaml \
-web.listen-address ":9090" \
-storage.local.path "test-etcd.data" >> /tmp/test-etcd.log 2>&1 &
```
Now Prometheus will scrape etcd metrics every 10 seconds.
## Grafana
[Grafana][grafana] has built-in Prometheus support; just add a Prometheus data source:
```
Name: test-etcd
Type: Prometheus
Url: http://localhost:9090
Access: proxy
```
Then import the default [etcd dashboard template][template] and customize. For instance, if Prometheus data source name is `my-etcd`, the `datasource` field values in JSON also need to be `my-etcd`.
See the [demo][demo].
Sample dashboard:
![](./etcd-sample-grafana.png)
[prometheus]: https://prometheus.io/
[grafana]: http://grafana.org/
[template]: ./grafana.json
[demo]: http://dash.etcd.io/dashboard/db/test-etcd

View File

@ -0,0 +1,74 @@
# Performance
## Understanding performance
etcd provides stable, sustained high performance. Two factors define performance: latency and throughput. Latency is the time taken to complete an operation. Throughput is the total operations completed within some time period. Usually average latency increases as the overall throughput increases when etcd accepts concurrent client requests. In common cloud environments, like a standard `n-4` on Google Compute Engine (GCE) or a comparable machine type on AWS, a three member etcd cluster finishes a request in less than one millisecond under light load, and can complete more than 30,000 requests per second under heavy load.
etcd uses the Raft consensus algorithm to replicate requests among members and reach agreement. Consensus performance, especially commit latency, is limited by two physical constraints: network IO latency and disk IO latency. The minimum time to finish an etcd request is the network Round Trip Time (RTT) between members, plus the time `fdatasync` requires to commit the data to permanant storage. The RTT within a datacenter may be as long as several hundred microseconds. A typical RTT within the United States is around 50ms, and can be as slow as 400ms between continents. The typical fdatasync latency for a spinning disk is about 10ms. For SSDs, the latency is often lower than 1ms. To increase throughput, etcd batches multiple requests together and submits them to Raft. This batching policy lets etcd attain high throughput despite heavy load.
There are other sub-systems which impact the overall performance of etcd. Each serialized etcd request must run through etcds boltdb-backed MVCC storage engine, which usually takes tens of microseconds to finish. Periodically etcd incrementally snapshots its recently applied requests, merging them back with the previous on-disk snapshot. This process may lead to a latency spike. Although this is usually not a problem on SSDs, it may double the observed latency on HDD. Likewise, inflight compactions can impact etcds performance. Fortunately, the impact is often insignificant since the compaction is staggered so it does not compete for resources with regular requests. The RPC system, gRPC, gives etcd a well-defined, extensible API, but it also introduces additional latency, especially for local reads.
## Benchmarks
Benchmarking etcd performance can be done with the [benchmark](https://github.com/coreos/etcd/tree/master/tools/benchmark) CLI tool included with etcd.
For some baseline performance numbers, we consider a three member etcd cluster with the following hardware configuration:
- Google Cloud Compute Engine
- 3 machines of 8 vCPUs + 16GB Memory + 50GB SSD
- 1 machine(client) of 16 vCPUs + 30GB Memory + 50GB SSD
- Ubuntu 15.10
- etcd v3 master branch (commit SHA d8f325d), Go 1.6.2
With this configuration, etcd can approximately write:
| Number of keys | Key size in bytes | Value size in bytes | Number of connections | Number of clients | Target etcd server | Average write QPS | Average latency per request | Memory |
|----------------|-------------------|---------------------|-----------------------|-------------------|--------------------|-------------------|-----------------------------|--------|
| 10,000 | 8 | 256 | 1 | 1 | leader only | 525 | 2ms | 35 MB |
| 100,000 | 8 | 256 | 100 | 1000 | leader only | 25,000 | 30ms | 35 MB |
| 100,000 | 8 | 256 | 100 | 1000 | all members | 33,000 | 25ms | 35 MB |
Sample commands are:
```
# assuming IP_1 is leader, write requests to the leader
benchmark --endpoints={IP_1} --conns=1 --clients=1 \
put --key-size=8 --sequential-keys --total=10000 --val-size=256
benchmark --endpoints={IP_1} --conns=100 --clients=1000 \
put --key-size=8 --sequential-keys --total=100000 --val-size=256
# write to all members
benchmark --endpoints={IP_1},{IP_2},{IP_3} --conns=100 --clients=1000 \
put --key-size=8 --sequential-keys --total=100000 --val-size=256
```
Linearizable read requests go through a quorum of cluster members for consensus to fetch the most recent data. Serializable read requests are cheaper than linearizable reads since they are served by any single etcd member, instead of a quorum of members, in exchange for possibly serving stale data. etcd can read:
| Number of requests | Key size in bytes | Value size in bytes | Number of connections | Number of clients | Consistency | Average latency per request | Average read QPS |
|--------------------|-------------------|---------------------|-----------------------|-------------------|-------------|-----------------------------|------------------|
| 10,000 | 8 | 256 | 1 | 1 | Linearizable | 2ms | 560 |
| 10,000 | 8 | 256 | 1 | 1 | Serializable | 0.4ms | 7,500 |
| 100,000 | 8 | 256 | 100 | 1000 | Linearizable | 15ms | 43,000 |
| 100,000 | 8 | 256 | 100 | 1000 | Serializable | 9ms | 93,000 |
Sample commands are:
```
# Linearizable read requests
benchmark --endpoints={IP_1},{IP_2},{IP_3} --conns=1 --clients=1 \
range YOUR_KEY --consistency=l --total=10000
benchmark --endpoints={IP_1},{IP_2},{IP_3} --conns=100 --clients=1000 \
range YOUR_KEY --consistency=l --total=100000
# Serializable read requests for each member and sum up the numbers
for endpoint in {IP_1} {IP_2} {IP_3}; do
benchmark --endpoints=$endpoint --conns=1 --clients=1 \
range YOUR_KEY --consistency=s --total=10000
done
for endpoint in {IP_1} {IP_2} {IP_3}; do
benchmark --endpoints=$endpoint --conns=100 --clients=1000 \
range YOUR_KEY --consistency=s --total=100000
done
```
We encourage running the benchmark test when setting up an etcd cluster for the first time in a new environment to ensure the cluster achieves adequate performance; cluster latency and throughput can be sensitive to minor environment differences.

View File

@ -0,0 +1,63 @@
## Disaster recovery
etcd is designed to withstand machine failures. An etcd cluster automatically recovers from temporary failures (e.g., machine reboots) and tolerates up to *(N-1)/2* permanent failures for a cluster of N members. When a member permanently fails, whether due to hardware failure or disk corruption, it loses access to the cluster. If the cluster permanently loses more than *(N-1)/2* members then it disastrously fails, irrevocably losing quorum. Once quorum is lost, the cluster cannot reach consensus and therefore cannot continue accepting updates.
To recover from disastrous failure, etcd v3 provides snapshot and restore facilities to recreate the cluster without v3 key data loss. To recover v2 keys, refer to the [v2 admin guide][v2_recover].
[v2_recover]: ../v2/admin_guide.md#disaster-recovery
### Snapshotting the keyspace
Recovering a cluster first needs a snapshot of the keyspace from an etcd member. A snapshot may either be taken from a live member with the `etcdctl snapshot save` command or by copying the `member/snap/db` file from an etcd data directory. For example, the following command snapshots the keyspace served by `$ENDPOINT` to the file `snapshot.db`:
```sh
$ ETCDCTL_API=3 etcdctl --endpoints $ENDPOINT snapshot save snapshot.db
```
### Restoring a cluster
To restore a cluster, all that is needed is a single snapshot "db" file. A cluster restore with `etcdctl snapshot restore` creates new etcd data directories; all members should restore using the same snapshot. Restoring overwrites some snapshot metadata (specifically, the member ID and cluster ID); the member loses its former identity. This metadata overwrite prevents the new member from inadvertently joining an existing cluster. Therefore in order to start a cluster from a snapshot, the restore must start a new logical cluster.
Snapshot integrity may be optionally verified at restore time. If the snapshot is taken with `etcdctl snapshot save`, it will have an integrity hash that is checked by `etcdctl snapshot restore`. If the snapshot is copied from the data directory, there is no integrity hash and it will only restore by using `--skip-hash-check`.
A restore initializes a new member of a new cluster, with a fresh cluster configuration using `etcd`'s cluster configuration flags, but preserves the contents of the etcd keyspace. Continuing from the previous example, the following creates new etcd data directories (`m1.etcd`, `m2.etcd`, `m3.etcd`) for a three member cluster:
```sh
$ ETCDCTL_API=3 etcdctl snapshot restore snapshot.db \
--name m1 \
--initial-cluster m1=http://host1:2380,m2=http://host2:2380,m3=http://host3:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-advertise-peer-urls http://host1:2380
$ ETCDCTL_API=3 etcdctl snapshot restore snapshot.db \
--name m2 \
--initial-cluster m1=http://host1:2380,m2=http://host2:2380,m3=http://host3:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-advertise-peer-urls http://host2:2380
$ ETCDCTL_API=3 etcdctl snapshot restore snapshot.db \
--name m3 \
--initial-cluster m1=http://host1:2380,m2=http://host2:2380,m3=http://host3:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-advertise-peer-urls http://host3:2380
```
Next, start `etcd` with the new data directories:
```sh
$ etcd \
--name m1 \
--listen-client-urls http://host1:2379 \
--advertise-client-urls http://host1:2379 \
--listen-peer-urls http://host1:2380 &
$ etcd \
--name m2 \
--listen-client-urls http://host2:2379 \
--advertise-client-urls http://host2:2379 \
--listen-peer-urls http://host2:2380 &
$ etcd \
--name m3 \
--listen-client-urls http://host3:2379 \
--advertise-client-urls http://host3:2379 \
--listen-peer-urls http://host3:2380 &
```
Now the restored etcd cluster should be available and serving the keyspace given by the snapshot.

View File

@ -0,0 +1,185 @@
# Runtime reconfiguration
etcd comes with support for incremental runtime reconfiguration, which allows users to update the membership of the cluster at run time.
Reconfiguration requests can only be processed when the majority of the cluster members are functioning. It is **highly recommended** to always have a cluster size greater than two in production. It is unsafe to remove a member from a two member cluster. The majority of a two member cluster is also two. If there is a failure during the removal process, the cluster might not able to make progress and need to [restart from majority failure][majority failure].
To better understand the design behind runtime reconfiguration, we suggest reading [the runtime reconfiguration document][runtime-reconf].
## Reconfiguration use cases
Let's walk through some common reasons for reconfiguring a cluster. Most of these just involve combinations of adding or removing a member, which are explained below under [Cluster Reconfiguration Operations][cluster-reconf].
### Cycle or upgrade multiple machines
If multiple cluster members need to move due to planned maintenance (hardware upgrades, network downtime, etc.), it is recommended to modify members one at a time.
It is safe to remove the leader, however there is a brief period of downtime while the election process takes place. If the cluster holds more than 50MB, it is recommended to [migrate the member's data directory][member migration].
### Change the cluster size
Increasing the cluster size can enhance [failure tolerance][fault tolerance table] and provide better read performance. Since clients can read from any member, increasing the number of members increases the overall read throughput.
Decreasing the cluster size can improve the write performance of a cluster, with a trade-off of decreased resilience. Writes into the cluster are replicated to a majority of members of the cluster before considered committed. Decreasing the cluster size lowers the majority, and each write is committed more quickly.
### Replace a failed machine
If a machine fails due to hardware failure, data directory corruption, or some other fatal situation, it should be replaced as soon as possible. Machines that have failed but haven't been removed adversely affect the quorum and reduce the tolerance for an additional failure.
To replace the machine, follow the instructions for [removing the member][remove member] from the cluster, and then [add a new member][add member] in its place. If the cluster holds more than 50MB, it is recommended to [migrate the failed member's data directory][member migration] if it is still accessible.
### Restart cluster from majority failure
If the majority of the cluster is lost or all of the nodes have changed IP addresses, then manual action is necessary to recover safely.
The basic steps in the recovery process include [creating a new cluster using the old data][disaster recovery], forcing a single member to act as the leader, and finally using runtime configuration to [add new members][add member] to this new cluster one at a time.
## Cluster reconfiguration operations
Now that we have the use cases in mind, let us lay out the operations involved in each.
Before making any change, the simple majority (quorum) of etcd members must be available.
This is essentially the same requirement as for any other write to etcd.
All changes to the cluster are done one at a time:
* To update a single member peerURLs, make an update operation
* To replace a single member, make an add then a remove operation
* To increase from 3 to 5 members, make two add operations
* To decrease from 5 to 3, make two remove operations
All of these examples will use the `etcdctl` command line tool that ships with etcd.
To change membership without `etcdctl`, use the [v2 HTTP members API][member-api] or the [v3 gRPC members API][member-api-grpc].
### Update a member
#### Update advertise client URLs
To update the advertise client URLs of a member, simply restart
that member with updated client urls flag (`--advertise-client-urls`) or environment variable
(`ETCD_ADVERTISE_CLIENT_URLS`). The restarted member will self publish the updated URLs.
A wrongly updated client URL will not affect the health of the etcd cluster.
#### Update advertise peer URLs
To update the advertise peer URLs of a member, first update
it explicitly via member command and then restart the member. The additional action is required
since updating peer URLs changes the cluster wide configuration and can affect the health of the etcd cluster.
To update the peer URLs, first, we need to find the target member's ID. To list all members with `etcdctl`:
```sh
$ etcdctl member list
6e3bd23ae5f1eae0: name=node2 peerURLs=http://localhost:23802 clientURLs=http://127.0.0.1:23792
924e2e83e93f2560: name=node3 peerURLs=http://localhost:23803 clientURLs=http://127.0.0.1:23793
a8266ecf031671f3: name=node1 peerURLs=http://localhost:23801 clientURLs=http://127.0.0.1:23791
```
In this example let's `update` a8266ecf031671f3 member ID and change its peerURLs value to http://10.0.1.10:2380
```sh
$ etcdctl member update a8266ecf031671f3 http://10.0.1.10:2380
Updated member with ID a8266ecf031671f3 in cluster
```
### Remove a member
Let us say the member ID we want to remove is a8266ecf031671f3.
We then use the `remove` command to perform the removal:
```sh
$ etcdctl member remove a8266ecf031671f3
Removed member a8266ecf031671f3 from cluster
```
The target member will stop itself at this point and print out the removal in the log:
```
etcd: this member has been permanently removed from the cluster. Exiting.
```
It is safe to remove the leader, however the cluster will be inactive while a new leader is elected. This duration is normally the period of election timeout plus the voting process.
### Add a new member
Adding a member is a two step process:
* Add the new member to the cluster via the [HTTP members API][member-api], the [gRPC members API][member-api-grpc], or the `etcdctl member add` command.
* Start the new member with the new cluster configuration, including a list of the updated members (existing members + the new member).
Using `etcdctl` let's add the new member to the cluster by specifying its [name][conf-name] and [advertised peer URLs][conf-adv-peer]:
```sh
$ etcdctl member add infra3 http://10.0.1.13:2380
added member 9bf1b35fc7761a23 to cluster
ETCD_NAME="infra3"
ETCD_INITIAL_CLUSTER="infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380,infra3=http://10.0.1.13:2380"
ETCD_INITIAL_CLUSTER_STATE=existing
```
`etcdctl` has informed the cluster about the new member and printed out the environment variables needed to successfully start it.
Now start the new etcd process with the relevant flags for the new member:
```sh
$ export ETCD_NAME="infra3"
$ export ETCD_INITIAL_CLUSTER="infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380,infra3=http://10.0.1.13:2380"
$ export ETCD_INITIAL_CLUSTER_STATE=existing
$ etcd --listen-client-urls http://10.0.1.13:2379 --advertise-client-urls http://10.0.1.13:2379 --listen-peer-urls http://10.0.1.13:2380 --initial-advertise-peer-urls http://10.0.1.13:2380 --data-dir %data_dir%
```
The new member will run as a part of the cluster and immediately begin catching up with the rest of the cluster.
If adding multiple members the best practice is to configure a single member at a time and verify it starts correctly before adding more new members.
If adding a new member to a 1-node cluster, the cluster cannot make progress before the new member starts because it needs two members as majority to agree on the consensus. This behavior only happens between the time `etcdctl member add` informs the cluster about the new member and the new member successfully establishing a connection to the existing one.
#### Error cases when adding members
In the following case we have not included our new host in the list of enumerated nodes.
If this is a new cluster, the node must be added to the list of initial cluster members.
```sh
$ etcd --name infra3 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state existing
etcdserver: assign ids error: the member count is unequal
exit 1
```
In this case we give a different address (10.0.1.14:2380) to the one that we used to join the cluster (10.0.1.13:2380).
```sh
$ etcd --name infra4 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380,infra4=http://10.0.1.14:2380 \
--initial-cluster-state existing
etcdserver: assign ids error: unmatched member while checking PeerURLs
exit 1
```
When we start etcd using the data directory of a removed member, etcd will exit automatically if it connects to any active member in the cluster:
```sh
$ etcd
etcd: this member has been permanently removed from the cluster. Exiting.
exit 1
```
### Strict reconfiguration check mode (`-strict-reconfig-check`)
As described in the above, the best practice of adding new members is to configure a single member at a time and verify it starts correctly before adding more new members. This step by step approach is very important because if newly added members is not configured correctly (for example the peer URLs are incorrect), the cluster can lose quorum. The quorum loss happens since the newly added member are counted in the quorum even if that member is not reachable from other existing members. Also quorum loss might happen if there is a connectivity issue or there are operational issues.
For avoiding this problem, etcd provides an option `-strict-reconfig-check`. If this option is passed to etcd, etcd rejects reconfiguration requests if the number of started members will be less than a quorum of the reconfigured cluster.
It is enabled by default.
[add member]: #add-a-new-member
[cluster-reconf]: #cluster-reconfiguration-operations
[conf-adv-peer]: configuration.md#-initial-advertise-peer-urls
[conf-name]: configuration.md#-name
[disaster recovery]: recovery.md
[fault tolerance table]: ../v2/admin_guide.md#fault-tolerance-table
[majority failure]: #restart-cluster-from-majority-failure
[member-api]: ../v2/members_api.md
[member-api-grpc]: ../dev-guide/api_reference_v3.md#service-cluster-etcdserveretcdserverpbrpcproto
[member migration]: ../v2/admin_guide.md#member-migration
[remove member]: #remove-a-member
[runtime-reconf]: runtime-reconf-design.md

View File

@ -0,0 +1,50 @@
# Design of runtime reconfiguration
Runtime reconfiguration is one of the hardest and most error prone features in a distributed system, especially in a consensus based system like etcd.
Read on to learn about the design of etcd's runtime reconfiguration commands and how we tackled these problems.
## Two phase config changes keep the cluster safe
In etcd, every runtime reconfiguration has to go through [two phases][add-member] for safety reasons. For example, to add a member, first inform cluster of new configuration and then start the new member.
Phase 1 - Inform cluster of new configuration
To add a member into etcd cluster, make an API call to request a new member to be added to the cluster. This is only way to add a new member into an existing cluster. The API call returns when the cluster agrees on the configuration change.
Phase 2 - Start new member
To join the etcd member into the existing cluster, specify the correct `initial-cluster` and set `initial-cluster-state` to `existing`. When the member starts, it will contact the existing cluster first and verify the current cluster configuration matches the expected one specified in `initial-cluster`. When the new member successfully starts, the cluster has reached the expected configuration.
By splitting the process into two discrete phases users are forced to be explicit regarding cluster membership changes. This actually gives users more flexibility and makes things easier to reason about. For example, if there is an attempt to add a new member with the same ID as an existing member in an etcd cluster, the action will fail immediately during phase one without impacting the running cluster. Similar protection is provided to prevent adding new members by mistake. If a new etcd member attempts to join the cluster before the cluster has accepted the configuration change,, it will not be accepted by the cluster.
Without the explicit workflow around cluster membership etcd would be vulnerable to unexpected cluster membership changes. For example, if etcd is running under an init system such as systemd, etcd would be restarted after being removed via the membership API, and attempt to rejoin the cluster on startup. This cycle would continue every time a member is removed via the API and systemd is set to restart etcd after failing, which is unexpected.
We expect runtime reconfiguration to be an infrequent operation. We decided to keep it explicit and user-driven to ensure configuration safety and keep the cluster always running smoothly under explicit control.
## Permanent loss of quorum requires new cluster
If a cluster permanently loses a majority of its members, a new cluster will need to be started from an old data directory to recover the previous state.
It is entirely possible to force removing the failed members from the existing cluster to recover. However, we decided not to support this method since it bypasses the normal consensus committing phase, which is unsafe. If the member to remove is not actually dead or force removed through different members in the same cluster, etcd will end up with a diverged cluster with same clusterID. This is very dangerous and hard to debug/fix afterwards.
With a correct deployment, the possibility of permanent majority lose is very low. But it is a severe enough problem that worth special care. We strongly suggest reading the [disaster recovery documentation][disaster-recovery] and prepare for permanent majority lose before putting etcd into production.
## Do not use public discovery service for runtime reconfiguration
The public discovery service should only be used for bootstrapping a cluster. To join member into an existing cluster, use runtime reconfiguration API.
Discovery service is designed for bootstrapping an etcd cluster in the cloud environment, when the IP addresses of all the members are not known beforehand. After successfully bootstrapping a cluster, the IP addresses of all the members are known. Technically, the discovery service should no longer be needed.
It seems that using public discovery service is a convenient way to do runtime reconfiguration, after all discovery service already has all the cluster configuration information. However relying on public discovery service brings troubles:
1. it introduces external dependencies for the entire life-cycle of the cluster, not just bootstrap time. If there is a network issue between the cluster and public discovery service, the cluster will suffer from it.
2. public discovery service must reflect correct runtime configuration of the cluster during it life-cycle. It has to provide security mechanism to avoid bad actions, and it is hard.
3. public discovery service has to keep tens of thousands of cluster configurations. Our public discovery service backend is not ready for that workload.
To have a discovery service that supports runtime reconfiguration, the best choice is to build a private one.
[add-member]: runtime-configuration.md#add-a-new-member
[disaster-recovery]: recovery.md

View File

@ -0,0 +1,224 @@
# Security model
etcd supports automatic TLS as well as authentication through client certificates for both clients to server as well as peer (server to server / cluster) communication.
To get up and running, first have a CA certificate and a signed key pair for one member. It is recommended to create and sign a new key pair for every member in a cluster.
For convenience, the [cfssl] tool provides an easy interface to certificate generation, and we provide an example using the tool [here][tls-setup]. Alternatively, try this [guide to generating self-signed key pairs][tls-guide].
## Basic setup
etcd takes several certificate related configuration options, either through command-line flags or environment variables:
**Client-to-server communication:**
`--cert-file=<path>`: Certificate used for SSL/TLS connections **to** etcd. When this option is set, advertise-client-urls can use the HTTPS schema.
`--key-file=<path>`: Key for the certificate. Must be unencrypted.
`--client-cert-auth`: When this is set etcd will check all incoming HTTPS requests for a client certificate signed by the trusted CA, requests that don't supply a valid client certificate will fail.
`--trusted-ca-file=<path>`: Trusted certificate authority.
`--auto-tls`: Use automatically generated self-signed certificates for TLS connections with clients.
**Peer (server-to-server / cluster) communication:**
The peer options work the same way as the client-to-server options:
`--peer-cert-file=<path>`: Certificate used for SSL/TLS connections between peers. This will be used both for listening on the peer address as well as sending requests to other peers.
`--peer-key-file=<path>`: Key for the certificate. Must be unencrypted.
`--peer-client-cert-auth`: When set, etcd will check all incoming peer requests from the cluster for valid client certificates signed by the supplied CA.
`--peer-trusted-ca-file=<path>`: Trusted certificate authority.
`--peer-auto-tls`: Use automatically generated self-signed certificates for TLS connections between peers.
If either a client-to-server or peer certificate is supplied the key must also be set. All of these configuration options are also available through the environment variables, `ETCD_CA_FILE`, `ETCD_PEER_CA_FILE` and so on.
## Example 1: Client-to-server transport security with HTTPS
For this, have a CA certificate (`ca.crt`) and signed key pair (`server.crt`, `server.key`) ready.
Let us configure etcd to provide simple HTTPS transport security step by step:
```sh
$ etcd --name infra0 --data-dir infra0 \
--cert-file=/path/to/server.crt --key-file=/path/to/server.key \
--advertise-client-urls=https://127.0.0.1:2379 --listen-client-urls=https://127.0.0.1:2379
```
This should start up fine and it will be possible to test the configuration by speaking HTTPS to etcd:
```sh
$ curl --cacert /path/to/ca.crt https://127.0.0.1:2379/v2/keys/foo -XPUT -d value=bar -v
```
The command should show that the handshake succeed. Since we use self-signed certificates with our own certificate authority, the CA must be passed to curl using the `--cacert` option. Another possibility would be to add the CA certificate to the system's trusted certificates directory (usually in `/etc/pki/tls/certs` or `/etc/ssl/certs`).
**OSX 10.9+ Users**: curl 7.30.0 on OSX 10.9+ doesn't understand certificates passed in on the command line.
Instead, import the dummy ca.crt directly into the keychain or add the `-k` flag to curl to ignore errors.
To test without the `-k` flag, run `open ./fixtures/ca/ca.crt` and follow the prompts.
Please remove this certificate after testing!
If there is a workaround, let us know.
## Example 2: Client-to-server authentication with HTTPS client certificates
For now we've given the etcd client the ability to verify the server identity and provide transport security. We can however also use client certificates to prevent unauthorized access to etcd.
The clients will provide their certificates to the server and the server will check whether the cert is signed by the supplied CA and decide whether to serve the request.
The same files mentioned in the first example are needed for this, as well as a key pair for the client (`client.crt`, `client.key`) signed by the same certificate authority.
```sh
$ etcd --name infra0 --data-dir infra0 \
--client-cert-auth --trusted-ca-file=/path/to/ca.crt --cert-file=/path/to/server.crt --key-file=/path/to/server.key \
--advertise-client-urls https://127.0.0.1:2379 --listen-client-urls https://127.0.0.1:2379
```
Now try the same request as above to this server:
```sh
$ curl --cacert /path/to/ca.crt https://127.0.0.1:2379/v2/keys/foo -XPUT -d value=bar -v
```
The request should be rejected by the server:
```
...
routines:SSL3_READ_BYTES:sslv3 alert bad certificate
...
```
To make it succeed, we need to give the CA signed client certificate to the server:
```sh
$ curl --cacert /path/to/ca.crt --cert /path/to/client.crt --key /path/to/client.key \
-L https://127.0.0.1:2379/v2/keys/foo -XPUT -d value=bar -v
```
The output should include:
```
...
SSLv3, TLS handshake, CERT verify (15):
...
TLS handshake, Finished (20)
```
And also the response from the server:
```json
{
"action": "set",
"node": {
"createdIndex": 12,
"key": "/foo",
"modifiedIndex": 12,
"value": "bar"
}
}
```
## Example 3: Transport security & client certificates in a cluster
etcd supports the same model as above for **peer communication**, that means the communication between etcd members in a cluster.
Assuming we have our `ca.crt` and two members with their own keypairs (`member1.crt` & `member1.key`, `member2.crt` & `member2.key`) signed by this CA, we launch etcd as follows:
```sh
DISCOVERY_URL=... # from https://discovery.etcd.io/new
# member1
$ etcd --name infra1 --data-dir infra1 \
--peer-client-cert-auth --peer-trusted-ca-file=/path/to/ca.crt --peer-cert-file=/path/to/member1.crt --peer-key-file=/path/to/member1.key \
--initial-advertise-peer-urls=https://10.0.1.10:2380 --listen-peer-urls=https://10.0.1.10:2380 \
--discovery ${DISCOVERY_URL}
# member2
$ etcd --name infra2 --data-dir infra2 \
--peer-client-cert-auth --peer-trusted-ca-file=/path/to/ca.crt --peer-cert-file=/path/to/member2.crt --peer-key-file=/path/to/member2.key \
--initial-advertise-peer-urls=https://10.0.1.11:2380 --listen-peer-urls=https://10.0.1.11:2380 \
--discovery ${DISCOVERY_URL}
```
The etcd members will form a cluster and all communication between members in the cluster will be encrypted and authenticated using the client certificates. The output of etcd will show that the addresses it connects to use HTTPS.
## Example 4: Automatic self-signed transport security
For cases where communication encryption, but not authentication, is needed, etcd supports encrypting its messages with automatically generated self-signed certificates. This simplifies deployment because there is no need for managing certificates and keys outside of etcd.
Configure etcd to use self-signed certificates for client and peer connections with the flags `--auto-tls` and `--peer-auto-tls`:
```sh
DISCOVERY_URL=... # from https://discovery.etcd.io/new
# member1
$ etcd --name infra1 --data-dir infra1 \
--auto-tls --peer-auto-tls \
--initial-advertise-peer-urls=https://10.0.1.10:2380 --listen-peer-urls=https://10.0.1.10:2380 \
--discovery ${DISCOVERY_URL}
# member2
$ etcd --name infra2 --data-dir infra2 \
--auto-tls --peer-auto-tls \
--initial-advertise-peer-urls=https://10.0.1.11:2380 --listen-peer-urls=https://10.0.1.11:2380 \
--discovery ${DISCOVERY_URL}
```
Self-signed certificates do not authenticate identity so curl will return an error:
```sh
curl: (60) SSL certificate problem: Invalid certificate chain
```
To disable certificate chain checking, invoke curl with the `-k` flag:
```sh
$ curl -k https://127.0.0.1:2379/v2/keys/foo -Xput -d value=bar -v
```
## Notes for etcd proxy
etcd proxy terminates the TLS from its client if the connection is secure, and uses proxy's own key/cert specified in `--peer-key-file` and `--peer-cert-file` to communicate with etcd members.
The proxy communicates with etcd members through both the `--advertise-client-urls` and `--advertise-peer-urls` of a given member. It forwards client requests to etcd members advertised client urls, and it syncs the initial cluster configuration through etcd members advertised peer urls.
When client authentication is enabled for an etcd member, the administrator must ensure that the peer certificate specified in the proxy's `--peer-cert-file` option is valid for that authentication. The proxy's peer certificate must also be valid for peer authentication if peer authentication is enabled.
## Frequently asked questions
### I'm seeing a SSLv3 alert handshake failure when using TLS client authentication?
The `crypto/tls` package of `golang` checks the key usage of the certificate public key before using it.
To use the certificate public key to do client auth, we need to add `clientAuth` to `Extended Key Usage` when creating the certificate public key.
Here is how to do it:
Add the following section to openssl.cnf:
```
[ ssl_client ]
...
extendedKeyUsage = clientAuth
...
```
When creating the cert be sure to reference it in the `-extensions` flag:
```
$ openssl ca -config openssl.cnf -policy policy_anything -extensions ssl_client -out certs/machine.crt -infiles machine.csr
```
### With peer certificate authentication I receive "certificate is valid for 127.0.0.1, not $MY_IP"
Make sure to sign the certificates with a Subject Name the member's public IP address. The `etcd-ca` tool for example provides an `--ip=` option for its `new-cert` command.
The certificate needs to be signed for the member's FQDN in its Subject Name, use Subject Alternative Names (short IP SANs) to add the IP address. The `etcd-ca` tool provides `--domain=` option for its `new-cert` command, and openssl can make [it][alt-name] too.
[cfssl]: https://github.com/cloudflare/cfssl
[tls-setup]: /hack/tls-setup
[tls-guide]: https://github.com/coreos/docs/blob/master/os/generate-self-signed-certificates.md
[alt-name]: http://wiki.cacert.org/FAQ/subjectAltName

View File

@ -0,0 +1,39 @@
## Supported platforms
### Current support
The following table lists etcd support status for common architectures and operating systems,
| Architecture | Operating System | Status | Maintainers |
| ------------ | ---------------- | ------------ | ---------------- |
| amd64 | Darwin | Experimental | etcd maintainers |
| amd64 | Linux | Stable | etcd maintainers |
| amd64 | Windows | Experimental | |
| arm64 | Linux | Experimental | @glevand |
| arm | Linux | Unstable | |
| 386 | Linux | Unstable | |
* etcd-maintainers are listed in https://github.com/coreos/etcd/blob/master/MAINTAINERS.
Experimental platforms appear to work in practice and have some platform specific code in etcd, but do not fully conform to the stable support policy. Unstable platforms have been lightly tested, but less than experimental. Unlisted architecture and operating system pairs are currently unsupported; caveat emptor.
### Supporting a new platform
For etcd to officially support a new platform as stable, a few requirements are necessary to ensure acceptable quality:
1. An "official" maintainer for the platform with clear motivation; someone must be responsible for taking care of the platform.
2. Set up CI for build; etcd must compile.
3. Set up CI for running unit tests; etcd must pass simple tests.
4. Set up CI (TravisCI, SemaphoreCI or Jenkins) for running integration tests; etcd must pass intensive tests.
5. (Optional) Set up a functional testing cluster; an etcd cluster should survive stress testing.
### 32-bit and other unsupported systems
etcd has known issues on 32-bit systems due to a bug in the Go runtime. See the [Go issue][go-issue] and [atomic package][go-atomic] for more information.
To avoid inadvertently running a possibly unstable etcd server, `etcd` on unstable or unsupported architectures will print a warning message and immediately exit if the environment variable `ETCD_UNSUPPORTED_ARCH` is not set to the target architecture.
Currently only the amd64 architecture is officially supported by `etcd`.
[go-issue]: https://github.com/golang/go/issues/599
[go-atomic]: https://golang.org/pkg/sync/atomic/#pkg-note-BUG

View File

@ -0,0 +1,47 @@
# Migrate applications from using API v2 to API v3
The data store v2 is still accessible from the API v2 after upgrading to etcd3. Thus, it will work as before and require no application changes. With etcd 3, applications use the new grpc API v3 to access the mvcc store, which provides more features and improved performance. The mvcc store and the old store v2 are separate and isolated; writes to the store v2 will not affect the mvcc store and, similarly, writes to the mvcc store will not affect the store v2.
Migrating an application from the API v2 to the API v3 involves two steps: 1) migrate the client library and, 2) migrate the data. If the application can rebuild the data, then migrating the data is unnecessary.
## Migrate client library
API v3 is different from API v2, thus application developers need to use a new client library to send requests to etcd API v3. The documentation of the client v3 is available at https://godoc.org/github.com/coreos/etcd/clientv3.
There are some notable differences between API v2 and API v3:
- Transaction: In v3, etcd provides multi-key conditional transactions. Applications should use transactions in place of `Compare-And-Swap` operations.
- Flat key space: There are no directories in API v3, only keys. For example, "/a/b/c/" is a key. Range queries support getting all keys matching a given prefix.
- Compacted responses: Operations like `Delete` no longer return previous values. To get the deleted value, a transaction can be used to atomically get the key and then delete its value.
- Leases: A replacement for v2 TTLs; the TTL is bound to a lease and keys attach to the lease. When the TTL expires, the lease is revoked and all attached keys are removed.
## Migrate data
Application data can be migrated either offline or online. Offline migration is much simpler than online migration and is recommended.
### Offline migration
Offline migration is very simple but requires etcd downtime. If an etcd downtime window spanning from seconds to minutes is acceptable, offline migration is a good choice and is easy to automate.
First, all members in the etcd cluster must converge to the same state. This can be achieved by stopping all applications that write keys to etcd. Alternatively, if the applications must remain running, configure etcd to listen on a different client URL and restart all etcd members. To check if the states converged, within a few seconds, use the `ETCDCTL_API=3 etcdctl endpoint status` command to confirm that the `raft index` of all members match (or differ by at most 1 due to an internal sync raft command).
Second, migrate the v2 keys into v3 with the [migrate][migrate_command] (`ETCDCTL_API=3 etcdctl migrate`) command. The migrate command writes keys in the v2 store to a user-provided transformer program and reads back transformed keys. It then writes transformed keys into the mvcc store. This usually takes at most tens of seconds.
Restart the etcd members and everything should just work.
### Online migration
If the application cannot tolerate any downtime, then it must migrate online. The implementation of online migration will vary from application to application but the overall idea is the same.
First, write application code using the v3 API. The application must support two modes: a migration mode and a normal mode. The application starts in migration mode. When running in migration mode, the application reads keys using the v3 API first, and, if it cannot find the key, it retries with the API v2. In normal mode, the application only reads keys using the v3 API. The application writes keys over the API v3 in both modes. To acknowledge a switch from migration mode to normal mode, the application watches on a switch mode key. When switch keys value turns to `true`, the application switches over from migration mode to normal mode.
Second, start a background job to migrate data from the store v2 to the mvcc store by reading keys from the API v2 and writing keys to the API v3.
After finishing data migration, the background job writes `true` into the switch mode key to notify the application that it may switch modes.
Online migration can be difficult when the application logic depends on store v2 indexes. Applications will need additional logic to convert mvcc store revisions to store v2 indexes.
[migrate_command]: ../../etcdctl/README.md#migrate-options

View File

@ -0,0 +1,17 @@
## Versioning
### Service versioning
etcd uses [semantic versioning](http://semver.org)
New minor versions may add additional features to the API.
Get the running etcd cluster version with `etcdctl`:
```sh
ETCDCTL_API=3 etcdctl --endpoints=127.0.0.1:2379 endpoint status
```
### API versioning
The `v3` API responses should not change after the 3.0.0 release but new features will be added over time.

View File

@ -15,7 +15,7 @@ when asked
2. Update your repository data with `pkg update`
3. Install etcd with `pkg install coreos­etcd coreos­etcdctl`
3. Install etcd with `pkg install coreos-etcd coreos-etcdctl`
4. Verify successful installation with `pkg info | grep etcd` and you should get:

View File

@ -1,4 +0,0 @@
etcd is being used successfully by many companies in production. It is,
however, under active development and systems like etcd are difficult to get
correct. If you are comfortable with bleeding-edge software please use etcd and
provide us with the feedback and testing young software needs.

View File

@ -0,0 +1,62 @@
# Production users
This document tracks people and use cases for etcd in production. By creating a list of production use cases we hope to build a community of advisors that we can reach out to with experience using various etcd applications, operation environments, and cluster sizes. The etcd development team may reach out periodically to check-in on how etcd is working in the field and update this list.
## discovery.etcd.io
- *Application*: https://github.com/coreos/discovery.etcd.io
- *Launched*: Feb. 2014
- *Cluster Size*: 5 members, 5 discovery proxies
- *Order of Data Size*: 100s of Megabytes
- *Operator*: CoreOS, brandon.philips@coreos.com
- *Environment*: AWS
- *Backups*: Periodic async to S3
discovery.etcd.io is the longest continuously running etcd backed service that we know about. It is the basis of automatic cluster bootstrap and was launched in Feb. 2014: https://coreos.com/blog/etcd-0.3.0-released/.
## OpenTable
- *Application*: OpenTable internal service discovery and cluster configuration management
- *Launched*: May 2014
- *Cluster Size*: 3 members each in 6 independent clusters; approximately 50 nodes reading / writing
- *Order of Data Size*: 10s of MB
- *Operator*: OpenTable, Inc; sschlansker@opentable.com
- *Environment*: AWS, VMWare
- *Backups*: None, all data can be re-created if necessary.
## cycoresys.com
- *Application*: multiple
- *Launched*: Jul. 2014
- *Cluster Size*: 3 members, _n_ proxies
- *Order of Data Size*: 100s of kilobytes
- *Operator*: CyCore Systems, Inc, sys@cycoresys.com
- *Environment*: Baremetal
- *Backups*: Periodic sync to Ceph RadosGW and DigitalOcean VM
CyCore Systems provides architecture and engineering for computing systems. This cluster provides microservices, virtual machines, databases, storage clusters to a number of clients. It is built on CoreOS machines, with each machine in the cluster running etcd as a peer or proxy.
## Radius Intelligence
- *Application*: multiple internal tools, Kubernetes clusters, bootstrappable system configs
- *Launched*: June 2015
- *Cluster Size*: 2 clusters of 5 and 3 members; approximately a dozen nodes read/write
- *Order of Data Size*: 100s of kilobytes
- *Operator*: Radius Intelligence; jcderr@radius.com
- *Environment*: AWS, CoreOS, Kubernetes
- *Backups*: None, all data can be recreated if necessary.
Radius Intelligence uses Kubernetes running CoreOS to containerize and scale internal toolsets. Examples include running [JetBrains TeamCity][teamcity] and internal AWS security and cost reporting tools. etcd clusters back these clusters as well as provide some basic environment bootstrapping configuration keys.
## Vonage
- *Application*: system configuration for microservices, scheduling, locks (future - service discovery)
- *Launched*: August 2015
- *Cluster Size*: 2 clusters of 5 members in 2 DCs, n local proxies 1-to-1 with microservice, (ssl and SRV look up)
- *Order of Data Size*: kilobytes
- *Operator*: Vonage [devAdmin][raoofm]
- *Environment*: VMWare, AWS
- *Backups*: Daily snapshots on VMs. Backups done for upgrades.
[teamcity]: https://www.jetbrains.com/teamcity/
[raoofm]:https://github.com/raoofm

View File

@ -1,32 +0,0 @@
## Proxy
etcd can now run as a transparent proxy. Running etcd as a proxy allows for easily discovery of etcd within your infrastructure, since it can run on each machine as a local service. In this mode, etcd acts as a reverse proxy and forwards client requests to an active etcd cluster. The etcd proxy does not participant in the consensus replication of the etcd cluster, thus it neither increases the resilience nor decreases the write performance of the etcd cluster.
etcd currently supports two proxy modes: `readwrite` and `readonly`. The default mode is `readwrite`, which forwards both read and write requests to the etcd cluster. A `readonly` etcd proxy only forwards read requests to the etcd cluster, and returns `HTTP 501` to all write requests.
### Using an etcd proxy
To start etcd in proxy mode, you need to provide three flags: `proxy`, `listen-client-urls`, and `initial-cluster` (or `discovery-url`).
To start a readwrite proxy, set `-proxy on`; To start a readonly proxy, set `-proxy readonly`.
The proxy will be listening on `listen-client-urls` and forward requests to the etcd cluster discovered from in `initial-cluster` or `discovery url`.
#### Start an etcd proxy with a static configuration
To start a proxy that will connect to a statically defined etcd cluster, specify the `initial-cluster` flag:
```
etcd -proxy on -client-listen-urls 127.0.0.1:8080 -initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380
```
#### Start an etcd proxy with the discovery service
If you bootstrap an etcd cluster using the [discovery service][discovery-service], you can also start the proxy with the same `discovery-url`.
To start a proxy using the discovery service, specify the `discovery-url` flag. The proxy will wait until the etcd cluster defined at the `discovery-url` finishes bootstrapping, and then start to forward the requests.
```
etcd -proxy on -client-listen-urls 127.0.0.1:8080 -discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
#### Fallback to proxy mode with discovery service
If you bootstrap a etcd cluster using [discovery service][discovery-service] with more than the expected number of etcd members, the extra etcd processes will fall back to being `readwrite` proxies by default. They will forward the requests to the cluster as described above. For example, if you create a discovery url with `size=5`, and start ten etcd processes using that same discovery URL, the result will be a cluster with five etcd members and five proxies. Note that this behaviour can be disabled with the `proxy-fallback` flag.
[discovery-service]: https://github.com/coreos/etcd/blob/master/Documentation/clustering.md#discovery

View File

@ -0,0 +1,45 @@
# Reporting bugs
If any part of the etcd project has bugs or documentation mistakes, please let us know by [opening an issue][issue]. We treat bugs and mistakes very seriously and believe no issue is too small. Before creating a bug report, please check that an issue reporting the same problem does not already exist.
To make the bug report accurate and easy to understand, please try to create bug reports that are:
- Specific. Include as much details as possible: which version, what environment, what configuration, etc. If the bug is related to running the etcd server, please attach the etcd log (the starting log with etcd configuration is especially important).
- Reproducible. Include the steps to reproduce the problem. We understand some issues might be hard to reproduce, please includes the steps that might lead to the problem. If possible, please attach the affected etcd data dir and stack strace to the bug report.
- Isolated. Please try to isolate and reproduce the bug with minimum dependencies. It would significantly slow down the speed to fix a bug if too many dependencies are involved in a bug report. Debugging external systems that rely on etcd is out of scope, but we are happy to provide guidance in the right direction or help with using etcd itself.
- Unique. Do not duplicate existing bug report.
- Scoped. One bug per report. Do not follow up with another bug inside one report.
It may be worthwhile to read [Elika Etemads article on filing good bug reports][filing-good-bugs] before creating a bug report.
We might ask for further information to locate a bug. A duplicated bug report will be closed.
## Frequently asked questions
### How to get a stack trace
``` bash
$ kill -QUIT $PID
```
### How to get etcd version
``` bash
$ etcd --version
```
### How to get etcd configuration and log when it runs as systemd service etcd2.service
``` bash
$ sudo systemctl cat etcd2
$ sudo journalctl -u etcd2
```
Due to an upstream systemd bug, journald may miss the last few log lines when its processes exit. If journalctl says etcd stopped without fatal or panic message, try `sudo journalctl -f -t etcd2` to get full log.
[etcd-issue]: https://github.com/coreos/etcd/issues/new
[filing-good-bugs]: http://fantasai.inkedblade.net/style/talks/filing-good-bugs/

211
Documentation/rfc/v3api.md Normal file
View File

@ -0,0 +1,211 @@
# Overview
The etcd v3 API is designed to give users a more efficient and cleaner abstraction compared to etcd v2. There are a number of semantic and protocol changes in this new API. For an overview [see Xiang Li's video](https://youtu.be/J5AioGtEPeQ?t=211).
To prove out the design of the v3 API the team has also built [a number of example recipes](https://github.com/coreos/etcd/tree/master/contrib/recipes), there is a [video discussing these recipes too](https://www.youtube.com/watch?v=fj-2RY-3yVU&feature=youtu.be&t=590).
# Design
1. Flatten binary key-value space
2. Keep the event history until compaction
- access to old version of keys
- user controlled history compaction
3. Support range query
- Pagination support with limit argument
- Support consistency guarantee across multiple range queries
4. Replace TTL key with Lease
- more efficient/ low cost keep alive
- a logical group of TTL keys
5. Replace CAS/CAD with multi-object Txn
- MUCH MORE powerful and flexible
6. Support efficient watching with multiple ranges
7. RPC API supports the completed set of APIs.
- more efficient than JSON/HTTP
- additional txn/lease support
8. HTTP API supports a subset of APIs.
- easy for people to try out etcd
- easy for people to write simple etcd application
## Notes
### Request Size Limitation
The max request size is around 1MB. Since etcd replicates requests in a streaming fashion, a very large
request might block other requests for a long time. The use case for etcd is to store small configuration
values, so we prevent user from submitting large requests. This also applies to Txn requests. We might loosen
the size in the future a little bit or make it configurable.
## Protobuf Defined API
[api protobuf][api-protobuf]
[kv protobuf][kv-protobuf]
## Examples
### Put a key (foo=bar)
```
// A put is always successful
Put( PutRequest { key = foo, value = bar } )
PutResponse {
cluster_id = 0x1000,
member_id = 0x1,
revision = 1,
raft_term = 0x1,
}
```
### Get a key (assume we have foo=bar)
```
Get ( RangeRequest { key = foo } )
RangeResponse {
cluster_id = 0x1000,
member_id = 0x1,
revision = 1,
raft_term = 0x1,
kvs = {
{
key = foo,
value = bar,
create_revision = 1,
mod_revision = 1,
version = 1;
},
},
}
```
### Range over a key space (assume we have foo0=bar0… foo100=bar100)
```
Range ( RangeRequest { key = foo, end_key = foo80, limit = 30 } )
RangeResponse {
cluster_id = 0x1000,
member_id = 0x1,
revision = 100,
raft_term = 0x1,
kvs = {
{
key = foo0,
value = bar0,
create_revision = 1,
mod_revision = 1,
version = 1;
},
...,
{
key = foo30,
value = bar30,
create_revision = 30,
mod_revision = 30,
version = 1;
},
},
}
```
### Finish a txn (assume we have foo0=bar0, foo1=bar1)
```
Txn(TxnRequest {
// mod_revision of foo0 is equal to 1, mod_revision of foo1 is greater than 1
compare = {
{compareType = equal, key = foo0, mod_revision = 1},
{compareType = greater, key = foo1, mod_revision = 1}}
},
// if the comparison succeeds, put foo2 = bar2
success = {PutRequest { key = foo2, value = success }},
// if the comparison fails, put foo2=fail
failure = {PutRequest { key = foo2, value = failure }},
)
TxnResponse {
cluster_id = 0x1000,
member_id = 0x1,
revision = 3,
raft_term = 0x1,
succeeded = true,
responses = {
// response of PUT foo2=success
{
cluster_id = 0x1000,
member_id = 0x1,
revision = 3,
raft_term = 0x1,
}
}
}
```
### Watch on a key/range
```
Watch( WatchRequest{
key = foo,
end_key = fop, // prefix foo
start_revision = 20,
end_revision = 10000,
// server decided notification frequency
progress_notification = true,
}
… // this can be a watch request stream
)
// put (foo0=bar0) event at 3
WatchResponse {
cluster_id = 0x1000,
member_id = 0x1,
revision = 3,
raft_term = 0x1,
event_type = put,
kv = {
key = foo0,
value = bar0,
create_revision = 1,
mod_revision = 1,
version = 1;
},
}
// a notification at 2000
WatchResponse {
cluster_id = 0x1000,
member_id = 0x1,
revision = 2000,
raft_term = 0x1,
// nil event as notification
}
// put (foo0=bar3000) event at 3000
WatchResponse {
cluster_id = 0x1000,
member_id = 0x1,
revision = 3000,
raft_term = 0x1,
event_type = put,
kv = {
key = foo0,
value = bar3000,
create_revision = 1,
mod_revision = 3000,
version = 2;
},
}
```
[api-protobuf]: https://github.com/coreos/etcd/blob/master/etcdserver/etcdserverpb/rpc.proto
[kv-protobuf]: https://github.com/coreos/etcd/blob/master/mvcc/mvccpb/kv.proto

View File

@ -1,151 +0,0 @@
## Runtime Reconfiguration
etcd comes with support for incremental runtime reconfiguration, which allows users to update the membership of the cluster at run time.
Reconfiguration requests can only be processed when the the majority of the cluster members are functioning. It is **highly recommended** to always have a cluster size greater than two in production. It is unsafe to remove a member from a two member cluster. The majority of a two member cluster is also two. If there is a failure during the removal process, the cluster might not able to make progress and need to [restart from majority failure][majority failure].
[majority failure]: #restart-cluster-from-majority-failure
## Reconfiguration Use Cases
Let us walk through the four use cases for re-configuring a cluster: replacing a member, increasing or decreasing cluster size, and restarting a cluster from a majority failure.
### Replace a Non-recoverable Member
The most common use case of cluster reconfiguration is to replace a member because of a permanent failure of the existing member: for example, hardware failure or data directory corruption.
It is important to replace failed members as soon as the failure is detected.
If etcd falls below a simple majority of members it can no longer accept writes: e.g. in a 3 member cluster the loss of two members will cause writes to fail and the cluster to stop operating.
If you want to migrate a running member to another machine, please refer [member migration section][member migration].
[member migration]: https://github.com/coreos/etcd/blob/master/Documentation/admin_guide.md#member-migration
### Increase Cluster Size
To make your cluster more resilient to machine failure you can increase the size of the cluster.
For example, if the cluster consists of three machines, it can tolerate one failure.
If we increase the cluster size to five, it can tolerate two machine failures.
Increasing the cluster size can also provide better read performance.
When a client accesses etcd, the normal read gets the data from the local copy of each member (members always shares the same view of the cluster at the same index, which is guaranteed by the sequential consistency of etcd).
Since clients can read from any member, increasing the number of members thus increases overall read throughput.
### Decrease Cluster Size
To improve the write performance of a cluster, you might want to trade off resilience by removing members.
etcd replicates the data to the majority of members of the cluster before committing the write.
Decreasing the cluster size means the etcd cluster has to do less work for each write, thus increasing the write performance.
### Restart Cluster from Majority Failure
If the majority of your cluster is lost, then you need to take manual action in order to recover safely.
The basic steps in the recovery process include creating a new cluster using the old data, forcing a single member to act as the leader, and finally using runtime configuration to add members to this new cluster.
TODO: https://github.com/coreos/etcd/issues/1242
## Cluster Reconfiguration Operations
Now that we have the use cases in mind, let us lay out the operations involved in each.
Before making any change, the simple majority (quorum) of etcd members must be available.
This is essentially the same requirement as for any other write to etcd.
All changes to the cluster are done one at a time:
To replace a single member you will make an add then a remove operation
To increase from 3 to 5 members you will make two add operations
To decrease from 5 to 3 you will make two remove operations
All of these examples will use the `etcdctl` command line tool that ships with etcd.
If you want to use the member API directly you can find the documentation [here](https://github.com/coreos/etcd/blob/master/Documentation/other_apis.md).
### Remove a Member
First, we need to find the target member:
```
$ etcdctl member list
6e3bd23ae5f1eae0: name=node2 peerURLs=http://localhost:7002 clientURLs=http://127.0.0.1:4002
924e2e83e93f2560: name=node3 peerURLs=http://localhost:7003 clientURLs=http://127.0.0.1:4003
a8266ecf031671f3: name=node1 peerURLs=http://localhost:7001 clientURLs=http://127.0.0.1:4001
```
Let us say the member ID we want to remove is a8266ecf031671f3.
We then use the `remove` command to perform the removal:
```
$ etcdctl member remove a8266ecf031671f3
Removed member a8266ecf031671f3 from cluster
```
The target member will stop itself at this point and print out the removal in the log:
```
etcd: this member has been permanently removed from the cluster. Exiting.
```
Removal of the leader is safe, but the cluster will be out of progress for a period of election timeout because it needs to elect the new leader.
### Add a Member
Adding a member is a two step process:
* Add the new member to the cluster via the [members API](https://github.com/coreos/etcd/blob/master/Documentation/other_apis.md#post-v2members) or the `etcdctl member add` command.
* Start the member with the correct configuration.
Using `etcdctl` let's add the new member to the cluster:
```
$ etcdctl member add infra3 http://10.0.1.13:2380
added member 9bf1b35fc7761a23 to cluster
ETCD_NAME="infra3"
ETCD_INITIAL_CLUSTER="infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380,infra3=http://10.0.1.13:2380"
ETCD_INITIAL_CLUSTER_STATE=existing
```
> Notice that infra3 was added to the cluster using its advertised peer URL.
Now start the new etcd process with the relevant flags for the new member:
```
$ export ETCD_NAME="infra3"
$ export ETCD_INITIAL_CLUSTER="infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380,infra3=http://10.0.1.13:2380"
$ export ETCD_INITIAL_CLUSTER_STATE=existing
$ etcd -listen-client-urls http://10.0.1.13:2379 -advertise-client-urls http://10.0.1.13:2379 -listen-peer-urls http://10.0.1.13:2380 -initial-advertise-peer-urls http://10.0.1.13:2380
```
The new member will run as a part of the cluster and immediately begin catching up with the rest of the cluster.
If you are adding multiple members the best practice is to configure the new member, then start the process, then configure the next, and so on.
A common case is increasing a cluster from 1 to 3: if you add one member to a 1-node cluster, the cluster cannot make progress before the new member starts because it needs two members as majority to agree on the consensus.
#### Error Cases
In the following case we have not included our new host in the list of enumerated nodes.
If this is a new cluster, the node must be added to the list of initial cluster members.
```
$ etcd -name infra3 \
-initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
-initial-cluster-state existing
etcdserver: assign ids error: the member count is unequal
exit 1
```
In this case we give a different address (10.0.1.14:2380) to the one that we used to join the cluster (10.0.1.13:2380).
```
$ etcd -name infra4 \
-initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380,infra4=http://10.0.1.14:2380 \
-initial-cluster-state existing
etcdserver: assign ids error: unmatched member while checking PeerURLs
exit 1
```
When we start etcd using the data directory of a removed member, etcd will exit automatically if it connects to any alive member in the cluster:
```
$ etcd
etcd: this member has been permanently removed from the cluster. Exiting.
exit 1
```

View File

@ -1,38 +1,46 @@
## Tuning
# Tuning
The default settings in etcd should work well for installations on a local network where the average network latency is low.
However, when using etcd across multiple data centers or over networks with high latency you may need to tweak the heartbeat interval and election timeout settings.
The default settings in etcd should work well for installations on a local network where the average network latency is low. However, when using etcd across multiple data centers or over networks with high latency, the heartbeat interval and election timeout settings may need tuning.
The network isn't the only source of latency. Each request and response may be impacted by slow disks on both the leader and follower. Each of these timeouts represents the total time from request to successful response from the other machine.
### Time Parameters
## Time parameters
The underlying distributed consensus protocol relies on two separate time parameters to ensure that nodes can handoff leadership if one stalls or goes offline.
The first parameter is called the *Heartbeat Interval*.
This is the frequency with which the leader will notify followers that it is still the leader.
etcd batches commands together for higher throughput so this heartbeat interval is also a delay for how long it takes for commands to be committed.
By default, etcd uses a `50ms` heartbeat interval.
For best practices, the parameter should be set around round-trip time between members.
By default, etcd uses a `100ms` heartbeat interval.
The second parameter is the *Election Timeout*.
This timeout is how long a follower node will go without hearing a heartbeat before attempting to become leader itself.
By default, etcd uses a `200ms` election timeout.
By default, etcd uses a `1000ms` election timeout.
Adjusting these values is a trade off.
Lowering the heartbeat interval will cause individual commands to be committed faster but it will lower the overall throughput of etcd.
If your etcd instances have low utilization then lowering the heartbeat interval can improve your command response time.
The value of heartbeat interval is recommended to be around the maximum of average round-trip time (RTT) between members, normally around 0.5-1.5x the round-trip time.
If heartbeat interval is too low, etcd will send unnecessary messages that increase the usage of CPU and network resources.
On the other side, a too high heartbeat interval leads to high election timeout. Higher election timeout takes longer time to detect a leader failure.
The easiest way to measure round-trip time (RTT) is to use [PING utility][ping].
The election timeout should be set based on the heartbeat interval and your network ping time between nodes.
Election timeouts should be at least 10 times your ping time so it can account for variance in your network.
For example, if the ping time between your nodes is 10ms then you should have at least a 100ms election timeout.
The election timeout should be set based on the heartbeat interval and average round-trip time between members.
Election timeouts must be at least 10 times the round-trip time so it can account for variance in the network.
For example, if the round-trip time between members is 10ms then the election timeout should be at least 100ms.
You should also set your election timeout to at least 4 to 5 times your heartbeat interval to account for variance in leader replication.
For a heartbeat interval of 50ms you should set your election timeout to at least 200ms - 250ms.
The election timeout should be set to at least 5 to 10 times the heartbeat interval to account for variance in leader replication.
For a heartbeat interval of 50ms, set the election timeout to at least 250ms - 500ms.
You can override the default values on the command line:
The upper limit of election timeout is 50000ms (50s), which should only be used when deploying a globally-distributed etcd cluster.
A reasonable round-trip time for the continental United States is 130ms, and the time between US and Japan is around 350-400ms.
If the network has uneven performance or regular packet delays/loss then it is possible that a couple of retries may be necessary to successfully send a packet. So 5s is a safe upper limit of global round-trip time.
As the election timeout should be an order of magnitude bigger than broadcast time, in the case of ~5s for a globally distributed cluster, then 50 seconds becomes a reasonable maximum.
The heartbeat interval and election timeout value should be the same for all members in one cluster. Setting different values for etcd members may disrupt cluster stability.
The default values can be overridden on the command line:
```sh
# Command line arguments:
$ etcd -heartbeat-interval=100 -election-timeout=500
$ etcd --heartbeat-interval=100 --election-timeout=500
# Environment variables:
$ ETCD_HEARTBEAT_INTERVAL=100 ETCD_ELECTION_TIMEOUT=500 etcd
@ -40,7 +48,7 @@ $ ETCD_HEARTBEAT_INTERVAL=100 ETCD_ELECTION_TIMEOUT=500 etcd
The values are specified in milliseconds.
### Snapshots
## Snapshots
etcd appends all key changes to a log file.
This log grows forever and is a complete linear history of every change made to the keys.
@ -49,26 +57,37 @@ A complete history works well for lightly used clusters but clusters that are he
To avoid having a huge log etcd makes periodic snapshots.
These snapshots provide a way for etcd to compact the log by saving the current state of the system and removing old logs.
### Snapshot Tuning
### Snapshot tuning
Creating snapshots can be expensive so they're only created after a given number of changes to etcd.
By default, snapshots will be made after every 10,000 changes.
If etcd's memory usage and disk usage are too high, you can lower the snapshot threshold by setting the following on the command line:
If etcd's memory usage and disk usage are too high, try lowering the snapshot threshold by setting the following on the command line:
```sh
# Command line arguments:
$ etcd -snapshot-count=5000
$ etcd --snapshot-count=5000
# Environment variables:
$ ETCD_SNAPSHOT_COUNT=5000 etcd
```
You can also disable snapshotting by adding the following to your command line:
## Network
```sh
# Command line arguments:
$ etcd -snapshot false
If the etcd leader serves a large number of concurrent client requests, it may delay processing follower peer requests due to network congestion. This manifests as send buffer error messages on the follower nodes:
# Environment variables:
$ ETCD_SNAPSHOT=false etcd
```
dropped MsgProp to 247ae21ff9436b2d since streamMsg's sending buffer is full
dropped MsgAppResp to 247ae21ff9436b2d since streamMsg's sending buffer is full
```
These errors may be resolved by prioritizing etcd's peer traffic over its client traffic. On Linux, peer traffic can be prioritized by using the traffic control mechanism:
```
tc qdisc add dev eth0 root handle 1: prio bands 3
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip sport 2380 0xffff flowid 1:1
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip dport 2380 0xffff flowid 1:1
tc filter add dev eth0 parent 1: protocol ip prio 2 u32 match ip sport 2739 0xffff flowid 1:1
tc filter add dev eth0 parent 1: protocol ip prio 2 u32 match ip dport 2739 0xffff flowid 1:1
```
[ping]: https://en.wikipedia.org/wiki/Ping_(networking_utility)

View File

@ -0,0 +1,119 @@
## Upgrade etcd from 2.3 to 3.0
In the general case, upgrading from etcd 2.3 to 3.0 can be a zero-downtime, rolling upgrade:
- one by one, stop the etcd v2.3 processes and replace them with etcd v3.0 processes
- after running all v3.0 processes, new features in v3.0 are available to the cluster
Before [starting an upgrade](#upgrade-procedure), read through the rest of this guide to prepare.
### Upgrade checklists
#### Upgrade requirements
To upgrade an existing etcd deployment to 3.0, the running cluster must be 2.3 or greater. If it's before 2.3, please upgrade to [2.3](https://github.com/coreos/etcd/releases/tag/v2.3.0) before upgrading to 3.0.
Also, to ensure a smooth rolling upgrade, the running cluster must be healthy. Check the health of the cluster by using the `etcdctl cluster-health` command before proceeding.
#### Preparation
Before upgrading etcd, always test the services relying on etcd in a staging environment before deploying the upgrade to the production environment.
Before beginning, [backup the etcd data directory](../v2/admin_guide.md#backing-up-the-datastore). Should something go wrong with the upgrade, it is possible to use this backup to [downgrade](#downgrade) back to existing etcd version.
#### Mixed versions
While upgrading, an etcd cluster supports mixed versions of etcd members, and operates with the protocol of the lowest common version. The cluster is only considered upgraded once all of its members are upgraded to version 3.0. Internally, etcd members negotiate with each other to determine the overall cluster version, which controls the reported version and the supported features.
#### Limitations
It might take up to 2 minutes for the newly upgraded member to catch up with the existing cluster when the total data size is larger than 50MB. Check the size of a recent snapshot to estimate the total data size. In other words, it is safest to wait for 2 minutes between upgrading each member.
For a much larger total data size, 100MB or more , this one-time process might take even more time. Administrators of very large etcd clusters of this magnitude can feel free to contact the [etcd team][etcd-contact] before upgrading, and well be happy to provide advice on the procedure.
#### Downgrade
If all members have been upgraded to v3.0, the cluster will be upgraded to v3.0, and downgrade from this completed state is **not possible**. If any single member is still v2.3, however, the cluster and its operations remains “v2.3”, and it is possible from this mixed cluster state to return to using a v2.3 etcd binary on all members.
Please [backup the data directory](../v2/admin_guide.md#backing-up-the-datastore) of all etcd members to make downgrading the cluster possible even after it has been completely upgraded.
### Upgrade procedure
This example details the upgrade of a three-member v2.3 ectd cluster running on a local machine.
#### 1. Check upgrade requirements.
Is the cluster healthy and running v.2.3.x?
```
$ etcdctl cluster-health
member 6e3bd23ae5f1eae0 is healthy: got healthy result from http://localhost:22379
member 924e2e83e93f2560 is healthy: got healthy result from http://localhost:32379
member 8211f1d0f64f3269 is healthy: got healthy result from http://localhost:12379
cluster is healthy
$ curl http://localhost:2379/version
{"etcdserver":"2.3.x","etcdcluster":"2.3.0"}
```
#### 2. Stop the existing etcd process
When each etcd process is stopped, expected errors will be logged by other cluster members. This is normal since a cluster member connection has been (temporarily) broken:
```
2016-06-27 15:21:48.624124 E | rafthttp: failed to dial 8211f1d0f64f3269 on stream Message (dial tcp 127.0.0.1:12380: getsockopt: connection refused)
2016-06-27 15:21:48.624175 I | rafthttp: the connection with 8211f1d0f64f3269 became inactive
```
Its a good idea at this point to [backup the etcd data directory](../v2/admin_guide.md#backing-up-the-datastore) to provide a downgrade path should any problems occur:
```
$ etcdctl backup \
--data-dir /var/lib/etcd \
--backup-dir /tmp/etcd_backup
```
#### 3. Drop-in etcd v3.0 binary and start the new etcd process
The new v3.0 etcd will publish its information to the cluster:
```
09:58:25.938673 I | etcdserver: published {Name:infra1 ClientURLs:[http://localhost:12379]} to cluster 524400597fb1d5f6
```
Verify that each member, and then the entire cluster, becomes healthy with the new v3.0 etcd binary:
```
$ etcdctl cluster-health
member 6e3bd23ae5f1eae0 is healthy: got healthy result from http://localhost:22379
member 924e2e83e93f2560 is healthy: got healthy result from http://localhost:32379
member 8211f1d0f64f3269 is healthy: got healthy result from http://localhost:12379
cluster is healthy
```
Upgraded members will log warnings like the following until the entire cluster is upgraded. This is expected and will cease after all etcd cluster members are upgraded to v3.0:
```
2016-06-27 15:22:05.679644 W | etcdserver: the local etcd version 2.3.7 is not up-to-date
2016-06-27 15:22:05.679660 W | etcdserver: member 8211f1d0f64f3269 has a higher version 3.0.0
```
#### 4. Repeat step 2 to step 3 for all other members
#### 5. Finish
When all members are upgraded, the cluster will report upgrading to 3.0 successfully:
```
2016-06-27 15:22:19.873751 N | membership: updated the cluster version from 2.3 to 3.0
2016-06-27 15:22:19.914574 I | api: enabled capabilities for version 3.0.0
```
```
$ ETCDCTL_API=3 etcdctl endpoint health
127.0.0.1:12379 is healthy: successfully committed proposal: took = 18.440155ms
127.0.0.1:32379 is healthy: successfully committed proposal: took = 13.651368ms
127.0.0.1:22379 is healthy: successfully committed proposal: took = 18.513301ms
```
[etcd-contact]: https://groups.google.com/forum/#!forum/etcd-dev

View File

@ -0,0 +1,123 @@
## Upgrade etcd from 3.0 to 3.1
In the general case, upgrading from etcd 3.0 to 3.1 can be a zero-downtime, rolling upgrade:
- one by one, stop the etcd v3.0 processes and replace them with etcd v3.1 processes
- after running all v3.1 processes, new features in v3.1 are available to the cluster
Before [starting an upgrade](#upgrade-procedure), read through the rest of this guide to prepare.
### Upgrade checklists
#### Upgrade requirements
To upgrade an existing etcd deployment to 3.1, the running cluster must be 3.0 or greater. If it's before 3.0, please upgrade to [3.0](https://github.com/coreos/etcd/releases/tag/v3.0.16) before upgrading to 3.1.
Also, to ensure a smooth rolling upgrade, the running cluster must be healthy. Check the health of the cluster by using the `etcdctl endpoint health` command before proceeding.
#### Preparation
Before upgrading etcd, always test the services relying on etcd in a staging environment before deploying the upgrade to the production environment.
Before beginning, [backup the etcd data](../op-guide/maintenance.md#snapshot-backup). Should something go wrong with the upgrade, it is possible to use this backup to [downgrade](#downgrade) back to existing etcd version. Please note that the `snapshot` command only backs up the v3 data. For v2 data, see [backing up v2 datastore](../v2/admin_guide.md#backing-up-the-datastore).
#### Mixed versions
While upgrading, an etcd cluster supports mixed versions of etcd members, and operates with the protocol of the lowest common version. The cluster is only considered upgraded once all of its members are upgraded to version 3.1. Internally, etcd members negotiate with each other to determine the overall cluster version, which controls the reported version and the supported features.
#### Limitations
Note: If the cluster only has v3 data and no v2 data, it is not subject to this limitation.
If the cluster is serving a v2 data set larger than 50MB, each newly upgraded member may take up to two minutes to catch up with the existing cluster. Check the size of a recent snapshot to estimate the total data size. In other words, it is safest to wait for 2 minutes between upgrading each member.
For a much larger total data size, 100MB or more , this one-time process might take even more time. Administrators of very large etcd clusters of this magnitude can feel free to contact the [etcd team][etcd-contact] before upgrading, and we'll be happy to provide advice on the procedure.
#### Downgrade
If all members have been upgraded to v3.1, the cluster will be upgraded to v3.1, and downgrade from this completed state is **not possible**. If any single member is still v3.0, however, the cluster and its operations remains "v3.0", and it is possible from this mixed cluster state to return to using a v3.0 etcd binary on all members.
Please [backup the data directory](../op-guide/maintenance.md#snapshot-backup) of all etcd members to make downgrading the cluster possible even after it has been completely upgraded.
### Upgrade procedure
This example shows how to upgrade a 3-member v3.0 ectd cluster running on a local machine.
#### 1. Check upgrade requirements
Is the cluster healthy and running v3.0.x?
```
$ ETCDCTL_API=3 etcdctl endpoint health --endpoints=localhost:2379,localhost:22379,localhost:32379
localhost:2379 is healthy: successfully committed proposal: took = 6.600684ms
localhost:22379 is healthy: successfully committed proposal: took = 8.540064ms
localhost:32379 is healthy: successfully committed proposal: took = 8.763432ms
$ curl http://localhost:2379/version
{"etcdserver":"3.0.16","etcdcluster":"3.0.0"}
```
#### 2. Stop the existing etcd process
When each etcd process is stopped, expected errors will be logged by other cluster members. This is normal since a cluster member connection has been (temporarily) broken:
```
2017-01-17 09:34:18.352662 I | raft: raft.node: 1640829d9eea5cfb elected leader 1640829d9eea5cfb at term 5
2017-01-17 09:34:18.359630 W | etcdserver: failed to reach the peerURL(http://localhost:2380) of member fd32987dcd0511e0 (Get http://localhost:2380/version: dial tcp 127.0.0.1:2380: getsockopt: connection refused)
2017-01-17 09:34:18.359679 W | etcdserver: cannot get the version of member fd32987dcd0511e0 (Get http://localhost:2380/version: dial tcp 127.0.0.1:2380: getsockopt: connection refused)
2017-01-17 09:34:18.548116 W | rafthttp: lost the TCP streaming connection with peer fd32987dcd0511e0 (stream Message writer)
2017-01-17 09:34:19.147816 W | rafthttp: lost the TCP streaming connection with peer fd32987dcd0511e0 (stream MsgApp v2 writer)
2017-01-17 09:34:34.364907 W | etcdserver: failed to reach the peerURL(http://localhost:2380) of member fd32987dcd0511e0 (Get http://localhost:2380/version: dial tcp 127.0.0.1:2380: getsockopt: connection refused)
```
It's a good idea at this point to [backup the etcd data](../op-guide/maintenance.md#snapshot-backup) to provide a downgrade path should any problems occur:
```
$ etcdctl snapshot save backup.db
```
#### 3. Drop-in etcd v3.1 binary and start the new etcd process
The new v3.1 etcd will publish its information to the cluster:
```
2017-01-17 09:36:00.996590 I | etcdserver: published {Name:my-etcd-1 ClientURLs:[http://localhost:2379]} to cluster 46bc3ce73049e678
```
Verify that each member, and then the entire cluster, becomes healthy with the new v3.1 etcd binary:
```
$ ETCDCTL_API=3 /etcdctl endpoint health --endpoints=localhost:2379,localhost:22379,localhost:32379
localhost:22379 is healthy: successfully committed proposal: took = 5.540129ms
localhost:32379 is healthy: successfully committed proposal: took = 7.321671ms
localhost:2379 is healthy: successfully committed proposal: took = 10.629901ms
```
Upgraded members will log warnings like the following until the entire cluster is upgraded. This is expected and will cease after all etcd cluster members are upgraded to v3.1:
```
2017-01-17 09:36:38.406268 W | etcdserver: the local etcd version 3.0.16 is not up-to-date
2017-01-17 09:36:38.406295 W | etcdserver: member fd32987dcd0511e0 has a higher version 3.1.0
2017-01-17 09:36:42.407695 W | etcdserver: the local etcd version 3.0.16 is not up-to-date
2017-01-17 09:36:42.407730 W | etcdserver: member fd32987dcd0511e0 has a higher version 3.1.0
```
#### 4. Repeat step 2 to step 3 for all other members
#### 5. Finish
When all members are upgraded, the cluster will report upgrading to 3.1 successfully:
```
2017-01-17 09:37:03.100015 I | etcdserver: updating the cluster version from 3.0 to 3.1
2017-01-17 09:37:03.104263 N | etcdserver/membership: updated the cluster version from 3.0 to 3.1
2017-01-17 09:37:03.104374 I | etcdserver/api: enabled capabilities for version 3.1
```
```
$ ETCDCTL_API=3 /etcdctl endpoint health --endpoints=localhost:2379,localhost:22379,localhost:32379
localhost:2379 is healthy: successfully committed proposal: took = 2.312897ms
localhost:22379 is healthy: successfully committed proposal: took = 2.553476ms
localhost:32379 is healthy: successfully committed proposal: took = 2.516902ms
```
[etcd-contact]: https://groups.google.com/forum/#!forum/etcd-dev

View File

@ -0,0 +1,31 @@
# Snapshot Migration
You can migrate a snapshot of your data from a v0.4.9+ cluster into a new etcd 2.2 cluster using a snapshot migration. After snapshot migration, the etcd indexes of your data will change. Many etcd applications rely on these indexes to behave correctly. This operation should only be done while all etcd applications are stopped.
To get started get the newest data snapshot from the 0.4.9+ cluster:
```
curl http://cluster.example.com:4001/v2/migration/snapshot > backup.snap
```
Now, import the snapshot into your new cluster:
```
etcdctl --endpoint new_cluster.example.com import --snap backup.snap
```
If you have a large amount of data, you can specify more concurrent works to copy data in parallel by using `-c` flag.
If you have hidden keys to copy, you can use `--hidden` flag to specify. For example fleet uses `/_coreos.com/fleet` so to import those keys use `--hidden /_coreos.com`.
And the data will quickly copy into the new cluster:
```
entering dir: /
entering dir: /foo
entering dir: /foo/bar
copying key: /foo/bar/1 1
entering dir: /
entering dir: /foo2
entering dir: /foo2/bar2
copying key: /foo2/bar2/2 2
```

165
Documentation/v2/README.md Normal file
View File

@ -0,0 +1,165 @@
# etcd2
[![Go Report Card](https://goreportcard.com/badge/github.com/coreos/etcd)](https://goreportcard.com/report/github.com/coreos/etcd)
[![Build Status](https://travis-ci.org/coreos/etcd.svg?branch=master)](https://travis-ci.org/coreos/etcd)
[![Build Status](https://semaphoreci.com/api/v1/coreos/etcd/branches/master/shields_badge.svg)](https://semaphoreci.com/coreos/etcd)
[![Docker Repository on Quay.io](https://quay.io/repository/coreos/etcd-git/status "Docker Repository on Quay.io")](https://quay.io/repository/coreos/etcd-git)
**Note**: The `master` branch may be in an *unstable or even broken state* during development. Please use [releases][github-release] instead of the `master` branch in order to get stable binaries.
![etcd Logo](../../logos/etcd-horizontal-color.png)
etcd is a distributed, consistent key-value store for shared configuration and service discovery, with a focus on being:
* *Simple*: curl'able user-facing API (HTTP+JSON)
* *Secure*: optional SSL client cert authentication
* *Fast*: benchmarked 1000s of writes/s per instance
* *Reliable*: properly distributed using Raft
etcd is written in Go and uses the [Raft][raft] consensus algorithm to manage a highly-available replicated log.
etcd is used [in production by many companies](./production-users.md), and the development team stands behind it in critical deployment scenarios, where etcd is frequently teamed with applications such as [Kubernetes][k8s], [fleet][fleet], [locksmith][locksmith], [vulcand][vulcand], and many others.
See [etcdctl][etcdctl] for a simple command line client.
Or feel free to just use `curl`, as in the examples below.
[raft]: https://raft.github.io/
[k8s]: http://kubernetes.io/
[fleet]: https://github.com/coreos/fleet
[locksmith]: https://github.com/coreos/locksmith
[vulcand]: https://github.com/vulcand/vulcand
[etcdctl]: https://github.com/coreos/etcd/tree/master/etcdctl
## Getting Started
### Getting etcd
The easiest way to get etcd is to use one of the pre-built release binaries which are available for OSX, Linux, Windows, AppC (ACI), and Docker. Instructions for using these binaries are on the [GitHub releases page][github-release].
For those wanting to try the very latest version, you can build the latest version of etcd from the `master` branch.
You will first need [*Go*](https://golang.org/) installed on your machine (version 1.5+ is required).
All development occurs on `master`, including new features and bug fixes.
Bug fixes are first targeted at `master` and subsequently ported to release branches, as described in the [branch management][branch-management] guide.
[github-release]: https://github.com/coreos/etcd/releases/
[branch-management]: branch_management.md
### Running etcd
First start a single-member cluster of etcd:
```sh
./bin/etcd
```
This will bring up etcd listening on port 2379 for client communication and on port 2380 for server-to-server communication.
Next, let's set a single key, and then retrieve it:
```
curl -L http://127.0.0.1:2379/v2/keys/mykey -XPUT -d value="this is awesome"
curl -L http://127.0.0.1:2379/v2/keys/mykey
```
You have successfully started an etcd and written a key to the store.
### etcd TCP ports
The [official etcd ports][iana-ports] are 2379 for client requests, and 2380 for peer communication. To maintain compatibility, some etcd configuration and documentation continues to refer to the legacy ports 4001 and 7001, but all new etcd use and discussion should adopt the IANA-assigned ports. The legacy ports 4001 and 7001 will be fully deprecated, and support for their use removed, in future etcd releases.
[iana-ports]: https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=etcd
### Running local etcd cluster
First install [goreman](https://github.com/mattn/goreman), which manages Procfile-based applications.
Our [Procfile script](./Procfile) will set up a local example cluster. You can start it with:
```sh
goreman start
```
This will bring up 3 etcd members `infra1`, `infra2` and `infra3` and etcd proxy `proxy`, which runs locally and composes a cluster.
You can write a key to the cluster and retrieve the value back from any member or proxy.
### Next Steps
Now it's time to dig into the full etcd API and other guides.
- Explore the full [API][api].
- Set up a [multi-machine cluster][clustering].
- Learn the [config format, env variables and flags][configuration].
- Find [language bindings and tools][libraries-and-tools].
- Use TLS to [secure an etcd cluster][security].
- [Tune etcd][tuning].
- [Upgrade from 0.4.9+ to 2.2.0][upgrade].
[api]: ./api.md
[clustering]: ./clustering.md
[configuration]: ./configuration.md
[libraries-and-tools]: ./libraries-and-tools.md
[security]: ./security.md
[tuning]: ./tuning.md
[upgrade]: ./04_to_2_snapshot_migration.md
## Contact
- Mailing list: [etcd-dev](https://groups.google.com/forum/?hl=en#!forum/etcd-dev)
- IRC: #[etcd](irc://irc.freenode.org:6667/#etcd) on freenode.org
- Planning/Roadmap: [milestones](https://github.com/coreos/etcd/milestones), [roadmap](../../ROADMAP.md)
- Bugs: [issues](https://github.com/coreos/etcd/issues)
## Contributing
See [CONTRIBUTING](../../CONTRIBUTING.md) for details on submitting patches and the contribution workflow.
## Reporting bugs
See [reporting bugs](reporting_bugs.md) for details about reporting any issue you may encounter.
## Known bugs
[GH518](https://github.com/coreos/etcd/issues/518) is a known bug. Issue is that:
```
curl http://127.0.0.1:2379/v2/keys/foo -XPUT -d value=bar
curl http://127.0.0.1:2379/v2/keys/foo -XPUT -d dir=true -d prevExist=true
```
If the previous node is a key and client tries to overwrite it with `dir=true`, it does not give warnings such as `Not a directory`. Instead, the key is set to empty value.
## Project Details
### Versioning
#### Service Versioning
etcd uses [semantic versioning](http://semver.org)
New minor versions may add additional features to the API.
You can get the version of etcd by issuing a request to /version:
```sh
curl -L http://127.0.0.1:2379/version
```
#### API Versioning
The `v2` API responses should not change after the 2.0.0 release but new features will be added over time.
#### 32-bit and other unsupported systems
etcd has known issues on 32-bit systems due to a bug in the Go runtime. See #[358][358] for more information.
To avoid inadvertently running a possibly unstable etcd server, `etcd` on unsupported architectures will print
a warning message and immediately exit if the environment variable `ETCD_UNSUPPORTED_ARCH` is not set to
the target architecture.
Currently only the amd64 architecture is officially supported by `etcd`.
[358]: https://github.com/coreos/etcd/issues/358
### License
etcd is under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.

View File

@ -1,42 +1,110 @@
## Administration
# Administration
### Data Directory
## Data Directory
#### Lifecycle
### Lifecycle
When first started, etcd stores its configuration into a data directory specified by the data-dir configuration parameter.
Configuration is stored in the write ahead log and includes: the local member ID, cluster ID, and initial cluster configuration.
The write ahead log and snapshot files are used during member operation and to recover after a restart.
If a members data directory is ever lost or corrupted then the user should remove the etcd member from the cluster via the [members API][members-api].
Having a dedicated disk to store wal files can improve the throughput and stabilize the cluster.
It is highly recommended to dedicate a wal disk and set `--wal-dir` to point to a directory on that device for a production cluster deployment.
If a members data directory is ever lost or corrupted then the user should [remove][remove-a-member] the etcd member from the cluster using `etcdctl` tool.
A user should avoid restarting an etcd member with a data directory from an out-of-date backup.
Using an out-of-date data directory can lead to inconsistency as the member had agreed to store information via raft then re-joins saying it needs that information again.
For maximum safety, if an etcd member suffers any sort of data corruption or loss, it must be removed from the cluster.
Once removed the member can be re-added with an empty data directory.
[members-api]: https://github.com/coreos/etcd/blob/master/Documentation/other_apis.md#members-api
#### Contents
### Contents
The data directory has two sub-directories in it:
1. wal: write ahead log files are stored here. For details see the [wal package documentation][wal-pkg]
2. snap: log snapshots are stored here. For details see the [snap package documentation][snap-pkg]
[wal-pkg]: http://godoc.org/github.com/coreos/etcd/wal
[snap-pkg]: http://godoc.org/github.com/coreos/etcd/snap
If `--wal-dir` flag is set, etcd will write the write ahead log files to the specified directory instead of data directory.
### Cluster Management
## Cluster Management
#### Lifecycle
### Lifecycle
If you are spinning up multiple clusters for testing it is recommended that you specify a unique initial-cluster-token for the different clusters.
This can protect you from cluster corruption in case of mis-configuration because two members started with different cluster tokens will refuse members from each other.
#### Optimal Cluster Size
### Monitoring
The recommended etcd cluster size is 3, 5 or 7, which is decided by the fault tolerance requirement. A 7-member cluster can provide enough fault tolerance in most cases. While larger cluster provides better fault tolerance, its write performance becomes lower since data needs to be replicated to more machines.
It is important to monitor your production etcd cluster for healthy information and runtime metrics.
#### Health Monitoring
At lowest level, etcd exposes health information via HTTP at `/health` in JSON format. If it returns `{"health": "true"}`, then the cluster is healthy. Please note the `/health` endpoint is still an experimental one as in etcd 2.2.
```
$ curl -L http://127.0.0.1:2379/health
{"health": "true"}
```
You can also use etcdctl to check the cluster-wide health information. It will contact all the members of the cluster and collect the health information for you.
```
$./etcdctl cluster-health
member 8211f1d0f64f3269 is healthy: got healthy result from http://127.0.0.1:12379
member 91bc3c398fb3c146 is healthy: got healthy result from http://127.0.0.1:22379
member fd422379fda50e48 is healthy: got healthy result from http://127.0.0.1:32379
cluster is healthy
```
#### Runtime Metrics
etcd uses [Prometheus][prometheus] for metrics reporting in the server. You can read more through the runtime metrics [doc][metrics].
### Debugging
Debugging a distributed system can be difficult. etcd provides several ways to make debug
easier.
#### Enabling Debug Logging
When you want to debug etcd without stopping it, you can enable debug logging at runtime.
etcd exposes logging configuration at `/config/local/log`.
```
$ curl http://127.0.0.1:2379/config/local/log -XPUT -d '{"Level":"DEBUG"}'
$ # debug logging enabled
$
$ curl http://127.0.0.1:2379/config/local/log -XPUT -d '{"Level":"INFO"}'
$ # debug logging disabled
```
#### Debugging Variables
Debug variables are exposed for real-time debugging purposes. Developers who are familiar with etcd can utilize these variables to debug unexpected behavior. etcd exposes debug variables via HTTP at `/debug/vars` in JSON format. The debug variables contains
`cmdline`, `file_descriptor_limit`, `memstats` and `raft.status`.
`cmdline` is the command line arguments passed into etcd.
`file_descriptor_limit` is the max number of file descriptors etcd can utilize.
`memstats` is explained in detail in the [Go runtime documentation][golang-memstats].
`raft.status` is useful when you want to debug low level raft issues if you are familiar with raft internals. In most cases, you do not need to check `raft.status`.
```json
{
"cmdline": ["./etcd"],
"file_descriptor_limit": 0,
"memstats": {"Alloc":4105744,"TotalAlloc":42337320,"Sys":12560632,"...":"..."},
"raft.status": {"id":"ce2a822cea30bfca","term":5,"vote":"ce2a822cea30bfca","commit":23509,"lead":"ce2a822cea30bfca","raftState":"StateLeader","progress":{"ce2a822cea30bfca":{"match":23509,"next":23510,"state":"ProgressStateProbe"}}}
}
```
### Optimal Cluster Size
The recommended etcd cluster size is 3, 5 or 7, which is decided by the fault tolerance requirement. A 7-member cluster can provide enough fault tolerance in most cases. While larger cluster provides better fault tolerance the write performance reduces since data needs to be replicated to more machines.
#### Fault Tolerance Table
@ -45,7 +113,8 @@ It is recommended to have an odd number of members in a cluster. Having an odd c
| Cluster Size | Majority | Failure Tolerance |
|--------------|------------|-------------------|
| 1 | 1 | 0 |
| 3 | 2 | 1 |
| 2 | 2 | 0 |
| 3 | 2 | **1** |
| 4 | 3 | 1 |
| 5 | 3 | **2** |
| 6 | 4 | 2 |
@ -55,16 +124,20 @@ It is recommended to have an odd number of members in a cluster. Having an odd c
As you can see, adding another member to bring the size of cluster up to an odd size is always worth it. During a network partition, an odd number of members also guarantees that there will almost always be a majority of the cluster that can continue to operate and be the source of truth when the partition ends.
#### Changing Cluster Size
After your cluster is up and running, adding or removing members is done via [runtime reconfiguration][runtime-reconfig], which allows the cluster to be modified without downtime. The `etcdctl` tool has `member list`, `member add` and `member remove` commands to complete this process.
### Member Migration
When there is a scheduled machine maintenance or retirement, you might want to migrate an etcd member to another machine without losing the data and changing the member ID.
When there is a scheduled machine maintenance or retirement, you might want to migrate an etcd member to another machine without losing the data and changing the member ID.
The data directory contains all the data to recover a member to its point-in-time state. To migrate a member:
* Stop the member process
* Copy the data directory of the now-idle member to the new machine
* Update the peer URLs for that member to reflect the new machine according to the [member api] [change peer url]
* Start etcd on the new machine, using the same configuration and the copy of the data directory
* Stop the member process.
* Copy the data directory of the now-idle member to the new machine.
* Update the peer URLs for the replaced member to reflect the new machine according to the [runtime reconfiguration instructions][update-a-member].
* Start etcd on the new machine, using the same configuration and the copy of the data directory.
This example will walk you through the process of migrating the infra1 member to a new machine:
@ -74,11 +147,11 @@ This example will walk you through the process of migrating the infra1 member to
|infra1|10.0.1.11:2380|
|infra2|10.0.1.12:2380|
```
$ export ETCDCTL_PEERS=http://10.0.1.10:2379,http://10.0.1.11:2379,http://10.0.1.12:2379
```sh
$ export ETCDCTL_ENDPOINT=http://10.0.1.10:2379,http://10.0.1.11:2379,http://10.0.1.12:2379
```
```
```sh
$ etcdctl member list
84194f7c5edd8b37: name=infra0 peerURLs=http://10.0.1.10:2380 clientURLs=http://127.0.0.1:2379,http://10.0.1.10:2379
b4db3bf5e495e255: name=infra1 peerURLs=http://10.0.1.11:2380 clientURLs=http://127.0.0.1:2379,http://10.0.1.11:2379
@ -87,66 +160,72 @@ bc1083c870280d44: name=infra2 peerURLs=http://10.0.1.12:2380 clientURLs=http://1
#### Stop the member etcd process
```
$ ssh core@10.0.1.11
```sh
$ ssh 10.0.1.11
```
```
$ sudo systemctl stop etcd
```sh
$ kill `pgrep etcd`
```
#### Copy the data directory of the now-idle member to the new machine
```
$ tar -cvzf node1.etcd.tar.gz /var/lib/etcd/node1.etcd
$ tar -cvzf infra1.etcd.tar.gz %data_dir%
```
```
$ scp node1.etcd.tar.gz core@10.0.1.13:~/
```sh
$ scp infra1.etcd.tar.gz 10.0.1.13:~/
```
#### Update the peer URLs for that member to reflect the new machine
```
```sh
$ curl http://10.0.1.10:2379/v2/members/b4db3bf5e495e255 -XPUT \
-H "Content-Type: application/json" -d '{"peerURLs":["http://10.0.1.13:2380"]}'
```
Or use `etcdctl member update` command
```sh
$ etcdctl member update b4db3bf5e495e255 http://10.0.1.13:2380
```
#### Start etcd on the new machine, using the same configuration and the copy of the data directory
```sh
$ ssh 10.0.1.13
```
$ ssh core@10.0.1.13
```sh
$ tar -xzvf infra1.etcd.tar.gz -C %data_dir%
```
```
$ tar -xzvf node1.etcd.tar.gz -C /var/lib/etcd
```
```
etcd -name node1 \
etcd -name infra1 \
-listen-peer-urls http://10.0.1.13:2380 \
-listen-client-urls http://10.0.1.13:2379,http://127.0.0.1:2379 \
-advertise-client-urls http://10.0.1.13:2379,http://127.0.0.1:2379
```
[change peer url]: https://github.com/coreos/etcd/blob/master/Documentation/other_apis.md#change-the-peer-urls-of-a-member
### Disaster Recovery
etcd is designed to be resilient to machine failures. An etcd cluster can automatically recover from any number of temporary failures (for example, machine reboots), and a cluster of N members can tolerate up to _(N/2)-1_ permanent failures (where a member can no longer access the cluster, due to hardware failure or disk corruption). However, in extreme circumstances, a cluster might permanently lose enough members such that quorum is irrevocably lost. For example, if a three-node cluster suffered two simultaneous and unrecoverable machine failures, it would be normally impossible for the cluster to restore quorum and continue functioning.
etcd is designed to be resilient to machine failures. An etcd cluster can automatically recover from any number of temporary failures (for example, machine reboots), and a cluster of N members can tolerate up to _(N-1)/2_ permanent failures (where a member can no longer access the cluster, due to hardware failure or disk corruption). However, in extreme circumstances, a cluster might permanently lose enough members such that quorum is irrevocably lost. For example, if a three-node cluster suffered two simultaneous and unrecoverable machine failures, it would be normally impossible for the cluster to restore quorum and continue functioning.
To recover from such scenarios, etcd provides functionality to backup and restore the datastore and recreate the cluster without data loss.
#### Backing up the datastore
**NB:** Windows users must stop etcd before running the backup command.
**Note:** Windows users must stop etcd before running the backup command.
The first step of the recovery is to backup the data directory on a functioning etcd node. To do this, use the `etcdctl backup` command, passing in the original data directory used by etcd. For example:
The first step of the recovery is to backup the data directory and wal directory, if stored separately, on a functioning etcd node. To do this, use the `etcdctl backup` command, passing in the original data (and wal) directory used by etcd. For example:
```sh
etcdctl backup \
--data-dir /var/lib/etcd \
--backup-dir /tmp/etcd_backup
--data-dir %data_dir% \
[--wal-dir %wal_dir%] \
--backup-dir %backup_data_dir%
[--backup-wal-dir %backup_wal_dir%]
```
This command will rewrite some of the metadata contained in the backup (specifically, the node ID and cluster ID), which means that the node will lose its former identity. In order to recreate a cluster from the backup, you will need to start a new, single-node cluster. The metadata is rewritten to prevent the new node from inadvertently being joined onto an existing cluster.
@ -157,31 +236,39 @@ To restore a backup using the procedure created above, start etcd with the `-for
```sh
etcd \
-data-dir=/tmp/etcd_backup \
-data-dir=%backup_data_dir% \
[-wal-dir=%backup_wal_dir%] \
-force-new-cluster \
...
```
Now etcd should be available on this node and serving the original datastore.
Once you have verified that etcd has started successfully, shut it down and move the data back to the previous location (you may wish to make another copy as well to be safe):
Once you have verified that etcd has started successfully, shut it down and move the data and wal, if stored separately, back to the previous location (you may wish to make another copy as well to be safe):
```sh
pkill etcd
rm -fr /var/lib/etcd
mv /tmp/etcd_backup /var/lib/etcd
rm -fr %data_dir%
rm -fr %wal_dir%
mv %backup_data_dir% %data_dir%
mv %backup_wal_dir% %wal_dir%
etcd \
-data-dir=/var/lib/etcd \
-data-dir=%data_dir% \
[-wal-dir=%wal_dir%] \
...
```
#### Restoring the cluster
Now that the node is running successfully, you can add more nodes to the cluster and restore resiliency. See the [runtime configuration](runtime-configuration.md) guide for more details.
Now that the node is running successfully, [change its advertised peer URLs][update-a-member], as the `--force-new-cluster` option has set the peer URL to the default listening on localhost.
You can then add more nodes to the cluster and restore resiliency. See the [add a new member][add-a-member] guide for more details.
**Note:** If you are trying to restore your cluster using old failed etcd nodes, please make sure you have stopped old etcd instances and removed their old data directories specified by the data-dir configuration parameter.
### Client Request Timeout
etcd sets different timeouts for various types of client requests. The timeout value is not tunable now, which will be improved soon(https://github.com/coreos/etcd/issues/2038).
etcd sets different timeouts for various types of client requests. The timeout value is not tunable now, which will be improved soon (https://github.com/coreos/etcd/issues/2038).
#### Get requests
@ -203,3 +290,23 @@ If the request times out, it indicates two possibilities:
2. the majority of the cluster is not functioning.
If timeout happens several times continuously, administrators should check status of cluster and resolve it as soon as possible.
### Best Practices
#### Maximum OS threads
By default, etcd uses the default configuration of the Go 1.4 runtime, which means that at most one operating system thread will be used to execute code simultaneously. (Note that this default behavior [has changed in Go 1.5][golang1.5-runtime]).
When using etcd in heavy-load scenarios on machines with multiple cores it will usually be desirable to increase the number of threads that etcd can utilize. To do this, simply set the environment variable GOMAXPROCS to the desired number when starting etcd. For more information on this variable, see the [Go runtime documentation][golang-runtime].
[add-a-member]: runtime-configuration.md#add-a-new-member
[golang1.5-runtime]: https://golang.org/doc/go1.5#runtime
[golang-memstats]: https://golang.org/pkg/runtime/#MemStats
[golang-runtime]: https://golang.org/pkg/runtime
[metrics]: metrics.md
[prometheus]: http://prometheus.io/
[remove-a-member]: runtime-configuration.md#remove-a-member
[runtime-reconfig]: runtime-configuration.md#cluster-reconfiguration-operations
[snap-pkg]: http://godoc.org/github.com/coreos/etcd/snap
[update-a-member]: runtime-configuration.md#update-a-member
[wal-pkg]: http://godoc.org/github.com/coreos/etcd/wal

View File

@ -78,12 +78,9 @@ X-Raft-Index: 5398
X-Raft-Term: 1
```
- `X-Etcd-Index` is the current etcd index as explained above.
- `X-Raft-Index` is similar to the etcd index but is for the underlying raft protocol
- `X-Raft-Term` is an integer that will increase whenever an etcd master election happens in the cluster. If this number is increasing rapidly, you may need to tune the election timeout. See the [tuning][tuning] section for details.
[tuning]: #tuning
* `X-Etcd-Index` is the current etcd index as explained above. When request is a watch on key space, `X-Etcd-Index` is the current etcd index when the watch starts, which means that the watched event may happen after `X-Etcd-Index`.
* `X-Raft-Index` is similar to the etcd index but is for the underlying raft protocol.
* `X-Raft-Term` is an integer that will increase whenever an etcd master election happens in the cluster. If this number is increasing rapidly, you may need to tune the election timeout. See the [tuning][tuning] section for details.
### Get the value of a key
@ -234,6 +231,51 @@ curl http://127.0.0.1:2379/v2/keys/foo -XPUT -d value=bar -d ttl= -d prevExist=t
}
```
### Refreshing key TTL
Keys in etcd can be refreshed without notifying current watchers.
This can be achieved by setting the refresh to true when updating a TTL.
You cannot update the value of a key when refreshing it.
```sh
curl http://127.0.0.1:2379/v2/keys/foo -XPUT -d value=bar -d ttl=5
curl http://127.0.0.1:2379/v2/keys/foo -XPUT -d ttl=5 -d refresh=true -d prevExist=true
```
```json
{
"action": "set",
"node": {
"createdIndex": 5,
"expiration": "2013-12-04T12:01:21.874888581-08:00",
"key": "/foo",
"modifiedIndex": 5,
"ttl": 5,
"value": "bar"
}
}
{
"action":"update",
"node":{
"key":"/foo",
"value":"bar",
"expiration": "2013-12-04T12:01:26.874888581-08:00",
"ttl":5,
"modifiedIndex":6,
"createdIndex":5
},
"prevNode":{
"key":"/foo",
"value":"bar",
"expiration":"2013-12-04T12:01:21.874888581-08:00",
"ttl":3,
"modifiedIndex":5,
"createdIndex":5
}
}
```
### Waiting for a change
@ -277,7 +319,7 @@ The first terminal should get the notification and return with the same response
However, the watch command can do more than this.
Using the index, we can watch for commands that have happened in the past.
This is useful for ensuring you don't miss events between watch commands.
Typically, we watch again from the (modifiedIndex + 1) of the node we got.
Typically, we watch again from the `modifiedIndex` + 1 of the node we got.
Let's try to watch for the set command of index 7 again:
@ -287,48 +329,81 @@ curl 'http://127.0.0.1:2379/v2/keys/foo?wait=true&waitIndex=7'
The watch command returns immediately with the same response as previously.
**Note**: etcd only keeps the responses of the most recent 1000 events.
If we were to restart the watch from index 8 with:
```sh
curl 'http://127.0.0.1:2379/v2/keys/foo?wait=true&waitIndex=8'
```
Then even if etcd is on index 9 or 800, the first event to occur to the `/foo`
key between 8 and the current index will be returned.
**Note**: etcd only keeps the responses of the most recent 1000 events across all etcd keys.
It is recommended to send the response to another thread to process immediately
instead of blocking the watch while processing the result.
If we miss all the 1000 events, we need to recover the current state of the
watching key space. First, We do a get and then start to watch from the (etcdIndex + 1).
#### Watch from cleared event index
For example, we set `/foo="bar"` for 2000 times and tries to wait from index 7.
If we miss all the 1000 events, we need to recover the current state of the
watching key space through a get and then start to watch from the
`X-Etcd-Index` + 1.
For example, we set `/other="bar"` for 2000 times and try to wait from index 8.
```sh
curl 'http://127.0.0.1:2379/v2/keys/foo?wait=true&waitIndex=7'
curl 'http://127.0.0.1:2379/v2/keys/foo?wait=true&waitIndex=8'
```
We get the index is outdated response, since we miss the 1000 events kept in etcd.
```
{"errorCode":401,"message":"The event in requested index is outdated and cleared","cause":"the requested history has been cleared [1003/7]","index":2002}
{"errorCode":401,"message":"The event in requested index is outdated and cleared","cause":"the requested history has been cleared [1008/8]","index":2007}
```
To start watch, frist we need to fetch the current state of key `/foo` and the etcdIndex.
To start watch, first we need to fetch the current state of key `/foo`:
```sh
curl 'http://127.0.0.1:2379/v2/keys/foo' -vv
```
```
< HTTP/1.1 200 OK
< Content-Type: application/json
< X-Etcd-Cluster-Id: 7e27652122e8b2ae
< X-Etcd-Index: 2002
< X-Etcd-Index: 2007
< X-Raft-Index: 2615
< X-Raft-Term: 2
< Date: Mon, 05 Jan 2015 18:54:43 GMT
< Transfer-Encoding: chunked
<
{"action":"get","node":{"key":"/foo","value":"","modifiedIndex":2002,"createdIndex":2002}}
{"action":"get","node":{"key":"/foo","value":"bar","modifiedIndex":7,"createdIndex":7}}
```
The `X-Etcd-Index` is important. It is the index when we got the value of `/foo`.
So we can watch again from the (`X-Etcd-Index` + 1) without missing an event after the last get.
Unlike watches we use the `X-Etcd-Index` + 1 of the response as a `waitIndex`
instead of the node's `modifiedIndex` + 1 for two reasons:
1. The `X-Etcd-Index` is always greater than or equal to the `modifiedIndex` when
getting a key because `X-Etcd-Index` is the current etcd index, and the `modifiedIndex`
is the index of an event already stored in etcd.
2. None of the events represented by indexes between `modifiedIndex` and
`X-Etcd-Index` will be related to the key being fetched.
Using the `modifiedIndex` + 1 is functionally equivalent for subsequent
watches, but since it is smaller than the `X-Etcd-Index` + 1, we may receive a
`401 EventIndexCleared` error immediately.
So the first watch after the get should be:
```sh
curl 'http://127.0.0.1:2379/v2/keys/foo?wait=true&waitIndex=2003'
curl 'http://127.0.0.1:2379/v2/keys/foo?wait=true&waitIndex=2008'
```
#### Connection being closed prematurely
The server may close a long polling connection before emitting any events.
This can happen due to a timeout or the server being shutdown.
Since the HTTP header is sent immediately upon accepting the connection, the response will be seen as empty: `200 OK` and empty body.
The clients should be prepared to deal with this scenario and retry the watch.
### Atomically Creating In-Order Keys
@ -347,7 +422,7 @@ curl http://127.0.0.1:2379/v2/keys/queue -XPOST -d value=Job1
"action": "create",
"node": {
"createdIndex": 6,
"key": "/queue/6",
"key": "/queue/00000000000000000006",
"modifiedIndex": 6,
"value": "Job1"
}
@ -366,7 +441,7 @@ curl http://127.0.0.1:2379/v2/keys/queue -XPOST -d value=Job2
"action": "create",
"node": {
"createdIndex": 29,
"key": "/queue/29",
"key": "/queue/00000000000000000029",
"modifiedIndex": 29,
"value": "Job2"
}
@ -390,13 +465,13 @@ curl -s 'http://127.0.0.1:2379/v2/keys/queue?recursive=true&sorted=true'
"nodes": [
{
"createdIndex": 2,
"key": "/queue/2",
"key": "/queue/00000000000000000002",
"modifiedIndex": 2,
"value": "Job1"
},
{
"createdIndex": 3,
"key": "/queue/3",
"key": "/queue/00000000000000000003",
"modifiedIndex": 3,
"value": "Job2"
}
@ -439,7 +514,7 @@ curl http://127.0.0.1:2379/v2/keys/dir -XPUT -d ttl=30 -d dir=true -d prevExist=
Keys that are under this directory work as usual, but when the directory expires, a watcher on a key under the directory will get an expire event:
```sh
curl 'http://127.0.0.1:2379/v2/keys/dir/asdf?wait=true'
curl 'http://127.0.0.1:2379/v2/keys/dir?wait=true'
```
```json
@ -467,13 +542,15 @@ etcd can be used as a centralized coordination service in a cluster, and `Compar
This command will set the value of a key only if the client-provided conditions are equal to the current conditions.
*Note that `CompareAndSwap` does not work with [directories][directories]. If an attempt is made to `CompareAndSwap` a directory, a 102 "Not a file" error will be returned.*
The current comparable conditions are:
1. `prevValue` - checks the previous value of the key.
2. `prevIndex` - checks the previous modifiedIndex of the key.
3. `prevExist` - checks existence of the key: if `prevExist` is true, it is an `update` request; if prevExist is `false`, it is a `create` request.
3. `prevExist` - checks existence of the key: if `prevExist` is true, it is an `update` request; if `prevExist` is `false`, it is a `create` request.
Here is a simple example.
Let's create a key-value pair first: `foo=one`.
@ -482,6 +559,25 @@ Let's create a key-value pair first: `foo=one`.
curl http://127.0.0.1:2379/v2/keys/foo -XPUT -d value=one
```
```json
{
"action":"set",
"node":{
"key":"/foo",
"value":"one",
"modifiedIndex":4,
"createdIndex":4
}
}
```
Specifying `noValueOnSuccess` option skips returning the node as value.
```sh
curl http://127.0.0.1:2379/v2/keys/foo?noValueOnSuccess=true -XPUT -d value=one
# {"action":"set"}
```
Now let's try some invalid `CompareAndSwap` commands.
Trying to set this existing key with `prevExist=false` fails as expected:
@ -552,6 +648,8 @@ We successfully changed the value from "one" to "two" since we gave the correct
This command will delete a key only if the client-provided conditions are equal to the current conditions.
*Note that `CompareAndDelete` does not work with [directories]. If an attempt is made to `CompareAndDelete` a directory, a 102 "Not a file" error will be returned.*
The current comparable conditions are:
1. `prevValue` - checks the previous value of the key.
@ -870,7 +968,7 @@ Here we see the `/message` key but our hidden `/_message` key is not returned.
### Setting a key from a file
You can also use etcd to store small configuration files, json documents, XML documents, etc directly.
You can also use etcd to store small configuration files, JSON documents, XML documents, etc directly.
For example you can use curl to upload a simple text file and encode it:
```
@ -913,19 +1011,35 @@ curl http://127.0.0.1:2379/v2/stats/leader
```json
{
"id": "2c7d3e0b8627375b",
"leaderInfo": {
"leader": "8a69d5f6b7814500",
"startTime": "2014-10-24T13:15:51.184719899-07:00",
"uptime": "7m17.859616962s"
"followers": {
"6e3bd23ae5f1eae0": {
"counts": {
"fail": 0,
"success": 745
},
"latency": {
"average": 0.017039507382550306,
"current": 0.000138,
"maximum": 1.007649,
"minimum": 0,
"standardDeviation": 0.05289178277920594
}
},
"a8266ecf031671f3": {
"counts": {
"fail": 0,
"success": 735
},
"latency": {
"average": 0.012124141496598642,
"current": 0.000559,
"maximum": 0.791547,
"minimum": 0,
"standardDeviation": 0.04187900156583733
}
}
},
"name": "infra1",
"recvAppendRequestCnt": 3949,
"recvBandwidthRate": 561.5729321100841,
"recvPkgRate": 9.008227977383449,
"sendAppendRequestCnt": 0,
"startTime": "2014-10-24T13:15:50.070369454-07:00",
"state": "StateFollower"
"leader": "924e2e83e93f2560"
}
```
@ -979,19 +1093,19 @@ curl http://127.0.0.1:2379/v2/stats/self
```json
{
"id": "eca0338f4ea31566",
"id": "924e2e83e93f2560",
"leaderInfo": {
"leader": "8a69d5f6b7814500",
"startTime": "2014-10-24T13:15:51.186620747-07:00",
"uptime": "10m47.012122091s"
"leader": "924e2e83e93f2560",
"startTime": "2015-02-09T11:38:30.177534688-08:00",
"uptime": "9m33.891343412s"
},
"name": "node3",
"recvAppendRequestCnt": 5835,
"recvBandwidthRate": 584.1485698657176,
"recvPkgRate": 9.17390765395709,
"sendAppendRequestCnt": 0,
"startTime": "2014-10-24T13:15:50.072007085-07:00",
"state": "StateFollower"
"name": "infra3",
"recvAppendRequestCnt": 0,
"sendAppendRequestCnt": 6535,
"sendBandwidthRate": 824.1758351191694,
"sendPkgRate": 11.111234716807138,
"startTime": "2015-02-09T11:38:28.972034204-08:00",
"state": "StateLeader"
}
```
@ -999,6 +1113,7 @@ curl http://127.0.0.1:2379/v2/stats/self
### Store Statistics
The store statistics include information about the operations that this node has handled.
Note that v2 `store Statistics` is stored in-memory. When a member stops, store statistics will reset on restart.
Operations that modify the store's state like create, delete, set and update are seen by the entire cluster and the number will increase on all nodes.
Operations like get and watch are node local and will only be seen on this node.
@ -1028,6 +1143,8 @@ curl http://127.0.0.1:2379/v2/stats/store
## Cluster Config
See the [other etcd APIs][other-apis] for details on the cluster management.
See the [members API][members-api] for details on the cluster management.
[other-apis]: https://github.com/coreos/etcd/blob/master/Documentation/other_apis.md
[directories]: #listing-a-directory
[members-api]: members_api.md
[tuning]: tuning.md

View File

@ -0,0 +1,92 @@
# etcd3 API
TODO: API doc
## Data Model
etcd is designed to reliably store infrequently updated data and provide reliable watch queries. etcd exposes previous versions of key-value pairs to support inexpensive snapshots and watch history events (“time travel queries”). A persistent, multi-version, concurrency-control data model is a good fit for these use cases.
etcd stores data in a multiversion [persistent][persistent-ds] key-value store. The persistent key-value store preserves the previous version of a key-value pair when its value is superseded with new data. The key-value store is effectively immutable; its operations do not update the structure in-place, but instead always generates a new updated structure. All past versions of keys are still accessible and watchable after modification. To prevent the data store from growing indefinitely over time from maintaining old versions, the store may be compacted to shed the oldest versions of superseded data.
### Logical View
The stores logical view is a flat binary key space. The key space has a lexically sorted index on byte string keys so range queries are inexpensive.
The key space maintains multiple revisions. Each atomic mutative operation (e.g., a transaction operation may contain multiple operations) creates a new revision on the key space. All data held by previous revisions remains unchanged. Old versions of key can still be accessed through previous revisions. Likewise, revisions are indexed as well; ranging over revisions with watchers is efficient. If the store is compacted to recover space, revisions before the compact revision will be removed.
A keys lifetime spans a generation. Each key may have one or multiple generations. Creating a key increments the generation of that key, starting at 1 if the key never existed. Deleting a key generates a key tombstone, concluding the keys current generation. Each modification of a key creates a new version of the key. Once a compaction happens, any generation ended before the given revision will be removed and values set before the compaction revision except the latest one will be removed.
### Physical View
etcd stores the physical data as key-value pairs in a persistent [b+tree][b+tree]. Each revision of the stores state only contains the delta from its previous revision to be efficient. A single revision may correspond to multiple keys in the tree.
The key of key-value pair is a 3-tuple (major, sub, type). Major is the store revision holding the key. Sub differentiates among keys within the same revision. Type is an optional suffix for special value (e.g., `t` if the value contains a tombstone). The value of the key-value pair contains the modification from previous revision, thus one delta from previous revision. The b+tree is ordered by key in lexical byte-order. Ranged lookups over revision deltas are fast; this enables quickly finding modifications from one specific revision to another. Compaction removes out-of-date keys-value pairs.
etcd also keeps a secondary in-memory [btree][btree] index to speed up range queries over keys. The keys in the btree index are the keys of the store exposed to user. The value is a pointer to the modification of the persistent b+tree. Compaction removes dead pointers.
## KV API Guarantees
etcd is a consistent and durable key value store with mini-transaction(TODO: link to txn doc when we have it) support. The key value store is exposed through the KV APIs. etcd tries to ensure the strongest consistency and durability guarantees for a distributed system. This specification enumerates the KV API guarantees made by etcd.
### APIs to consider
* Read APIs
* range
* watch
* Write APIs
* put
* delete
* Combination (read-modify-write) APIs
* txn
### etcd Specific Definitions
#### operation completed
An etcd operation is considered complete when it is committed through consensus, and therefore “executed” -- permanently stored -- by the etcd storage engine. The client knows an operation is completed when it receives a response from the etcd server. Note that the client may be uncertain about the status of an operation if it times out, or there is a network disruption between the client and the etcd member. etcd may also abort operations when there is a leader election. etcd does not send `abort` responses to clients outstanding requests in this event.
#### revision
An etcd operation that modifies the key value store is assigned with a single increasing revision. A transaction operation might modifies the key value store multiple times, but only one revision is assigned. The revision attribute of a key value pair that modified by the operation has the same value as the revision of the operation. The revision can be used as a logical clock for key value store. A key value pair that has a larger revision is modified after a key value pair with a smaller revision. Two key value pairs that have the same revision are modified by an operation "concurrently".
### Guarantees Provided
#### Atomicity
All API requests are atomic; an operation either completes entirely or not at all. For watch requests, all events generated by one operation will be in one watch response. Watch never observes partial events for a single operation.
#### Consistency
All API calls ensure [sequential consistency][seq_consistency], the strongest consistency guarantee available from distributed systems. No matter which etcd member server a client makes requests to, a client reads the same events in the same order. If two members complete the same number of operations, the state of the two members is consistent.
For watch operations, etcd guarantees to return the same value for the same key across all members for the same revision. For range operations, etcd has a similar guarantee for [linearized][Linearizability] access; serialized access may be behind the quorum state, so that the later revision is not yet available.
As with all distributed systems, it is impossible for etcd to ensure [strict consistency][strict_consistency]. etcd does not guarantee that it will return to a read the “most recent” value (as measured by a wall clock when a request is completed) available on any cluster member.
#### Isolation
etcd ensures [serializable isolation][serializable_isolation], which is the highest isolation level available in distributed systems. Read operations will never observe any intermediate data.
#### Durability
Any completed operations are durable. All accessible data is also durable data. A read will never return data that has not been made durable.
#### Linearizability
Linearizability (also known as Atomic Consistency or External Consistency) is a consistency level between strict consistency and sequential consistency.
For linearizability, suppose each operation receives a timestamp from a loosely synchronized global clock. Operations are linearized if and only if they always complete as though they were executed in a sequential order and each operation appears to complete in the order specified by the program. Likewise, if an operations timestamp precedes another, that operation must also precede the other operation in the sequence.
For example, consider a client completing a write at time point 1 (*t1*). A client issuing a read at *t2* (for *t2* > *t1*) should receive a value at least as recent as the previous write, completed at *t1*. However, the read might actually complete only by *t3*, and the returned value, current at *t2* when the read began, might be "stale" by *t3*.
etcd does not ensure linearizability for watch operations. Users are expected to verify the revision of watch responses to ensure correct ordering.
etcd ensures linearizability for all other operations by default. Linearizability comes with a cost, however, because linearized requests must go through the Raft consensus process. To obtain lower latencies and higher throughput for read requests, clients can configure a requests consistency mode to `serializable`, which may access stale data with respect to quorum, but removes the performance penalty of linearized accesses' reliance on live consensus.
[persistent-ds]: [https://en.wikipedia.org/wiki/Persistent_data_structure]
[btree]: [https://en.wikipedia.org/wiki/B-tree]
[b+tree]: [https://en.wikipedia.org/wiki/B%2B_tree]
[seq_consistency]: [https://en.wikipedia.org/wiki/Consistency_model#Sequential_consistency]
[strict_consistency]: [https://en.wikipedia.org/wiki/Consistency_model#Strict_consistency]
[serializable_isolation]: [https://en.wikipedia.org/wiki/Isolation_(database_systems)#Serializable]
[Linearizability]: [#Linearizability]

View File

@ -0,0 +1,511 @@
# v2 Auth and Security
## etcd Resources
There are three types of resources in etcd
1. permission resources: users and roles in the user store
2. key-value resources: key-value pairs in the key-value store
3. settings resources: security settings, auth settings, and dynamic etcd cluster settings (election/heartbeat)
### Permission Resources
#### Users
A user is an identity to be authenticated. Each user can have multiple roles. The user has a capability (such as reading or writing) on the resource if one of the roles has that capability.
A user named `root` is required before authentication can be enabled, and it always has the ROOT role. The ROOT role can be granted to multiple users, but `root` is required for recovery purposes.
#### Roles
Each role has exact one associated Permission List. An permission list exists for each permission on key-value resources.
The special static ROOT (named `root`) role has a full permissions on all key-value resources, the permission to manage user resources and settings resources. Only the ROOT role has the permission to manage user resources and modify settings resources. The ROOT role is built-in and does not need to be created.
There is also a special GUEST role, named 'guest'. These are the permissions given to unauthenticated requests to etcd. This role will be created automatically, and by default allows access to the full keyspace due to backward compatibility. (etcd did not previously authenticate any actions.). This role can be modified by a ROOT role holder at any time, to reduce the capabilities of unauthenticated users.
#### Permissions
There are two types of permissions, `read` and `write`. All management and settings require the ROOT role.
A Permission List is a list of allowed patterns for that particular permission (read or write). Only ALLOW prefixes are supported. DENY becomes more complicated and is TBD.
### Key-Value Resources
A key-value resource is a key-value pairs in the store. Given a list of matching patterns, permission for any given key in a request is granted if any of the patterns in the list match.
Only prefixes or exact keys are supported. A prefix permission string ends in `*`.
A permission on `/foo` is for that exact key or directory, not its children or recursively. `/foo*` is a prefix that matches `/foo` recursively, and all keys thereunder, and keys with that prefix (eg. `/foobar`. Contrast to the prefix `/foo/*`). `*` alone is permission on the full keyspace.
### Settings Resources
Specific settings for the cluster as a whole. This can include adding and removing cluster members, enabling or disabling authentication, replacing certificates, and any other dynamic configuration by the administrator (holder of the ROOT role).
## v2 Auth
### Basic Auth
We only support [Basic Auth][basic-auth] for the first version. Client needs to attach the basic auth to the HTTP Authorization Header.
### Authorization field for operations
Added to requests to /v2/keys, /v2/auth
Add code 401 Unauthorized to the set of responses from the v2 API
Authorization: Basic {encoded string}
### Future Work
Other types of auth can be considered for the future (eg, signed certs, public keys) but the `Authorization:` header allows for other such types
### Things out of Scope for etcd Permissions
* Pluggable AUTH backends like LDAP (other Authorization tokens generated by LDAP et al may be a possibility)
* Very fine-grained access controls (eg: users modifying keys outside work hours)
## API endpoints
An Error JSON corresponds to:
{
"name": "ErrErrorName",
"description" : "The longer helpful description of the error."
}
#### Enable and Disable Authentication
**Get auth status**
GET /v2/auth/enable
Sent Headers:
Possible Status Codes:
200 OK
200 Body:
{
"enabled": true
}
**Enable auth**
PUT /v2/auth/enable
Sent Headers:
Put Body: (empty)
Possible Status Codes:
200 OK
400 Bad Request (if root user has not been created)
409 Conflict (already enabled)
200 Body: (empty)
**Disable auth**
DELETE /v2/auth/enable
Sent Headers:
Authorization: Basic <RootAuthString>
Possible Status Codes:
200 OK
401 Unauthorized (if not a root user)
409 Conflict (already disabled)
200 Body: (empty)
#### Users
The User JSON object is formed as follows:
```
{
"user": "userName",
"password": "password",
"roles": [
"role1",
"role2"
],
"grant": [],
"revoke": []
}
```
Password is only passed when necessary.
**Get a List of Users**
GET/HEAD /v2/auth/users
Sent Headers:
Authorization: Basic <BasicAuthString>
Possible Status Codes:
200 OK
401 Unauthorized
200 Headers:
Content-type: application/json
200 Body:
{
"users": [
{
"user": "alice",
"roles": [
{
"role": "root",
"permissions": {
"kv": {
"read": ["/*"],
"write": ["/*"]
}
}
}
]
},
{
"user": "bob",
"roles": [
{
"role": "guest",
"permissions": {
"kv": {
"read": ["/*"],
"write": ["/*"]
}
}
}
]
}
]
}
**Get User Details**
GET/HEAD /v2/auth/users/alice
Sent Headers:
Authorization: Basic <BasicAuthString>
Possible Status Codes:
200 OK
401 Unauthorized
404 Not Found
200 Headers:
Content-type: application/json
200 Body:
{
"user" : "alice",
"roles" : [
{
"role": "fleet",
"permissions" : {
"kv" : {
"read": [ "/fleet/" ],
"write": [ "/fleet/" ]
}
}
},
{
"role": "etcd",
"permissions" : {
"kv" : {
"read": [ "/*" ],
"write": [ "/*" ]
}
}
}
]
}
**Create Or Update A User**
A user can be created with initial roles, if filled in. However, no roles are required; only the username and password fields
PUT /v2/auth/users/charlie
Sent Headers:
Authorization: Basic <BasicAuthString>
Put Body:
JSON struct, above, matching the appropriate name
* Starting password and roles when creating.
* Grant/Revoke/Password filled in when updating (to grant roles, revoke roles, or change the password).
Possible Status Codes:
200 OK
201 Created
400 Bad Request
401 Unauthorized
404 Not Found (update non-existent users)
409 Conflict (when granting duplicated roles or revoking non-existent roles)
200 Headers:
Content-type: application/json
200 Body:
JSON state of the user
**Remove A User**
DELETE /v2/auth/users/charlie
Sent Headers:
Authorization: Basic <BasicAuthString>
Possible Status Codes:
200 OK
401 Unauthorized
403 Forbidden (remove root user when auth is enabled)
404 Not Found
200 Headers:
200 Body: (empty)
#### Roles
A full role structure may look like this. A Permission List structure is used for the "permissions", "grant", and "revoke" keys.
```
{
"role" : "fleet",
"permissions" : {
"kv" : {
"read" : [ "/fleet/" ],
"write": [ "/fleet/" ]
}
},
"grant" : {"kv": {...}},
"revoke": {"kv": {...}}
}
```
**Get Role Details**
GET/HEAD /v2/auth/roles/fleet
Sent Headers:
Authorization: Basic <BasicAuthString>
Possible Status Codes:
200 OK
401 Unauthorized
404 Not Found
200 Headers:
Content-type: application/json
200 Body:
{
"role" : "fleet",
"permissions" : {
"kv" : {
"read": [ "/fleet/" ],
"write": [ "/fleet/" ]
}
}
}
**Get a list of Roles**
GET/HEAD /v2/auth/roles
Sent Headers:
Authorization: Basic <BasicAuthString>
Possible Status Codes:
200 OK
401 Unauthorized
200 Headers:
Content-type: application/json
200 Body:
{
"roles": [
{
"role": "fleet",
"permissions": {
"kv": {
"read": ["/fleet/"],
"write": ["/fleet/"]
}
}
},
{
"role": "etcd",
"permissions": {
"kv": {
"read": ["/*"],
"write": ["/*"]
}
}
},
{
"role": "quay",
"permissions": {
"kv": {
"read": ["/*"],
"write": ["/*"]
}
}
}
]
}
**Create Or Update A Role**
PUT /v2/auth/roles/rkt
Sent Headers:
Authorization: Basic <BasicAuthString>
Put Body:
Initial desired JSON state, including the role name for verification and:
* Starting permission set if creating
* Granted/Revoked permission set if updating
Possible Status Codes:
200 OK
201 Created
400 Bad Request
401 Unauthorized
404 Not Found (update non-existent roles)
409 Conflict (when granting duplicated permission or revoking non-existent permission)
200 Body:
JSON state of the role
**Remove A Role**
DELETE /v2/auth/roles/rkt
Sent Headers:
Authorization: Basic <BasicAuthString>
Possible Status Codes:
200 OK
401 Unauthorized
403 Forbidden (remove root)
404 Not Found
200 Headers:
200 Body: (empty)
## Example Workflow
Let's walk through an example to show two tenants (applications, in our case) using etcd permissions.
### Create root role
```
PUT /v2/auth/users/root
Put Body:
{"user" : "root", "password": "betterRootPW!"}
```
### Enable auth
```
PUT /v2/auth/enable
```
### Modify guest role (revoke write permission)
```
PUT /v2/auth/roles/guest
Headers:
Authorization: Basic <root:betterRootPW!>
Put Body:
{
"role" : "guest",
"revoke" : {
"kv" : {
"write": [
"/*"
]
}
}
}
```
### Create Roles for the Applications
Create the rkt role fully specified:
```
PUT /v2/auth/roles/rkt
Headers:
Authorization: Basic <root:betterRootPW!>
Body:
{
"role" : "rkt",
"permissions" : {
"kv": {
"read": [
"/rkt/*"
],
"write": [
"/rkt/*"
]
}
}
}
```
But let's make fleet just a basic role for now:
```
PUT /v2/auth/roles/fleet
Headers:
Authorization: Basic <root:betterRootPW!>
Body:
{
"role" : "fleet"
}
```
### Optional: Grant some permissions to the roles
Well, we finally figured out where we want fleet to live. Let's fix it.
(Note that we avoided this in the rkt case. So this step is optional.)
```
PUT /v2/auth/roles/fleet
Headers:
Authorization: Basic <root:betterRootPW!>
Put Body:
{
"role" : "fleet",
"grant" : {
"kv" : {
"read": [
"/rkt/fleet",
"/fleet/*"
]
}
}
}
```
### Create Users
Same as before, let's use rocket all at once and fleet separately
```
PUT /v2/auth/users/rktuser
Headers:
Authorization: Basic <root:betterRootPW!>
Body:
{"user" : "rktuser", "password" : "rktpw", "roles" : ["rkt"]}
```
```
PUT /v2/auth/users/fleetuser
Headers:
Authorization: Basic <root:betterRootPW!>
Body:
{"user" : "fleetuser", "password" : "fleetpw"}
```
### Optional: Grant Roles to Users
Likewise, let's explicitly grant fleetuser access.
```
PUT /v2/auth/users/fleetuser
Headers:
Authorization: Basic <root:betterRootPW!>
Body:
{"user": "fleetuser", "grant": ["fleet"]}
```
#### Start to use fleetuser and rktuser
For example:
```
PUT /v2/keys/rkt/RktData
Headers:
Authorization: Basic <rktuser:rktpw>
Body:
value=launch
```
Reads and writes outside the prefixes granted will fail with a 401 Unauthorized.
[basic-auth]: https://en.wikipedia.org/wiki/Basic_access_authentication

View File

@ -0,0 +1,180 @@
# Authentication Guide
## Overview
Authentication -- having users and roles in etcd -- was added in etcd 2.1. This guide will help you set up basic authentication in etcd.
etcd before 2.1 was a completely open system; anyone with access to the API could change keys. In order to preserve backward compatibility and upgradability, this feature is off by default.
For a full discussion of the RESTful API, see [the authentication API documentation][auth-api]
## Special Users and Roles
There is one special user, `root`, and there are two special roles, `root` and `guest`.
### User `root`
User `root` must be created before security can be activated. It has the `root` role and allows for the changing of anything inside etcd. The idea behind the `root` user is for recovery purposes -- a password is generated and stored somewhere -- and the root role is granted to the administrator accounts on the system. In the future, for troubleshooting and recovery, we will need to assume some access to the system, and future documentation will assume this root user (though anyone with the role will suffice).
### Role `root`
Role `root` cannot be modified, but it may be granted to any user. Having access via the root role not only allows global read-write access (as was the case before 2.1) but allows modification of the authentication policy and all administrative things, like modifying the cluster membership.
### Role `guest`
The `guest` role defines the permissions granted to any request that does not provide an authentication. This will be created on security activation (if it doesn't already exist) to have full access to all keys, as was true in etcd 2.0. It may be modified at any time, and cannot be removed.
## Working with users
The `user` subcommand for `etcdctl` handles all things having to do with user accounts.
A listing of users can be found with
```
$ etcdctl user list
```
Creating a user is as easy as
```
$ etcdctl user add myusername
```
And there will be prompt for a new password.
Roles can be granted and revoked for a user with
```
$ etcdctl user grant myusername -roles foo,bar,baz
$ etcdctl user revoke myusername -roles bar,baz
```
We can look at this user with
```
$ etcdctl user get myusername
```
And the password for a user can be changed with
```
$ etcdctl user passwd myusername
```
Which will prompt again for a new password.
To delete an account, there's always
```
$ etcdctl user remove myusername
```
## Working with roles
The `role` subcommand for `etcdctl` handles all things having to do with access controls for particular roles, as were granted to individual users.
A listing of roles can be found with
```
$ etcdctl role list
```
A new role can be created with
```
$ etcdctl role add myrolename
```
A role has no password; we are merely defining a new set of access rights.
Roles are granted access to various parts of the keyspace, a single path at a time.
Reading a path is simple; if the path ends in `*`, that key **and all keys prefixed with it**, are granted to holders of this role. If it does not end in `*`, only that key and that key alone is granted.
Access can be granted as either read, write, or both, as in the following examples:
```
# Give read access to keys under the /foo directory
$ etcdctl role grant myrolename -path '/foo/*' -read
# Give write-only access to the key at /foo/bar
$ etcdctl role grant myrolename -path '/foo/bar' -write
# Give full access to keys under /pub
$ etcdctl role grant myrolename -path '/pub/*' -readwrite
```
Beware that
```
# Give full access to keys under /pub??
$ etcdctl role grant myrolename -path '/pub*' -readwrite
```
Without the slash may include keys under `/publishing`, for example. To do both, grant `/pub` and `/pub/*`
To see what's granted, we can look at the role at any time:
```
$ etcdctl role get myrolename
```
Revocation of permissions is done the same logical way:
```
$ etcdctl role revoke myrolename -path '/foo/bar' -write
```
As is removing a role entirely
```
$ etcdctl role remove myrolename
```
## Enabling authentication
The minimal steps to enabling auth are as follows. The administrator can set up users and roles before or after enabling authentication, as a matter of preference.
Make sure the root user is created:
```
$ etcdctl user add root
New password:
```
And enable authentication
```
$ etcdctl auth enable
```
After this, etcd is running with authentication enabled. To disable it for any reason, use the reciprocal command:
```
$ etcdctl -u root:rootpw auth disable
```
It would also be good to check what guests (unauthenticated users) are allowed to do:
```
$ etcdctl -u root:rootpw role get guest
```
And modify this role appropriately, depending on your policies.
## Using `etcdctl` to authenticate
`etcdctl` supports a similar flag as `curl` for authentication.
```
$ etcdctl -u user:password get foo
```
or if you prefer to be prompted:
```
$ etcdctl -u user get foo
```
Otherwise, all `etcdctl` commands remain the same. Users and roles can still be created and modified, but require authentication by a user with the root role.
[auth-api]: auth_api.md

View File

@ -0,0 +1,71 @@
# Backward Compatibility
The main goal of etcd 2.0 release is to improve cluster safety around bootstrapping and dynamic reconfiguration. To do this, we deprecated the old error-prone APIs and provide a new set of APIs.
The other main focus of this release was a more reliable Raft implementation, but as this change is internal it should not have any notable effects to users.
## Command Line Flags Changes
The major flag changes are to mostly related to bootstrapping. The `initial-*` flags provide an improved way to specify the required criteria to start the cluster. The advertised URLs now support a list of values instead of a single value, which allows etcd users to gracefully migrate to the new set of IANA-assigned ports (2379/client and 2380/peers) while maintaining backward compatibility with the old ports.
- `-addr` is replaced by `-advertise-client-urls`.
- `-bind-addr` is replaced by `-listen-client-urls`.
- `-peer-addr` is replaced by `-initial-advertise-peer-urls`.
- `-peer-bind-addr` is replaced by `-listen-peer-urls`.
- `-peers` is replaced by `-initial-cluster`.
- `-peers-file` is replaced by `-initial-cluster`.
- `-peer-heartbeat-interval` is replaced by `-heartbeat-interval`.
- `-peer-election-timeout` is replaced by `-election-timeout`.
The documentation of new command line flags can be found at
https://github.com/coreos/etcd/blob/master/Documentation/v2/configuration.md.
## Data Directory Naming
The default data dir location has changed from {$hostname}.etcd to {name}.etcd.
## Key-Value API
### Read consistency flag
The consistent flag for read operations is removed in etcd 2.0.0. The normal read operations provides the same consistency guarantees with the 0.4.6 read operations with consistent flag set.
The read consistency guarantees are:
The consistent read guarantees the sequential consistency within one client that talks to one etcd server. Read/Write from one client to one etcd member should be observed in order. If one client write a value to an etcd server successfully, it should be able to get the value out of the server immediately.
Each etcd member will proxy the request to leader and only return the result to user after the result is applied on the local member. Thus after the write succeed, the user is guaranteed to see the value on the member it sent the request to.
Reads do not provide linearizability. If you want linearizable read, you need to set quorum option to true.
**Previous behavior**
We added an option for a consistent read in the old version of etcd since etcd 0.x redirects the write request to the leader. When the user get back the result from the leader, the member it sent the request to originally might not apply the write request yet. With the consistent flag set to true, the client will always send read request to the leader. So one client should be able to see its last write when consistent=true is enabled. There is no order guarantees among different clients.
## Standby
etcd 0.4s standby mode has been deprecated. [Proxy mode][proxymode] is introduced to solve a subset of problems standby was solving.
Standby mode was intended for large clusters that had a subset of the members acting in the consensus process. Overall this process was too magical and allowed for operators to back themselves into a corner.
Proxy mode in 2.0 will provide similar functionality, and with improved control over which machines act as proxies due to the operator specifically configuring them. Proxies also support read only or read/write modes for increased security and durability.
[proxymode]: proxy.md
## Discovery Service
A size key needs to be provided inside a [discovery token][discoverytoken].
[discoverytoken]: clustering.md#custom-etcd-discovery-service
## HTTP Admin API
`v2/admin` on peer url and `v2/keys/_etcd` are unified under the new [v2/members API][members-api] to better explain which machines are part of an etcd cluster, and to simplify the keyspace for all your use cases.
[members-api]: members_api.md
## HTTP Key Value API
- The follower can now transparently proxy write requests to the leader. Clients will no longer see 307 redirections to the leader from etcd.
- Expiration time is in UTC instead of local time.

View File

@ -0,0 +1,18 @@
# Benchmarks
etcd benchmarks will be published regularly and tracked for each release below:
- [etcd v2.1.0-alpha][2.1]
- [etcd v2.2.0-rc][2.2]
- [etcd v3 demo][3.0]
# Memory Usage Benchmarks
It records expected memory usage in different scenarios.
- [etcd v2.2.0-rc][2.2-mem]
[2.1]: etcd-2-1-0-alpha-benchmarks.md
[2.2]: etcd-2-2-0-rc-benchmarks.md
[2.2-mem]: etcd-2-2-0-rc-memory-benchmarks.md
[3.0]: etcd-3-demo-benchmarks.md

View File

@ -0,0 +1,52 @@
## Physical machines
GCE n1-highcpu-2 machine type
- 1x dedicated local SSD mounted under /var/lib/etcd
- 1x dedicated slow disk for the OS
- 1.8 GB memory
- 2x CPUs
- etcd version 2.1.0 alpha
## etcd Cluster
3 etcd members, each runs on a single machine
## Testing
Bootstrap another machine and use the [boom HTTP benchmark tool][boom] to send requests to each etcd member. Check the [benchmark hacking guide][hack-benchmark] for detailed instructions.
## Performance
### reading one single key
| key size in bytes | number of clients | target etcd server | read QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|--------------------|----------|---------------|
| 64 | 1 | leader only | 1534 | 0.7 |
| 64 | 64 | leader only | 10125 | 9.1 |
| 64 | 256 | leader only | 13892 | 27.1 |
| 256 | 1 | leader only | 1530 | 0.8 |
| 256 | 64 | leader only | 10106 | 10.1 |
| 256 | 256 | leader only | 14667 | 27.0 |
| 64 | 64 | all servers | 24200 | 3.9 |
| 64 | 256 | all servers | 33300 | 11.8 |
| 256 | 64 | all servers | 24800 | 3.9 |
| 256 | 256 | all servers | 33000 | 11.5 |
### writing one single key
| key size in bytes | number of clients | target etcd server | write QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|--------------------|-----------|---------------|
| 64 | 1 | leader only | 60 | 21.4 |
| 64 | 64 | leader only | 1742 | 46.8 |
| 64 | 256 | leader only | 3982 | 90.5 |
| 256 | 1 | leader only | 58 | 20.3 |
| 256 | 64 | leader only | 1770 | 47.8 |
| 256 | 256 | leader only | 4157 | 105.3 |
| 64 | 64 | all servers | 1028 | 123.4 |
| 64 | 256 | all servers | 3260 | 123.8 |
| 256 | 64 | all servers | 1033 | 121.5 |
| 256 | 256 | all servers | 3061 | 119.3 |
[boom]: https://github.com/rakyll/boom
[hack-benchmark]: /hack/benchmark/

View File

@ -0,0 +1,69 @@
# Benchmarking etcd v2.2.0
## Physical Machines
GCE n1-highcpu-2 machine type
- 1x dedicated local SSD mounted as etcd data directory
- 1x dedicated slow disk for the OS
- 1.8 GB memory
- 2x CPUs
## etcd Cluster
3 etcd 2.2.0 members, each runs on a single machine.
Detailed versions:
```
etcd Version: 2.2.0
Git SHA: e4561dd
Go Version: go1.5
Go OS/Arch: linux/amd64
```
## Testing
Bootstrap another machine, outside of the etcd cluster, and run the [`boom` HTTP benchmark tool](https://github.com/rakyll/boom) with a connection reuse patch to send requests to each etcd cluster member. See the [benchmark instructions](../../hack/benchmark/) for the patch and the steps to reproduce our procedures.
The performance is calulated through results of 100 benchmark rounds.
## Performance
### Single Key Read Performance
| key size in bytes | number of clients | target etcd server | average read QPS | read QPS stddev | average 90th Percentile Latency (ms) | latency stddev |
|-------------------|-------------------|--------------------|------------------|-----------------|--------------------------------------|----------------|
| 64 | 1 | leader only | 2303 | 200 | 0.49 | 0.06 |
| 64 | 64 | leader only | 15048 | 685 | 7.60 | 0.46 |
| 64 | 256 | leader only | 14508 | 434 | 29.76 | 1.05 |
| 256 | 1 | leader only | 2162 | 214 | 0.52 | 0.06 |
| 256 | 64 | leader only | 14789 | 792 | 7.69| 0.48 |
| 256 | 256 | leader only | 14424 | 512 | 29.92 | 1.42 |
| 64 | 64 | all servers | 45752 | 2048 | 2.47 | 0.14 |
| 64 | 256 | all servers | 46592 | 1273 | 10.14 | 0.59 |
| 256 | 64 | all servers | 45332 | 1847 | 2.48| 0.12 |
| 256 | 256 | all servers | 46485 | 1340 | 10.18 | 0.74 |
### Single Key Write Performance
| key size in bytes | number of clients | target etcd server | average write QPS | write QPS stddev | average 90th Percentile Latency (ms) | latency stddev |
|-------------------|-------------------|--------------------|------------------|-----------------|--------------------------------------|----------------|
| 64 | 1 | leader only | 55 | 4 | 24.51 | 13.26 |
| 64 | 64 | leader only | 2139 | 125 | 35.23 | 3.40 |
| 64 | 256 | leader only | 4581 | 581 | 70.53 | 10.22 |
| 256 | 1 | leader only | 56 | 4 | 22.37| 4.33 |
| 256 | 64 | leader only | 2052 | 151 | 36.83 | 4.20 |
| 256 | 256 | leader only | 4442 | 560 | 71.59 | 10.03 |
| 64 | 64 | all servers | 1625 | 85 | 58.51 | 5.14 |
| 64 | 256 | all servers | 4461 | 298 | 89.47 | 36.48 |
| 256 | 64 | all servers | 1599 | 94 | 60.11| 6.43 |
| 256 | 256 | all servers | 4315 | 193 | 88.98 | 7.01 |
## Performance Changes
- Because etcd now records metrics for each API call, read QPS performance seems to see a minor decrease in most scenarios. This minimal performance impact was judged a reasonable investment for the breadth of monitoring and debugging information returned.
- Write QPS to cluster leaders seems to be increased by a small margin. This is because the main loop and entry apply loops were decoupled in the etcd raft logic, eliminating several blocks between them.
- Write QPS to all members seems to be increased by a significant margin, because followers now receive the latest commit index sooner, and commit proposals more quickly.

View File

@ -0,0 +1,72 @@
## Physical machines
GCE n1-highcpu-2 machine type
- 1x dedicated local SSD mounted under /var/lib/etcd
- 1x dedicated slow disk for the OS
- 1.8 GB memory
- 2x CPUs
## etcd Cluster
3 etcd 2.2.0-rc members, each runs on a single machine.
Detailed versions:
```
etcd Version: 2.2.0-alpha.1+git
Git SHA: 59a5a7e
Go Version: go1.4.2
Go OS/Arch: linux/amd64
```
Also, we use 3 etcd 2.1.0 alpha-stage members to form cluster to get base performance. etcd's commit head is at [c7146bd5][c7146bd5], which is the same as the one that we use in [etcd 2.1 benchmark][etcd-2.1-benchmark].
## Testing
Bootstrap another machine and use the [boom HTTP benchmark tool][boom] to send requests to each etcd member. Check the [benchmark hacking guide][hack-benchmark] for detailed instructions.
## Performance
### reading one single key
| key size in bytes | number of clients | target etcd server | read QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|--------------------|----------|---------------|
| 64 | 1 | leader only | 2804 (-5%) | 0.4 (+0%) |
| 64 | 64 | leader only | 17816 (+0%) | 5.7 (-6%) |
| 64 | 256 | leader only | 18667 (-6%) | 20.4 (+2%) |
| 256 | 1 | leader only | 2181 (-15%) | 0.5 (+25%) |
| 256 | 64 | leader only | 17435 (-7%) | 6.0 (+9%) |
| 256 | 256 | leader only | 18180 (-8%) | 21.3 (+3%) |
| 64 | 64 | all servers | 46965 (-4%) | 2.1 (+0%) |
| 64 | 256 | all servers | 55286 (-6%) | 7.4 (+6%) |
| 256 | 64 | all servers | 46603 (-6%) | 2.1 (+5%) |
| 256 | 256 | all servers | 55291 (-6%) | 7.3 (+4%) |
### writing one single key
| key size in bytes | number of clients | target etcd server | write QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|--------------------|-----------|---------------|
| 64 | 1 | leader only | 76 (+22%) | 19.4 (-15%) |
| 64 | 64 | leader only | 2461 (+45%) | 31.8 (-32%) |
| 64 | 256 | leader only | 4275 (+1%) | 69.6 (-10%) |
| 256 | 1 | leader only | 64 (+20%) | 16.7 (-30%) |
| 256 | 64 | leader only | 2385 (+30%) | 31.5 (-19%) |
| 256 | 256 | leader only | 4353 (-3%) | 74.0 (+9%) |
| 64 | 64 | all servers | 2005 (+81%) | 49.8 (-55%) |
| 64 | 256 | all servers | 4868 (+35%) | 81.5 (-40%) |
| 256 | 64 | all servers | 1925 (+72%) | 47.7 (-59%) |
| 256 | 256 | all servers | 4975 (+36%) | 70.3 (-36%) |
### performance changes explanation
- read QPS in most scenarios is decreased by 5~8%. The reason is that etcd records store metrics for each store operation. The metrics is important for monitoring and debugging, so this is acceptable.
- write QPS to leader is increased by 20~30%. This is because we decouple raft main loop and entry apply loop, which avoids them blocking each other.
- write QPS to all servers is increased by 30~80% because follower could receive latest commit index earlier and commit proposals faster.
[boom]: https://github.com/rakyll/boom
[c7146bd5]: https://github.com/coreos/etcd/commits/c7146bd5f2c73716091262edc638401bb8229144
[etcd-2.1-benchmark]: etcd-2-1-0-alpha-benchmarks.md
[hack-benchmark]: /hack/benchmark/

View File

@ -0,0 +1,47 @@
## Physical machine
GCE n1-standard-2 machine type
- 1x dedicated local SSD mounted under /var/lib/etcd
- 1x dedicated slow disk for the OS
- 7.5 GB memory
- 2x CPUs
## etcd
```
etcd Version: 2.2.0-rc.0+git
Git SHA: 103cb5c
Go Version: go1.5
Go OS/Arch: linux/amd64
```
## Testing
Start 3-member etcd cluster, each of which uses 2 cores.
The length of key name is always 64 bytes, which is a reasonable length of average key bytes.
## Memory Maximal Usage
- etcd may use maximal memory if one follower is dead and the leader keeps sending snapshots.
- `max RSS` is the maximal memory usage recorded in 3 runs.
| value bytes | key number | data size(MB) | max RSS(MB) | max RSS/data rate on leader |
|-------------|-------------|---------------|-------------|-----------------------------|
| 128 | 50000 | 6 | 433 | 72x |
| 128 | 100000 | 12 | 659 | 54x |
| 128 | 200000 | 24 | 1466 | 61x |
| 1024 | 50000 | 48 | 1253 | 26x |
| 1024 | 100000 | 96 | 2344 | 24x |
| 1024 | 200000 | 192 | 4361 | 22x |
## Data Size Threshold
- When etcd reaches data size threshold, it may trigger leader election easily and drop part of proposals.
- At most cases, etcd cluster should work smoothly if it doesn't hit the threshold. If it doesn't work well due to insufficient resources, you need to decrease its data size.
| value bytes | key number limitation | suggested data size threshold(MB) | consumed RSS(MB) |
|-------------|-----------------------|-----------------------------------|------------------|
| 128 | 400K | 48 | 2400 |
| 1024 | 300K | 292 | 6500 |

View File

@ -0,0 +1,42 @@
## Physical machines
GCE n1-highcpu-2 machine type
- 1x dedicated local SSD mounted under /var/lib/etcd
- 1x dedicated slow disk for the OS
- 1.8 GB memory
- 2x CPUs
- etcd version 2.2.0
## etcd Cluster
1 etcd member running in v3 demo mode
## Testing
Use [etcd v3 benchmark tool][etcd-v3-benchmark].
## Performance
### reading one single key
| key size in bytes | number of clients | read QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|----------|---------------|
| 256 | 1 | 2716 | 0.4 |
| 256 | 64 | 16623 | 6.1 |
| 256 | 256 | 16622 | 21.7 |
The performance is nearly the same as the one with empty server handler.
### reading one single key after putting
| key size in bytes | number of clients | read QPS | 90th Percentile Latency (ms) |
|-------------------|-------------------|----------|---------------|
| 256 | 1 | 2269 | 0.5 |
| 256 | 64 | 13582 | 8.6 |
| 256 | 256 | 13262 | 47.5 |
The performance with empty server handler is not affected by one put. So the
performance downgrade should be caused by storage package.
[etcd-v3-benchmark]: /tools/benchmark/

View File

@ -0,0 +1,77 @@
# Watch Memory Usage Benchmark
*NOTE*: The watch features are under active development, and their memory usage may change as that development progresses. We do not expect it to significantly increase beyond the figures stated below.
A primary goal of etcd is supporting a very large number of watchers doing a massively large amount of watching. etcd aims to support O(10k) clients, O(100K) watch streams (O(10) streams per client) and O(10M) total watchings (O(100) watching per stream). The memory consumed by each individual watching accounts for the largest portion of etcd's overall usage, and is therefore the focus of current and future optimizations.
Three related components of etcd watch consume physical memory: each `grpc.Conn`, each watch stream, and each instance of the watching activity. `grpc.Conn` maintains the actual TCP connection and other gRPC connection state. Each `grpc.Conn` consumes O(10kb) of memory, and might have multiple watch streams attached.
Each watch stream is an independent HTTP2 connection which consumes another O(10kb) of memory.
Multiple watchings might share one watch stream.
Watching is the actual struct that tracks the changes on the key-value store. Each watching should only consume < O(1kb).
```
+-------+
| watch |
+---------> | foo |
| +-------+
+------+-----+
| stream |
+--------------> | |
| +------+-----+ +-------+
| | | watch |
| +---------> | bar |
+-----+------+ +-------+
| | +------------+
| conn +-------> | stream |
| | | |
+-----+------+ +------------+
|
|
|
| +------------+
+--------------> | stream |
| |
+------------+
```
The theoretical memory consumption of watch can be approximated with the formula:
`memory = c1 * number_of_conn + c2 * avg_number_of_stream_per_conn + c3 * avg_number_of_watch_stream`
## Testing Environment
etcd version
- git head https://github.com/coreos/etcd/commit/185097ffaa627b909007e772c175e8fefac17af3
GCE n1-standard-2 machine type
- 7.5 GB memory
- 2x CPUs
## Overall memory usage
The overall memory usage captures how much [RSS][rss] etcd consumes with the client watchers. While the result may vary by as much as 10%, it is still meaningful, since the goal is to learn about the rough memory usage and the pattern of allocations.
With the benchmark result, we can calculate roughly that `c1 = 17kb`, `c2 = 18kb` and `c3 = 350bytes`. So each additional client connection consumes 17kb of memory and each additional stream consumes 18kb of memory, and each additional watching only cause 350bytes. A single etcd server can maintain millions of watchings with a few GB of memory in normal case.
| clients | streams per client | watchings per stream | total watching | memory usage |
|---------|---------|-----------|----------------|--------------|
| 1k | 1 | 1 | 1k | 50MB |
| 2k | 1 | 1 | 2k | 90MB |
| 5k | 1 | 1 | 5k | 200MB |
| 1k | 10 | 1 | 10k | 217MB |
| 2k | 10 | 1 | 20k | 417MB |
| 5k | 10 | 1 | 50k | 980MB |
| 1k | 50 | 1 | 50k | 1001MB |
| 2k | 50 | 1 | 100k | 1960MB |
| 5k | 50 | 1 | 250k | 4700MB |
| 1k | 50 | 10 | 500k | 1171MB |
| 2k | 50 | 10 | 1M | 2371MB |
| 5k | 50 | 10 | 2.5M | 5710MB |
| 1k | 50 | 100 | 5M | 2380MB |
| 2k | 50 | 100 | 10M | 4672MB |
| 5k | 50 | 100 | 50M | *OOM* |
[rss]: https://en.wikipedia.org/wiki/Resident_set_size

View File

@ -0,0 +1,98 @@
# Storage Memory Usage Benchmark
<!---todo: link storage to storage design doc-->
Two components of etcd storage consume physical memory. The etcd process allocates an *in-memory index* to speed key lookup. The process's *page cache*, managed by the operating system, stores recently-accessed data from disk for quick re-use.
The in-memory index holds all the keys in a [B-tree][btree] data structure, along with pointers to the on-disk data (the values). Each key in the B-tree may contain multiple pointers, pointing to different versions of its values. The theoretical memory consumption of the in-memory index can hence be approximated with the formula:
`N * (c1 + avg_key_size) + N * (avg_versions_of_key) * (c2 + size_of_pointer)`
where `c1` is the key metadata overhead and `c2` is the version metadata overhead.
The graph shows the detailed structure of the in-memory index B-tree.
```
In mem index
+------------+
| key || ... |
+--------------+ | || |
| | +------------+
| | | v1 || ... |
| disk <----------------| || | Tree Node
| | +------------+
| | | v2 || ... |
| <----------------+ || |
| | +------------+
+--------------+ +-----+ | | |
| | | | |
| +------------+
|
|
^
------+
| ... |
| |
+-----+
| ... | Tree Node
| |
+-----+
| ... |
| |
------+
```
[Page cache memory][pagecache] is managed by the operating system and is not covered in detail in this document.
## Testing Environment
etcd version
- git head https://github.com/coreos/etcd/commit/776e9fb7be7eee5e6b58ab977c8887b4fe4d48db
GCE n1-standard-2 machine type
- 7.5 GB memory
- 2x CPUs
## In-memory index memory usage
In this test, we only benchmark the memory usage of the in-memory index. The goal is to find `c1` and `c2` mentioned above and to understand the hard limit of memory consumption of the storage.
We calculate the memory usage consumption via the Go runtime.ReadMemStats. We calculate the total allocated bytes difference before creating the index and after creating the index. It cannot perfectly reflect the memory usage of the in-memory index itself but can show the rough consumption pattern.
| N | versions | key size | memory usage |
|------|----------|----------|--------------|
| 100K | 1 | 64bytes | 22MB |
| 100K | 5 | 64bytes | 39MB |
| 1M | 1 | 64bytes | 218MB |
| 1M | 5 | 64bytes | 432MB |
| 100K | 1 | 256bytes | 41MB |
| 100K | 5 | 256bytes | 65MB |
| 1M | 1 | 256bytes | 409MB |
| 1M | 5 | 256bytes | 506MB |
Based on the result, we can calculate `c1=120bytes`, `c2=30bytes`. We only need two sets of data to calculate `c1` and `c2`, since they are the only unknown variable in the formula. The `c1=120bytes` and `c2=30bytes` are the average value of the 4 sets of `c1` and `c2` we calculated. The key metadata overhead is still relatively nontrivial (50%) for small key-value pairs. However, this is a significant improvement over the old store, which had at least 1000% overhead.
## Overall memory usage
The overall memory usage captures how much RSS etcd consumes with the storage. The value size should have very little impact on the overall memory usage of etcd, since we keep values on disk and only retain hot values in memory, managed by the OS page cache.
| N | versions | key size | value size | memory usage |
|------|----------|----------|------------|--------------|
| 100K | 1 | 64bytes | 256bytes | 40MB |
| 100K | 5 | 64bytes | 256bytes | 89MB |
| 1M | 1 | 64bytes | 256bytes | 470MB |
| 1M | 5 | 64bytes | 256bytes | 880MB |
| 100K | 1 | 64bytes | 1KB | 102MB |
| 100K | 5 | 64bytes | 1KB | 164MB |
| 1M | 1 | 64bytes | 1KB | 587MB |
| 1M | 5 | 64bytes | 1KB | 836MB |
Based on the result, we know the value size does not significantly impact the memory consumption. There is some minor increase due to more data held in the OS page cache.
[btree]: https://en.wikipedia.org/wiki/B-tree
[pagecache]: https://en.wikipedia.org/wiki/Page_cache

View File

@ -0,0 +1,26 @@
# Branch Management
## Guide
* New development occurs on the [master branch][master].
* Master branch should always have a green build!
* Backwards-compatible bug fixes should target the master branch and subsequently be ported to stable branches.
* Once the master branch is ready for release, it will be tagged and become the new stable branch.
The etcd team has adopted a *rolling release model* and supports one stable version of etcd.
### Master branch
The `master` branch is our development branch. All new features land here first.
If you want to try new features, pull `master` and play with it. Note that `master` may not be stable because new features may introduce bugs.
Before the release of the next stable version, feature PRs will be frozen. We will focus on the testing, bug-fix and documentation for one to two weeks.
### Stable branches
All branches with prefix `release-` are considered _stable_ branches.
After every minor release (http://semver.org/), we will have a new stable branch for that release. We will keep fixing the backwards-compatible bugs for the latest stable release, but not previous releases. The _patch_ release, incorporating any bug fixes, will be once every two weeks, given any patches.
[master]: https://github.com/coreos/etcd/tree/master

View File

@ -0,0 +1,435 @@
# Clustering Guide
## Overview
Starting an etcd cluster statically requires that each member knows another in the cluster. In a number of cases, you might not know the IPs of your cluster members ahead of time. In these cases, you can bootstrap an etcd cluster with the help of a discovery service.
Once an etcd cluster is up and running, adding or removing members is done via [runtime reconfiguration][runtime-conf]. To better understand the design behind runtime reconfiguration, we suggest you read [the runtime configuration design document][runtime-reconf-design].
This guide will cover the following mechanisms for bootstrapping an etcd cluster:
* [Static](#static)
* [etcd Discovery](#etcd-discovery)
* [DNS Discovery](#dns-discovery)
Each of the bootstrapping mechanisms will be used to create a three machine etcd cluster with the following details:
|Name|Address|Hostname|
|------|---------|------------------|
|infra0|10.0.1.10|infra0.example.com|
|infra1|10.0.1.11|infra1.example.com|
|infra2|10.0.1.12|infra2.example.com|
## Static
As we know the cluster members, their addresses and the size of the cluster before starting, we can use an offline bootstrap configuration by setting the `initial-cluster` flag. Each machine will get either the following command line or environment variables:
```
ETCD_INITIAL_CLUSTER="infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380"
ETCD_INITIAL_CLUSTER_STATE=new
```
```
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state new
```
Note that the URLs specified in `initial-cluster` are the _advertised peer URLs_, i.e. they should match the value of `initial-advertise-peer-urls` on the respective nodes.
If you are spinning up multiple clusters (or creating and destroying a single cluster) with same configuration for testing purpose, it is highly recommended that you specify a unique `initial-cluster-token` for the different clusters. By doing this, etcd can generate unique cluster IDs and member IDs for the clusters even if they otherwise have the exact same configuration. This can protect you from cross-cluster-interaction, which might corrupt your clusters.
etcd listens on [`listen-client-urls`][conf-listen-client] to accept client traffic. etcd member advertises the URLs specified in [`advertise-client-urls`][conf-adv-client] to other members, proxies, clients. Please make sure the `advertise-client-urls` are reachable from intended clients. A common mistake is setting `advertise-client-urls` to localhost or leave it as default when you want the remote clients to reach etcd.
On each machine you would start etcd with these flags:
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state new
```
```
$ etcd --name infra1 --initial-advertise-peer-urls http://10.0.1.11:2380 \
--listen-peer-urls http://10.0.1.11:2380 \
--listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.11:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state new
```
```
$ etcd --name infra2 --initial-advertise-peer-urls http://10.0.1.12:2380 \
--listen-peer-urls http://10.0.1.12:2380 \
--listen-client-urls http://10.0.1.12:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.12:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state new
```
The command line parameters starting with `--initial-cluster` will be ignored on subsequent runs of etcd. You are free to remove the environment variables or command line flags after the initial bootstrap process. If you need to make changes to the configuration later (for example, adding or removing members to/from the cluster), see the [runtime configuration][runtime-conf] guide.
### Error Cases
In the following example, we have not included our new host in the list of enumerated nodes. If this is a new cluster, the node _must_ be added to the list of initial cluster members.
```
$ etcd --name infra1 --initial-advertise-peer-urls http://10.0.1.11:2380 \
--listen-peer-urls https://10.0.1.11:2380 \
--listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.11:2379 \
--initial-cluster infra0=http://10.0.1.10:2380 \
--initial-cluster-state new
etcd: infra1 not listed in the initial cluster config
exit 1
```
In this example, we are attempting to map a node (infra0) on a different address (127.0.0.1:2380) than its enumerated address in the cluster list (10.0.1.10:2380). If this node is to listen on multiple addresses, all addresses _must_ be reflected in the "initial-cluster" configuration directive.
```
$ etcd --name infra0 --initial-advertise-peer-urls http://127.0.0.1:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
--initial-cluster-state=new
etcd: error setting up initial cluster: infra0 has different advertised URLs in the cluster and advertised peer URLs list
exit 1
```
If you configure a peer with a different set of configuration and attempt to join this cluster you will get a cluster ID mismatch and etcd will exit.
```
$ etcd --name infra3 --initial-advertise-peer-urls http://10.0.1.13:2380 \
--listen-peer-urls http://10.0.1.13:2380 \
--listen-client-urls http://10.0.1.13:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.13:2379 \
--initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra3=http://10.0.1.13:2380 \
--initial-cluster-state=new
etcd: conflicting cluster ID to the target cluster (c6ab534d07e8fcc4 != bc25ea2a74fb18b0). Exiting.
exit 1
```
## Discovery
In a number of cases, you might not know the IPs of your cluster peers ahead of time. This is common when utilizing cloud providers or when your network uses DHCP. In these cases, rather than specifying a static configuration, you can use an existing etcd cluster to bootstrap a new one. We call this process "discovery".
There two methods that can be used for discovery:
* etcd discovery service
* DNS SRV records
### etcd Discovery
To better understand the design about discovery service protocol, we suggest you read [this][discovery-proto].
#### Lifetime of a Discovery URL
A discovery URL identifies a unique etcd cluster. Instead of reusing a discovery URL, you should always create discovery URLs for new clusters.
Moreover, discovery URLs should ONLY be used for the initial bootstrapping of a cluster. To change cluster membership after the cluster is already running, see the [runtime reconfiguration][runtime-conf] guide.
#### Custom etcd Discovery Service
Discovery uses an existing cluster to bootstrap itself. If you are using your own etcd cluster you can create a URL like so:
```
$ curl -X PUT https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83/_config/size -d value=3
```
By setting the size key to the URL, you create a discovery URL with an expected cluster size of 3.
If you bootstrap an etcd cluster using discovery service with more than the expected number of etcd members, the extra etcd processes will [fall back][fall-back] to being [proxies][proxy] by default.
The URL you will use in this case will be `https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83` and the etcd members will use the `https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83` directory for registration as they start.
**Each member must have a different name flag specified. `Hostname` or `machine-id` can be a good choice. Or discovery will fail due to duplicated name.**
Now we start etcd with those relevant flags for each member:
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83
```
```
$ etcd --name infra1 --initial-advertise-peer-urls http://10.0.1.11:2380 \
--listen-peer-urls http://10.0.1.11:2380 \
--listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.11:2379 \
--discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83
```
```
$ etcd --name infra2 --initial-advertise-peer-urls http://10.0.1.12:2380 \
--listen-peer-urls http://10.0.1.12:2380 \
--listen-client-urls http://10.0.1.12:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.12:2379 \
--discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83
```
This will cause each member to register itself with the custom etcd discovery service and begin the cluster once all machines have been registered.
#### Public etcd Discovery Service
If you do not have access to an existing cluster, you can use the public discovery service hosted at `discovery.etcd.io`. You can create a private discovery URL using the "new" endpoint like so:
```
$ curl https://discovery.etcd.io/new?size=3
https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
This will create the cluster with an initial expected size of 3 members. If you do not specify a size, a default of 3 will be used.
If you bootstrap an etcd cluster using discovery service with more than the expected number of etcd members, the extra etcd processes will [fall back][fall-back] to being [proxies][proxy] by default.
```
ETCD_DISCOVERY=https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
```
-discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
**Each member must have a different name flag specified. `Hostname` or `machine-id` can be a good choice. Or discovery will fail due to duplicated name.**
Now we start etcd with those relevant flags for each member:
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
```
$ etcd --name infra1 --initial-advertise-peer-urls http://10.0.1.11:2380 \
--listen-peer-urls http://10.0.1.11:2380 \
--listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.11:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
```
$ etcd --name infra2 --initial-advertise-peer-urls http://10.0.1.12:2380 \
--listen-peer-urls http://10.0.1.12:2380 \
--listen-client-urls http://10.0.1.12:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.12:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
```
This will cause each member to register itself with the discovery service and begin the cluster once all members have been registered.
You can use the environment variable `ETCD_DISCOVERY_PROXY` to cause etcd to use an HTTP proxy to connect to the discovery service.
#### Error and Warning Cases
##### Discovery Server Errors
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
etcd: error: the cluster doesnt have a size configuration value in https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de/_config
exit 1
```
##### User Errors
This error will occur if the discovery cluster already has the configured number of members, and `discovery-fallback` is explicitly disabled
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de \
--discovery-fallback exit
etcd: discovery: cluster is full
exit 1
```
##### Warnings
This is a harmless warning notifying you that the discovery URL will be
ignored on this machine.
```
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380 \
--listen-peer-urls http://10.0.1.10:2380 \
--listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://10.0.1.10:2379 \
--discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de
etcdserver: discovery token ignored since a cluster has already been initialized. Valid log found at /var/lib/etcd
```
### DNS Discovery
DNS [SRV records][rfc-srv] can be used as a discovery mechanism.
The `-discovery-srv` flag can be used to set the DNS domain name where the discovery SRV records can be found.
The following DNS SRV records are looked up in the listed order:
* _etcd-server-ssl._tcp.example.com
* _etcd-server._tcp.example.com
If `_etcd-server-ssl._tcp.example.com` is found then etcd will attempt the bootstrapping process over SSL.
To help clients discover the etcd cluster, the following DNS SRV records are looked up in the listed order:
* _etcd-client._tcp.example.com
* _etcd-client-ssl._tcp.example.com
If `_etcd-client-ssl._tcp.example.com` is found, clients will attempt to communicate with the etcd cluster over SSL.
#### Create DNS SRV records
```
$ dig +noall +answer SRV _etcd-server._tcp.example.com
_etcd-server._tcp.example.com. 300 IN SRV 0 0 2380 infra0.example.com.
_etcd-server._tcp.example.com. 300 IN SRV 0 0 2380 infra1.example.com.
_etcd-server._tcp.example.com. 300 IN SRV 0 0 2380 infra2.example.com.
```
```
$ dig +noall +answer SRV _etcd-client._tcp.example.com
_etcd-client._tcp.example.com. 300 IN SRV 0 0 2379 infra0.example.com.
_etcd-client._tcp.example.com. 300 IN SRV 0 0 2379 infra1.example.com.
_etcd-client._tcp.example.com. 300 IN SRV 0 0 2379 infra2.example.com.
```
```
$ dig +noall +answer infra0.example.com infra1.example.com infra2.example.com
infra0.example.com. 300 IN A 10.0.1.10
infra1.example.com. 300 IN A 10.0.1.11
infra2.example.com. 300 IN A 10.0.1.12
```
#### Bootstrap the etcd cluster using DNS
etcd cluster members can listen on domain names or IP address, the bootstrap process will resolve DNS A records.
The resolved address in `--initial-advertise-peer-urls` *must match* one of the resolved addresses in the SRV targets. The etcd member reads the resolved address to find out if it belongs to the cluster defined in the SRV records.
```
$ etcd --name infra0 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://infra0.example.com:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://infra0.example.com:2379 \
--listen-client-urls http://infra0.example.com:2379 \
--listen-peer-urls http://infra0.example.com:2380
```
```
$ etcd --name infra1 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://infra1.example.com:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://infra1.example.com:2379 \
--listen-client-urls http://infra1.example.com:2379 \
--listen-peer-urls http://infra1.example.com:2380
```
```
$ etcd --name infra2 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://infra2.example.com:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://infra2.example.com:2379 \
--listen-client-urls http://infra2.example.com:2379 \
--listen-peer-urls http://infra2.example.com:2380
```
You can also bootstrap the cluster using IP addresses instead of domain names:
```
$ etcd --name infra0 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://10.0.1.10:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://10.0.1.10:2379 \
--listen-client-urls http://10.0.1.10:2379 \
--listen-peer-urls http://10.0.1.10:2380
```
```
$ etcd --name infra1 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://10.0.1.11:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://10.0.1.11:2379 \
--listen-client-urls http://10.0.1.11:2379 \
--listen-peer-urls http://10.0.1.11:2380
```
```
$ etcd --name infra2 \
--discovery-srv example.com \
--initial-advertise-peer-urls http://10.0.1.12:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://10.0.1.12:2379 \
--listen-client-urls http://10.0.1.12:2379 \
--listen-peer-urls http://10.0.1.12:2380
```
#### etcd proxy configuration
DNS SRV records can also be used to configure the list of peers for an etcd server running in proxy mode:
```
$ etcd --proxy on --discovery-srv example.com
```
#### etcd client configuration
DNS SRV records can also be used to help clients discover the etcd cluster.
The official [etcd/client][client] supports [DNS Discovery][client-discoverer].
`etcdctl` also supports DNS Discovery by specifying the `--discovery-srv` option.
```
$ etcdctl --discovery-srv example.com set foo bar
```
#### Error Cases
You might see an error like `cannot find local etcd $name from SRV records.`. That means the etcd member fails to find itself from the cluster defined in SRV records. The resolved address in `--initial-advertise-peer-urls` *must match* one of the resolved addresses in the SRV targets.
# 0.4 to 2.0+ Migration Guide
In etcd 2.0 we introduced the ability to listen on more than one address and to advertise multiple addresses. This makes using etcd easier when you have complex networking, such as private and public networks on various cloud providers.
To make understanding this feature easier, we changed the naming of some flags, but we support the old flags to make the migration from the old to new version easier.
|Old Flag |New Flag |Migration Behavior |
|-----------------------|-----------------------|---------------------------------------------------------------------------------------|
|-peer-addr |--initial-advertise-peer-urls |If specified, peer-addr will be used as the only peer URL. Error if both flags specified.|
|-addr |--advertise-client-urls |If specified, addr will be used as the only client URL. Error if both flags specified.|
|-peer-bind-addr |--listen-peer-urls |If specified, peer-bind-addr will be used as the only peer bind URL. Error if both flags specified.|
|-bind-addr |--listen-client-urls |If specified, bind-addr will be used as the only client bind URL. Error if both flags specified.|
|-peers |none |Deprecated. The --initial-cluster flag provides a similar concept with different semantics. Please read this guide on cluster startup.|
|-peers-file |none |Deprecated. The --initial-cluster flag provides a similar concept with different semantics. Please read this guide on cluster startup.|
[client]: /client
[client-discoverer]: https://godoc.org/github.com/coreos/etcd/client#Discoverer
[conf-adv-client]: configuration.md#-advertise-client-urls
[conf-listen-client]: configuration.md#-listen-client-urls
[discovery-proto]: discovery_protocol.md
[fall-back]: proxy.md#fallback-to-proxy-mode-with-discovery-service
[proxy]: proxy.md
[rfc-srv]: http://www.ietf.org/rfc/rfc2052.txt
[runtime-conf]: runtime-configuration.md
[runtime-reconf-design]: runtime-reconf-design.md

View File

@ -0,0 +1,282 @@
# Configuration Flags
etcd is configurable through command-line flags and environment variables. Options set on the command line take precedence over those from the environment.
The format of environment variable for flag `--my-flag` is `ETCD_MY_FLAG`. It applies to all flags.
The [official etcd ports][iana-ports] are 2379 for client requests, and 2380 for peer communication. Some legacy code and documentation still references ports 4001 and 7001, but all new etcd use and discussion should adopt the assigned ports.
To start etcd automatically using custom settings at startup in Linux, using a [systemd][systemd-intro] unit is highly recommended.
[systemd-intro]: http://freedesktop.org/wiki/Software/systemd/
## Member Flags
### --name
+ Human-readable name for this member.
+ default: "default"
+ env variable: ETCD_NAME
+ This value is referenced as this node's own entries listed in the `--initial-cluster` flag (Ex: `default=http://localhost:2380` or `default=http://localhost:2380,default=http://localhost:7001`). This needs to match the key used in the flag if you're using [static bootstrapping][build-cluster]. When using discovery, each member must have a unique name. `Hostname` or `machine-id` can be a good choice.
### --data-dir
+ Path to the data directory.
+ default: "${name}.etcd"
+ env variable: ETCD_DATA_DIR
### --wal-dir
+ Path to the dedicated wal directory. If this flag is set, etcd will write the WAL files to the walDir rather than the dataDir. This allows a dedicated disk to be used, and helps avoid io competition between logging and other IO operations.
+ default: ""
+ env variable: ETCD_WAL_DIR
### --snapshot-count
+ Number of committed transactions to trigger a snapshot to disk.
+ default: "10000"
+ env variable: ETCD_SNAPSHOT_COUNT
### --heartbeat-interval
+ Time (in milliseconds) of a heartbeat interval.
+ default: "100"
+ env variable: ETCD_HEARTBEAT_INTERVAL
### --election-timeout
+ Time (in milliseconds) for an election to timeout. See [tuning.md](tuning.md#time-parameters) for details.
+ default: "1000"
+ env variable: ETCD_ELECTION_TIMEOUT
### --listen-peer-urls
+ List of URLs to listen on for peer traffic. This flag tells the etcd to accept incoming requests from its peers on the specified scheme://IP:port combinations. Scheme can be either http or https.If 0.0.0.0 is specified as the IP, etcd listens to the given port on all interfaces. If an IP address is given as well as a port, etcd will listen on the given port and interface. Multiple URLs may be used to specify a number of addresses and ports to listen on. The etcd will respond to requests from any of the listed addresses and ports.
+ default: "http://localhost:2380,http://localhost:7001"
+ env variable: ETCD_LISTEN_PEER_URLS
+ example: "http://10.0.0.1:2380"
+ invalid example: "http://example.com:2380" (domain name is invalid for binding)
### --listen-client-urls
+ List of URLs to listen on for client traffic. This flag tells the etcd to accept incoming requests from the clients on the specified scheme://IP:port combinations. Scheme can be either http or https. If 0.0.0.0 is specified as the IP, etcd listens to the given port on all interfaces. If an IP address is given as well as a port, etcd will listen on the given port and interface. Multiple URLs may be used to specify a number of addresses and ports to listen on. The etcd will respond to requests from any of the listed addresses and ports.
+ default: "http://localhost:2379,http://localhost:4001"
+ env variable: ETCD_LISTEN_CLIENT_URLS
+ example: "http://10.0.0.1:2379"
+ invalid example: "http://example.com:2379" (domain name is invalid for binding)
### --max-snapshots
+ Maximum number of snapshot files to retain (0 is unlimited)
+ default: 5
+ env variable: ETCD_MAX_SNAPSHOTS
+ The default for users on Windows is unlimited, and manual purging down to 5 (or your preference for safety) is recommended.
### --max-wals
+ Maximum number of wal files to retain (0 is unlimited)
+ default: 5
+ env variable: ETCD_MAX_WALS
+ The default for users on Windows is unlimited, and manual purging down to 5 (or your preference for safety) is recommended.
### --cors
+ Comma-separated white list of origins for CORS (cross-origin resource sharing).
+ default: none
+ env variable: ETCD_CORS
## Clustering Flags
`--initial` prefix flags are used in bootstrapping ([static bootstrap][build-cluster], [discovery-service bootstrap][discovery] or [runtime reconfiguration][reconfig]) a new member, and ignored when restarting an existing member.
`--discovery` prefix flags need to be set when using [discovery service][discovery].
### --initial-advertise-peer-urls
+ List of this member's peer URLs to advertise to the rest of the cluster. These addresses are used for communicating etcd data around the cluster. At least one must be routable to all cluster members. These URLs can contain domain names.
+ default: "http://localhost:2380,http://localhost:7001"
+ env variable: ETCD_INITIAL_ADVERTISE_PEER_URLS
+ example: "http://example.com:2380, http://10.0.0.1:2380"
### --initial-cluster
+ Initial cluster configuration for bootstrapping.
+ default: "default=http://localhost:2380,default=http://localhost:7001"
+ env variable: ETCD_INITIAL_CLUSTER
+ The key is the value of the `--name` flag for each node provided. The default uses `default` for the key because this is the default for the `--name` flag.
### --initial-cluster-state
+ Initial cluster state ("new" or "existing"). Set to `new` for all members present during initial static or DNS bootstrapping. If this option is set to `existing`, etcd will attempt to join the existing cluster. If the wrong value is set, etcd will attempt to start but fail safely.
+ default: "new"
+ env variable: ETCD_INITIAL_CLUSTER_STATE
[static bootstrap]: clustering.md#static
### --initial-cluster-token
+ Initial cluster token for the etcd cluster during bootstrap.
+ default: "etcd-cluster"
+ env variable: ETCD_INITIAL_CLUSTER_TOKEN
### --advertise-client-urls
+ List of this member's client URLs to advertise to the rest of the cluster. These URLs can contain domain names.
+ default: "http://localhost:2379,http://localhost:4001"
+ env variable: ETCD_ADVERTISE_CLIENT_URLS
+ example: "http://example.com:2379, http://10.0.0.1:2379"
+ Be careful if you are advertising URLs such as http://localhost:2379 from a cluster member and are using the proxy feature of etcd. This will cause loops, because the proxy will be forwarding requests to itself until its resources (memory, file descriptors) are eventually depleted.
### --discovery
+ Discovery URL used to bootstrap the cluster.
+ default: none
+ env variable: ETCD_DISCOVERY
### --discovery-srv
+ DNS srv domain used to bootstrap the cluster.
+ default: none
+ env variable: ETCD_DISCOVERY_SRV
### --discovery-fallback
+ Expected behavior ("exit" or "proxy") when discovery services fails.
+ default: "proxy"
+ env variable: ETCD_DISCOVERY_FALLBACK
### --discovery-proxy
+ HTTP proxy to use for traffic to discovery service.
+ default: none
+ env variable: ETCD_DISCOVERY_PROXY
### --strict-reconfig-check
+ Reject reconfiguration requests that would cause quorum loss.
+ default: false
+ env variable: ETCD_STRICT_RECONFIG_CHECK
## Proxy Flags
`--proxy` prefix flags configures etcd to run in [proxy mode][proxy].
### --proxy
+ Proxy mode setting ("off", "readonly" or "on").
+ default: "off"
+ env variable: ETCD_PROXY
### --proxy-failure-wait
+ Time (in milliseconds) an endpoint will be held in a failed state before being reconsidered for proxied requests.
+ default: 5000
+ env variable: ETCD_PROXY_FAILURE_WAIT
### --proxy-refresh-interval
+ Time (in milliseconds) of the endpoints refresh interval.
+ default: 30000
+ env variable: ETCD_PROXY_REFRESH_INTERVAL
### --proxy-dial-timeout
+ Time (in milliseconds) for a dial to timeout or 0 to disable the timeout
+ default: 1000
+ env variable: ETCD_PROXY_DIAL_TIMEOUT
### --proxy-write-timeout
+ Time (in milliseconds) for a write to timeout or 0 to disable the timeout.
+ default: 5000
+ env variable: ETCD_PROXY_WRITE_TIMEOUT
### --proxy-read-timeout
+ Time (in milliseconds) for a read to timeout or 0 to disable the timeout.
+ Don't change this value if you use watches because they are using long polling requests.
+ default: 0
+ env variable: ETCD_PROXY_READ_TIMEOUT
## Security Flags
The security flags help to [build a secure etcd cluster][security].
### --ca-file [DEPRECATED]
+ Path to the client server TLS CA file. `--ca-file ca.crt` could be replaced by `--trusted-ca-file ca.crt --client-cert-auth` and etcd will perform the same.
+ default: none
+ env variable: ETCD_CA_FILE
### --cert-file
+ Path to the client server TLS cert file.
+ default: none
+ env variable: ETCD_CERT_FILE
### --key-file
+ Path to the client server TLS key file.
+ default: none
+ env variable: ETCD_KEY_FILE
### --client-cert-auth
+ Enable client cert authentication.
+ default: false
+ env variable: ETCD_CLIENT_CERT_AUTH
### --trusted-ca-file
+ Path to the client server TLS trusted CA key file.
+ default: none
+ env variable: ETCD_TRUSTED_CA_FILE
### --peer-ca-file [DEPRECATED]
+ Path to the peer server TLS CA file. `--peer-ca-file ca.crt` could be replaced by `--peer-trusted-ca-file ca.crt --peer-client-cert-auth` and etcd will perform the same.
+ default: none
+ env variable: ETCD_PEER_CA_FILE
### --peer-cert-file
+ Path to the peer server TLS cert file.
+ default: none
+ env variable: ETCD_PEER_CERT_FILE
### --peer-key-file
+ Path to the peer server TLS key file.
+ default: none
+ env variable: ETCD_PEER_KEY_FILE
### --peer-client-cert-auth
+ Enable peer client cert authentication.
+ default: false
+ env variable: ETCD_PEER_CLIENT_CERT_AUTH
### --peer-trusted-ca-file
+ Path to the peer server TLS trusted CA file.
+ default: none
+ env variable: ETCD_PEER_TRUSTED_CA_FILE
## Logging Flags
### --debug
+ Drop the default log level to DEBUG for all subpackages.
+ default: false (INFO for all packages)
+ env variable: ETCD_DEBUG
### --log-package-levels
+ Set individual etcd subpackages to specific log levels. An example being `etcdserver=WARNING,security=DEBUG`
+ default: none (INFO for all packages)
+ env variable: ETCD_LOG_PACKAGE_LEVELS
## Unsafe Flags
Please be CAUTIOUS when using unsafe flags because it will break the guarantees given by the consensus protocol.
For example, it may panic if other members in the cluster are still alive.
Follow the instructions when using these flags.
### --force-new-cluster
+ Force to create a new one-member cluster. It commits configuration changes forcing to remove all existing members in the cluster and add itself. It needs to be set to [restore a backup][restore].
+ default: false
+ env variable: ETCD_FORCE_NEW_CLUSTER
## Experimental Flags
### --experimental-v3demo
+ Enable experimental [v3 demo API][rfc-v3].
+ default: false
+ env variable: ETCD_EXPERIMENTAL_V3DEMO
## Miscellaneous Flags
### --version
+ Print the version and exit.
+ default: false
## Profiling flags
### --enable-pprof
+ Enable runtime profiling data via HTTP server. Address is at client URL + "/debug/pprof/"
+ default: false
[build-cluster]: clustering.md#static
[reconfig]: runtime-configuration.md
[discovery]: clustering.md#discovery
[iana-ports]: https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=etcd
[proxy]: proxy.md
[reconfig]: runtime-configuration.md
[restore]: admin_guide.md#restoring-a-backup
[rfc-v3]: rfc/v3api.md
[security]: security.md
[systemd-intro]: http://freedesktop.org/wiki/Software/systemd/
[tuning]: tuning.md#time-parameters

View File

@ -0,0 +1,109 @@
# etcd release guide
The guide talks about how to release a new version of etcd.
The procedure includes some manual steps for sanity checking but it can probably be further scripted. Please keep this document up-to-date if you want to make changes to the release process.
## Prepare Release
Set desired version as environment variable for following steps. Here is an example to release 2.1.3:
```
export VERSION=v2.1.3
export PREV_VERSION=v2.1.2
```
All releases version numbers follow the format of [semantic versioning 2.0.0](http://semver.org/).
### Major, Minor Version Release, or its Pre-release
- Ensure the relevant milestone on GitHub is complete. All referenced issues should be closed, or moved elsewhere.
- Remove this release from [roadmap](https://github.com/coreos/etcd/blob/master/ROADMAP.md), if necessary.
- Ensure the latest upgrade documentation is available.
- Bump [hardcoded MinClusterVerion in the repository](https://github.com/coreos/etcd/blob/master/version/version.go#L29), if necessary.
- Add feature capability maps for the new version, if necessary.
### Patch Version Release
- Discuss about commits that are backported to the patch release. The commits should not include merge commits.
- Cherry-pick these commits starting from the oldest one into stable branch.
## Write Release Note
- Write introduction for the new release. For example, what major bug we fix, what new features we introduce or what performance improvement we make.
- Write changelog for the last release. ChangeLog should be straightforward and easy to understand for the end-user.
- Put `[GH XXXX]` at the head of change line to reference Pull Request that introduces the change. Moreover, add a link on it to jump to the Pull Request.
## Tag Version
- Bump [hardcoded Version in the repository](https://github.com/coreos/etcd/blob/master/version/version.go#L30) to the latest version `${VERSION}`.
- Ensure all tests on CI system are passed.
- Manually check etcd is buildable in Linux, Darwin and Windows.
- Manually check upgrade etcd cluster of previous minor version works well.
- Manually check new features work well.
- Add a signed tag through `git tag -s ${VERSION}`.
- Sanity check tag correctness through `git show tags/$VERSION`.
- Push the tag to GitHub through `git push origin tags/$VERSION`. This assumes `origin` corresponds to "https://github.com/coreos/etcd".
## Build Release Binaries and Images
- Ensure `acbuild` is available.
- Ensure `docker` is available.
Run release script in root directory:
```
./scripts/release.sh ${VERSION}
```
It generates all release binaries and images under directory ./release.
## Sign Binaries and Images
Choose appropriate private key to sign the generated binaries and images.
The following commands are used for public release sign:
```
cd release
# personal GPG is okay for now
for i in etcd-*{.zip,.tar.gz}; do gpg --sign ${i}; done
# use `CoreOS ACI Builder <release@coreos.com>` secret key
gpg -u 88182190 -a --output etcd-${VERSION}-linux-amd64.aci.asc --detach-sig etcd-${VERSION}-linux-amd64.aci
```
## Publish Release Page in GitHub
- Set release title as the version name.
- Follow the format of previous release pages.
- Attach the generated binaries, aci image and signatures.
- Select whether it is a pre-release.
- Publish the release!
## Publish Docker Image in Quay.io
- Push docker image:
```
docker login quay.io
docker push quay.io/coreos/etcd:${VERSION}
```
- Add `latest` tag to the new image on [quay.io](https://quay.io/repository/coreos/etcd?tag=latest&tab=tags) if this is a stable release.
## Announce to etcd-dev Googlegroup
- Follow the format of [previous release emails](https://groups.google.com/forum/#!forum/etcd-dev).
- Make sure to include a list of authors that contributed since the previous release - something like the following might be handy:
```
git log ...${PREV_VERSION} --pretty=format:"%an" | sort | uniq | tr '\n' ',' | sed -e 's#,#, #g' -e 's#, $##'
```
- Send email to etcd-dev@googlegroups.com
## Post Release
- Create new stable branch through `git push origin ${VERSION_MAJOR}.${VERSION_MINOR}` if this is a major stable release. This assumes `origin` corresponds to "https://github.com/coreos/etcd".
- Bump [hardcoded Version in the repository](https://github.com/coreos/etcd/blob/master/version/version.go#L30) to the version `${VERSION}+git`.

View File

@ -0,0 +1,114 @@
# Discovery Service Protocol
Discovery service protocol helps new etcd member to discover all other members in cluster bootstrap phase using a shared discovery URL.
Discovery service protocol is _only_ used in cluster bootstrap phase, and cannot be used for runtime reconfiguration or cluster monitoring.
The protocol uses a new discovery token to bootstrap one _unique_ etcd cluster. Remember that one discovery token can represent only one etcd cluster. As long as discovery protocol on this token starts, even if it fails halfway, it must not be used to bootstrap another etcd cluster.
The rest of this article will walk through the discovery process with examples that correspond to a self-hosted discovery cluster. The public discovery service, discovery.etcd.io, functions the same way, but with a layer of polish to abstract away ugly URLs, generate UUIDs automatically, and provide some protections against excessive requests. At its core, the public discovery service still uses an etcd cluster as the data store as described in this document.
## The Protocol Workflow
The idea of discovery protocol is to use an internal etcd cluster to coordinate bootstrap of a new cluster. First, all new members interact with discovery service and help to generate the expected member list. Then each new member bootstraps its server using this list, which performs the same functionality as -initial-cluster flag.
In the following example workflow, we will list each step of protocol in curl format for ease of understanding.
By convention the etcd discovery protocol uses the key prefix `_etcd/registry`. If `http://example.com` hosts an etcd cluster for discovery service, a full URL to discovery keyspace will be `http://example.com/v2/keys/_etcd/registry`. We will use this as the URL prefix in the example.
### Creating a New Discovery Token
Generate a unique token that will identify the new cluster. This will be used as a unique prefix in discovery keyspace in the following steps. An easy way to do this is to use `uuidgen`:
```
UUID=$(uuidgen)
```
### Specifying the Expected Cluster Size
You need to specify the expected cluster size for this discovery token. The size is used by the discovery service to know when it has found all members that will initially form the cluster.
```
curl -X PUT http://example.com/v2/keys/_etcd/registry/${UUID}/_config/size -d value=${cluster_size}
```
Usually the cluster size is 3, 5 or 7. Check [optimal cluster size][cluster-size] for more details.
### Bringing up etcd Processes
Now that you have your discovery URL, you can use it as `-discovery` flag and bring up etcd processes. Every etcd process will follow this next few steps internally if given a `-discovery` flag.
### Registering itself
The first thing for etcd process is to register itself into the discovery URL as a member. This is done by creating member ID as a key in the discovery URL.
```
curl -X PUT http://example.com/v2/keys/_etcd/registry/${UUID}/${member_id}?prevExist=false -d value="${member_name}=${member_peer_url_1}&${member_name}=${member_peer_url_2}"
```
### Checking the Status
It checks the expected cluster size and registration status in discovery URL, and decides what the next action is.
```
curl -X GET http://example.com/v2/keys/_etcd/registry/${UUID}/_config/size
curl -X GET http://example.com/v2/keys/_etcd/registry/${UUID}
```
If registered members are still not enough, it will wait for left members to appear.
If the number of registered members is bigger than the expected size N, it treats the first N registered members as the member list for the cluster. If the member itself is in the member list, the discovery procedure succeeds and it fetches all peers through the member list. If it is not in the member list, the discovery procedure finishes with the failure that the cluster has been full.
In etcd implementation, the member may check the cluster status even before registering itself. So it could fail quickly if the cluster has been full.
### Waiting for All Members
The wait process is described in detail in the [etcd API documentation][api].
```
curl -X GET http://example.com/v2/keys/_etcd/registry/${UUID}?wait=true&waitIndex=${current_etcd_index}
```
It keeps waiting until finding all members.
## Public Discovery Service
CoreOS Inc. hosts a public discovery service at https://discovery.etcd.io/ , which provides some nice features for ease of use.
### Mask Key Prefix
Public discovery service will redirect `https://discovery.etcd.io/${UUID}` to etcd cluster behind for the key at `/v2/keys/_etcd/registry`. It masks register key prefix for short and readable discovery url.
### Get new token
```
GET /new
Sent query:
size=${cluster_size}
Possible status codes:
200 OK
400 Bad Request
200 Body:
generated discovery url
```
The generation process in the service follows the steps from [Creating a New Discovery Token][new-discovery-token] to [Specifying the Expected Cluster Size][expected-cluster-size].
### Check Discovery Status
```
GET /${UUID}
```
You can check the status for this discovery token, including the machines that have been registered, by requesting the value of the UUID.
### Open-source repository
The repository is located at https://github.com/coreos/discovery.etcd.io. You could use it to build your own public discovery service.
[api]: api.md#waiting-for-a-change
[cluster-size]: admin_guide.md#optimal-cluster-size
[expected-cluster-size]: #specifying-the-expected-cluster-size
[new-discovery-token]: #creating-a-new-discovery-token

View File

@ -0,0 +1,94 @@
# Running etcd under Docker
The following guide will show you how to run etcd under Docker using the [static bootstrap process](clustering.md#static).
## Running etcd in standalone mode
In order to expose the etcd API to clients outside of the Docker host you'll need use the host IP address when configuring etcd.
```
export HostIP="192.168.12.50"
```
The following `docker run` command will expose the etcd client API over ports 4001 and 2379, and expose the peer port over 2380.
This will run the latest release version of etcd. You can specify version if needed (e.g. `quay.io/coreos/etcd:v2.2.0`).
```
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
--name etcd quay.io/coreos/etcd \
-name etcd0 \
-advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://${HostIP}:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://${HostIP}:2380 \
-initial-cluster-state new
```
Configure etcd clients to use the Docker host IP and one of the listening ports from above.
```
etcdctl -C http://192.168.12.50:2379 member list
```
```
etcdctl -C http://192.168.12.50:4001 member list
```
## Running a 3 node etcd cluster
Using Docker to setup a multi-node cluster is very similar to the standalone mode configuration.
The main difference being the value used for the `-initial-cluster` flag, which must contain the peer urls for each etcd member in the cluster.
### etcd0
```
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
--name etcd quay.io/coreos/etcd \
-name etcd0 \
-advertise-client-urls http://192.168.12.50:2379,http://192.168.12.50:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://192.168.12.50:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 \
-initial-cluster-state new
```
### etcd1
```
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
--name etcd quay.io/coreos/etcd \
-name etcd1 \
-advertise-client-urls http://192.168.12.51:2379,http://192.168.12.51:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://192.168.12.51:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 \
-initial-cluster-state new
```
### etcd2
```
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
--name etcd quay.io/coreos/etcd \
-name etcd2 \
-advertise-client-urls http://192.168.12.52:2379,http://192.168.12.52:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://192.168.12.52:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 \
-initial-cluster-state new
```
Once the cluster has been bootstrapped etcd clients can be configured with a list of etcd members:
```
etcdctl -C http://192.168.12.50:2379,http://192.168.12.51:2379,http://192.168.12.52:2379 member list
```

View File

@ -1,4 +1,4 @@
Error Code
# Error Code
======
This document describes the error code used in key space '/v2/keys'. Feel free to import 'github.com/coreos/etcd/error' to use.

84
Documentation/v2/faq.md Normal file
View File

@ -0,0 +1,84 @@
# FAQ
## 1) Why can an etcd client read an old version of data when a majority of the etcd cluster members are down?
In situations where a client connects to a minority, etcd
favors by default availability over consistency. This means that even though
data might be “out of date”, it is still better to return something versus
nothing.
In order to confirm that a read is up to date with a majority of the cluster,
the client can use the `quorum=true` parameter on reads of keys. This means
that a majority of the cluster is checked on reads before returning the data,
otherwise the read will timeout and fail.
## 2) With quorum=false, doesnt this mean that if my client switched the member it was connected to, that it could experience a logical ordering where the cluster goes backwards in time?
Yes, but this could be handled at the etcd client implementation via
remembering the last seen index. The “index” is the cluster's single
irrevocable sequence of the entire modification history. The client could
remember the last seen index, and determine via comparing the index returned on
the GET whether or not the state of the key-value pair is before or after its
last seen state.
## 3) What happens if a watch is registered on a minority member?
The watch will stay untriggered, even as modifications are occurring in the
majority quorum. This is an open issue, and is being addressed in v3. There are
multiple ways to work around the watch trigger not firing.
1) build a signaling mechanism independent of etcd. This could be as simple as
a “pulse” to the client to reissue a GET with quorum=true for the most recent
version of the data.
2) poll on the `/v2/keys` endpoint and check that the raft-index is increasing every
timeout.
## 4) What is a proxy used for?
A proxy is a redirection server to the etcd cluster. The proxy handles the
redirection of a client to the current configuration of the etcd cluster. A
typical use case is to start a proxy on a machine, and on first boot up of the
proxy specify both the `--proxy` flag and the `--initial-cluster` flag.
From there, any etcdctl client that starts up automatically speaks to the local
proxy and the proxy redirects operations to the current configuration of the
cluster it was originally paired with.
In the v2 spec of etcd, proxies cannot be promoted to members of the cluster.
They also cannot be promoted to followers or at any point become part of the
replication of the etcd cluster itself.
## 5) How is cluster membership and health handled in etcd v2?
The design goal of etcd is that reconfiguration is simply an API, and health
monitoring and addition/removal of members is up to the individual application
and their integration with the reconfiguration API.
Thus, a member that is down, even infinitely, will never be automatically
removed from the etcd cluster member list.
This makes sense because it's usually an application level / administrative
action to determine whether a reconfiguration should happen based on health.
For more information, refer to the [runtime reconfiguration design document][runtime-reconf-design].
## 6) how does --endpoint work with etcdctl?
The `--endpoint` flag can specify any number of etcd cluster members in a comma
separated list. This list might be a subset, equal to, or more than the actual
etcd cluster member list itself.
If only one peer is specified via the `--endpoint` flag, the etcdctl discovers the
rest of the cluster via the member list of that one peer, and then it randomly
chooses a member to use. Again, the client can use the `quorum=true` flag on
reads, which will always fail when using a member in the minority.
If peers from multiple clusters are specified via the `--endpoint` flag, etcdctl
will randomly choose a peer, and the request will simply get routed to one of
the clusters. This is probably not what you want.
Note: --peers flag is now deprecated and --endpoint should be used instead,
as it might confuse users to give etcdctl a peerURL.
[runtime-reconf-design]: runtime-reconf-design.md

View File

@ -1,31 +1,35 @@
## Glossary
# Glossary
This document defines the various terms used in etcd documentation, command line and source code.
### Node
## Node
Node is an instance of raft state machine.
It has a unique identification, and records other nodes' progress internally when it is the leader.
### Member
## Member
Member is an instance of etcd. It hosts a node, and provides service to clients.
### Cluster
## Cluster
Cluster consists of several members.
The node in each member follows raft consensus protocol to replicate logs. Cluster receives proposals from members, commits them and apply to local store.
### Peer
## Peer
Peer is another member of the same cluster.
### Client
## Proposal
A proposal is a request (for example a write request, a configuration change request) that needs to go through raft protocol.
## Client
Client is a caller of the cluster's HTTP API.
### Machine (deprecated)
## Machine (deprecated)
The alternative of Member in etcd before 2.0

View File

@ -0,0 +1,65 @@
# FAQ
## Initial Bootstrapping UX
etcd initial bootstrapping is done via command line flags such as
`--initial-cluster` or `--discovery`. These flags can safely be left on the
command line after your cluster is running but they will be ignored if you have
a non-empty data dir. So, why did we decide to have this sort of odd UX?
One of the design goals of etcd is easy bringup of clusters using a one-shot
static configuration like AWS Cloud Formation, PXE booting, etc. Essentially we
want to describe several virtual machines and bring them all up at once into an
etcd cluster.
To achieve this sort of hands-free cluster bootstrap we had two other options:
**API to bootstrap**
This is problematic because it cannot be coordinated from a single service file
and we didn't want to have the etcd socket listening but unresponsive to
clients for an unbound period of time.
It would look something like this:
```
ExecStart=/usr/bin/etcd
ExecStartPost/usr/bin/etcd init localhost:2379 --cluster=
```
**etcd init subcommand**
```
etcd init --cluster='default=http://localhost:2380,default=http://localhost:7001'...
etcd init --discovery https://discovery-example.etcd.io/193e4
```
Then after running an init step you would execute `etcd`. This however
introduced problems: we now have to define a hand-off protocol between the etcd
init process and the etcd binary itself. This is hard to coordinate in a single
service file such as:
```
ExecStartPre=/usr/bin/etcd init --cluster=....
ExecStart=/usr/bin/etcd
```
There are several error cases:
0) Init has already run and the data directory is already configured
1) Discovery fails because of network timeout, etc
2) Discovery fails because the cluster is already full and etcd needs to fall back to proxy
3) Static cluster configuration fails because of conflict, misconfiguration or timeout
In hindsight we could have made this work by doing:
```
rc status
0 Init already ran
1 Discovery fails on network timeout, etc
0 Discovery fails for cluster full, coordinate via proxy state file
1 Static cluster configuration failed
```
Perhaps we can add the init command in a future version and deprecate if the UX
continues to confuse people.

Some files were not shown because too many files have changed in this diff Show More