Commit Graph

390 Commits (25eef5a6e4aabd82e58a38204e2377946803dc3e)

Author SHA1 Message Date
Anthony Romano 2e32d2142d Merge pull request #7869 from heyitsanthony/fix-lease-require-leader-test
clientv3/integration: drain keepalives before waiting for leader loss
2017-05-04 08:29:16 -07:00
Gyu-Ho Lee 4edbae4a91 integration/fixtures-expired: do not force 'rm'
To make gencerts.sh script safer.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-05-03 18:45:44 -07:00
Anthony Romano 9fee35b02d Merge pull request #7842 from heyitsanthony/fix-switch-race
clientv3: don't race on upc/downc/switch endpoints in balancer
2017-05-03 13:48:00 -07:00
Anthony Romano 8f40517adb integration: close proxy's lease client 2017-05-03 13:22:24 -07:00
Gyu-Ho Lee 85fa594265 integration: clean up TLS reload tests, fix no-file while renaming
Fix https://github.com/coreos/etcd/issues/7865.

It is also possible to have mis-matched key file
while renaming directories.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-05-03 11:59:09 -07:00
Anthony Romano 24e85b2454 Merge pull request #7852 from heyitsanthony/revert-lease-err-ka
Revert "Merge pull request #7732 from heyitsanthony/lease-err-ka"
2017-05-03 11:03:17 -07:00
Anthony Romano 61abf25859 integration: close accepted connection on stopc path
Connection pausing added another exit condition in the listener
path, causing the bridge to leak connections instead of closing
them when signalled to close. Also adds some additional Close
paranoia.

Fixes #7823
2017-05-02 16:46:43 -07:00
Gyu-Ho Lee 01b6cdf13d integration: ensure revoke completes before TimeToLive
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-05-02 12:56:26 -07:00
Anthony Romano 6dd8fb6f24 Revert "Merge pull request #7732 from heyitsanthony/lease-err-ka"
This reverts commit fbbc4a4979, reversing
changes made to f254e38385.

Fixes #7851
2017-05-02 09:36:16 -07:00
Gyu-Ho Lee cfeab9324e integration: match more TLS errors for wrong certs
Fix https://github.com/coreos/etcd/issues/7835.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-28 10:03:29 -07:00
Gyu-Ho Lee 22943e7e06 integration: test TLS reload
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-27 13:32:09 -07:00
Anthony Romano c309d745a6 Merge pull request #7819 from heyitsanthony/fix-elect-compact
concurrency: use current revisions for election
2017-04-27 11:01:44 -07:00
Gyu-Ho Lee 7cb860a31b integration/fixtures: add expired certs
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-26 12:22:54 -07:00
Anthony Romano 6486be673b integration: test Observe can read leaders set prior to compaction 2017-04-25 20:03:49 -07:00
Anthony Romano 2fd6df922a integration: close proxy's lease client 2017-04-24 23:49:45 -07:00
Anthony Romano e6a789d541 integration: permit dropping intermediate leader values on observe
Weaken TestV3ElectionObserve so it only checks that it observes a strictly
monotonically ascending leader transition sequence following the first
observed leader. First, the Observe will issue the leader channel before
getting a response for its first get; the election revision is only bound
after returning the channel. So, Observe can't be expected to always
return the leader at the time it was started.  Second, Observe fetches
the current leader based on its create revision, but begins watching on its
ModRevision; this is important so that elections still work in case the
leader issues proclamations following a compaction that exceeds its
creation revision. So, Observe can't be expected to return the entire
proclamation sequence for a single leader.

Fixes #7749
2017-04-22 11:26:11 -07:00
Anthony Romano fe1ce3a2f0 integration: add pause/unpause to client bridge
Resetting connections sometimes isn't enough; need to stop/resume
accepting connections for some tests while keeping the member up.
2017-04-21 20:22:51 -07:00
Anthony Romano 14d6ed9e5f *: clear redundant return statement warnings (S1027) 2017-04-21 14:01:00 -07:00
Gyu-Ho Lee 99a2d6c4b1 integration: use 'time.Until' in Go 1.8
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-17 20:08:27 -07:00
Gyu-Ho Lee e771c6042b Merge pull request #7743 from gyuho/shutdown-grpc-server
*: use gRPC server GracefulStop
2017-04-17 17:12:52 -07:00
Gyu-Ho Lee 253e5a90bb integration: test auth API response header revision
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-17 14:26:30 -07:00
Gyu-Ho Lee 472a536052 integration: test 'inflight' range requests
- Test https://github.com/coreos/etcd/issues/7322.
- Remove test case added in https://github.com/coreos/etcd/pull/6662.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-17 14:15:36 -07:00
Anthony Romano 712f6cb0e1 integration: test requests with valid auth token but disabled auth
etcd was crashing since auth was assuming a token implies auth is enabled.
2017-04-12 13:17:33 -07:00
Anthony Romano bf047ed9d5 integration: v3 election rpc tests 2017-04-07 16:36:38 -07:00
Gyu-Ho Lee 1e3274dfa2 integration: use cluster adapter in tests
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-04 10:08:51 -07:00
Anthony Romano 24e4c94d98 Merge pull request #7640 from heyitsanthony/etcdserver-ctx
etcdserver: ctx-ize server initiated requests
2017-04-03 09:07:28 -07:00
Anthony Romano f5f4791023 integration: test cluster terminates quickly 2017-03-31 19:19:33 -07:00
Anthony Romano b55ea6a70b integration: test require leader for a lease stream 2017-03-30 20:18:33 -07:00
Gyu-Ho Lee c90a4b96d1 integration: use maintenance API adapter in tests
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-28 14:12:47 -07:00
Anthony Romano b9cfa4cef9 integration: add serialized range to TestV3CompactCurrentRev
To catch compaction bugs in the proxy key cache.
2017-03-24 13:13:38 -07:00
Gyu-Ho Lee b81cb999fb integration: retry TestNetworkPartition5MembersLeaderInMajority
Fix https://github.com/coreos/etcd/issues/7587.

Retry for possible leader election in majority.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-23 16:30:38 -07:00
Gyu-Ho Lee ed68bf89ff integration: test inflight range requests while defragmenting
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-23 09:48:04 -07:00
Anthony Romano f35d7d9608 integration: test namespacing on proxy layer
Hardcode a namespace over the testing grpcproxy.
2017-03-22 16:45:38 -07:00
Anthony Romano 9f34d3493d integration: wait on leader before progress check in TestRestartMember
In rare cases, the last member may not have the leader by the time the
final cluster progress check tries to open a watch, causing a timeout.
2017-03-22 12:48:31 -07:00
Gyu-Ho Lee 2d5f890091 integration: ensure 'StopNotify' on publish error
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-21 10:29:00 -07:00
fanmin shi f292a4c953 embed: don't return error when closing on embed etcd
FIXES #7019
2017-03-17 13:41:05 -07:00
Anthony Romano 2f1542c06d *: use filepath.Join for files 2017-03-16 07:46:06 -07:00
fanmin shi ace3a217b0 Merge pull request #7483 from fanminshi/add_tests_to_mutex
integration: add TestMutexWaitsOnCurrentHolder test
2017-03-14 13:01:47 -07:00
fanmin shi 276039e835 integration: add TestMutexWaitsOnCurrentHolder test
TestMutexWaitsOnCurrentHolder ensures a series of waiters
obtain lock only after the previous lock requests are gone.
2017-03-14 11:00:07 -07:00
Anthony Romano 300323fa50 integration: test grpc lock service 2017-03-13 15:23:26 -07:00
Anthony Romano b025cdd097 adapter, integration: split out grpc adapters from grpcproxy package
Break cyclic dependency:
clientv3/naming <-> integration <-> v3client <-> grpcproxy <-> clientv3/naming
2017-03-13 15:23:26 -07:00
Gyu-Ho Lee beb58c434c *: fix minor typos
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-08 16:21:52 -08:00
Hitoshi Mitake f8a290e7ca *: support jwt token in v3 auth API
This commit adds jwt token support in v3 auth API.

Remaining major ToDos:
- Currently token type isn't hidden from etcdserver. In the near
  future the information should be completely invisible from
  etcdserver package.
- Configurable expiration of token. Currently tokens can be valid
  until keys are changed.

How to use:
1. generate keys for signing and verfying jwt tokens:
 $ openssl genrsa -out app.rsa 1024
 $ openssl rsa -in app.rsa -pubout > app.rsa.pub
2.  add command line options to etcd like below:
--auth-token-type jwt \
--auth-jwt-pub-key app.rsa.pub --auth-jwt-priv-key app.rsa \
--auth-jwt-sign-method RS512
3. launch etcd cluster

Below is a performance comparison of serializable read w/ and w/o jwt
token. Every (3) etcd node is executed on a single machine. Signing
method is RS512 and key length is 1024 bit. As the results show, jwt
based token introduces a performance overhead but it would be
acceptable for a case that requires authentication.

w/o jwt token auth (no auth):

Summary:
  Total:        1.6172 secs.
  Slowest:      0.0125 secs.
  Fastest:      0.0001 secs.
  Average:      0.0002 secs.
  Stddev:       0.0004 secs.
  Requests/sec: 6183.5877

Response time histogram:
  0.000 [1]     |
  0.001 [9982]  |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.003 [1]     |
  0.004 [1]     |
  0.005 [0]     |
  0.006 [0]     |
  0.008 [6]     |
  0.009 [0]     |
  0.010 [1]     |
  0.011 [5]     |
  0.013 [3]     |

Latency distribution:
  10% in 0.0001 secs.
  25% in 0.0001 secs.
  50% in 0.0001 secs.
  75% in 0.0001 secs.
  90% in 0.0002 secs.
  95% in 0.0002 secs.
  99% in 0.0003 secs.

w/ jwt token auth:

Summary:
  Total:        2.5364 secs.
  Slowest:      0.0182 secs.
  Fastest:      0.0002 secs.
  Average:      0.0003 secs.
  Stddev:       0.0005 secs.
  Requests/sec: 3942.5185

Response time histogram:
  0.000 [1]     |
  0.002 [9975]  |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.004 [0]     |
  0.006 [1]     |
  0.007 [11]    |
  0.009 [2]     |
  0.011 [4]     |
  0.013 [5]     |
  0.015 [0]     |
  0.016 [0]     |
  0.018 [1]     |

Latency distribution:
  10% in 0.0002 secs.
  25% in 0.0002 secs.
  50% in 0.0002 secs.
  75% in 0.0002 secs.
  90% in 0.0003 secs.
  95% in 0.0003 secs.
  99% in 0.0004 secs.
2017-03-06 19:46:03 -08:00
Gyu-Ho Lee 3d75395875 *: remove never-unused vars, minor lint fix
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-06 14:59:12 -08:00
Anthony Romano 1753623f87 integration: don't set v3 capability since now default 2017-03-02 14:02:09 -08:00
fanmin shi 324d2383b8 integration: ensure leader is up in waitLeader() and clusterMustProgress()
The issue is caused by leader loss even after waitLeader() returns
which can happen if the test machine is flaky which triggers a leader loss
or the killed node is the leader since waitLeader() only scans followers in
TestRestartMember() and they can have the same older leader.
In those cases, clusterMustProgress() proceeds with no leader which triggers
the no leader error.

To get around that, use linearizable get in waitLeader() to ensure leader is up
and retries on kapi.create() in clusterMustProgress() to ensure it proceeds with
a leader.

FIX #7258
2017-02-28 09:17:03 -08:00
Gyu-Ho Lee f2e9936de5 integration: add 'TestV3HashRestart' 2017-02-21 16:20:56 -08:00
fanmin shi 65b59f4423 grpcproxy: incorporate lease proxy into existing proxy framework 2017-02-16 11:50:59 -08:00
fanmin shi 2925f02aac Merge pull request #7305 from fanminshi/return_header_for_timetolive
lease: LeaseTimeToLive returns TTL=-1 resp on lease not found
2017-02-13 11:24:36 -08:00
fanmin shi 0d08ffa282 integration: don't expect lease not found error for TestV3GetNonExistLease 2017-02-10 17:35:43 -08:00