Commit Graph

312 Commits (3cea310b6161f164cd789d5664dee4b6e07f45ff)

Author SHA1 Message Date
Anthony Romano 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
Gyu-Ho Lee 0a3d45a307 clientv3: send create event over outc 2016-10-27 11:11:16 -07:00
Anthony Romano 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
Anthony Romano a66c25121b integration: stress closing while resuming watchers 2016-10-20 15:33:11 -07:00
Gyu-Ho Lee 4de2128344 clientv3/integration: test missing sort order get 2016-10-18 16:29:22 -07:00
Geoff Levand 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
Anthony Romano 8e1c989ec3 integration: test a canceled watch won't return a closing error 2016-10-04 14:47:40 -07:00
Anthony Romano 9ce398f8a6 integration: test canceling watchers when disconnected 2016-10-03 16:56:14 -07:00
Gyu-Ho Lee 29dd3cf5bd Revert "clientv3/integration: add TestDialWithHTTPS"
This reverts commit a96a28d603.
2016-10-03 13:05:08 -07:00
Gyu-Ho Lee a96a28d603 clientv3/integration: add TestDialWithHTTPS 2016-10-03 02:16:07 -07:00
Anthony Romano deef16b376 integration: test client watchers with overlapped context cancels 2016-09-21 09:40:24 -07:00
Anthony Romano 69c7ea0b4a Merge pull request #6473 from heyitsanthony/watchreconn-putretry
integration: l-read before Put in TestWatchReconnRequest
2016-09-19 14:52:26 -07:00
Anthony Romano 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
Gyu-Ho Lee f11b35eb71 clientv3/integration: test 'SetEndpoints' 2016-09-20 04:36:14 +09:00
Gyu-Ho Lee 03b9d6f24c *: separate 'capnslog' log level setting 2016-09-10 20:26:51 +09:00
Gyu-Ho Lee 4c08f6767c clientv3: add lease.TimeToLive + tests 2016-09-09 08:18:45 +09:00
Anthony Romano 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
Xiang Li f2b7c501cc clientv3/integration: fix TestKVPutStoppedServerAndClose 2016-08-24 13:57:27 -07:00
Anthony Romano 46765ad79c clientv3: respect up/down notifications from grpc
Fixes #5842
2016-08-16 09:49:36 -07:00
Anthony Romano 8c1c291332 clientv3/integration: test watcher cancelation propagation to server 2016-08-09 00:10:57 -07:00
Xiang Li 33c3583b50 clientv3: add send created notification 2016-08-02 20:08:11 -07:00
Anthony Romano 4c9a2a65c9 integration: test clientv3 watch filters 2016-07-27 21:25:06 -07:00
Anthony Romano 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
Xiang Li e177d9eda2 clientv3/integration: fix race in TestWatchCompactRevision 2016-07-19 09:31:44 -07:00
Anthony Romano 27a30768e1 integration: drain keepalives in TestLeaseKeepAliveCloseAfterDisconnectRevoke
Fixes #5900
2016-07-18 19:45:59 -07:00
westhood 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
Anthony Romano 1c25aa6c48 clientv3, ctl3, clientv3/integration: add compact response to compact 2016-06-28 09:32:31 -07:00
Xiang Li 6496ae005d clientv3: add withCount support 2016-06-21 21:17:35 -07:00
Anthony Romano 1097d63ff7 clientv3/integration: test WithRequireLeader on Watch 2016-06-20 14:26:16 -07:00
Anthony Romano 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
Anthony Romano 0554ef9c39 clientv3/integration: tests for closing lease channel 2016-06-09 09:12:59 -07:00
Gyu-Ho Lee 753073198f clientv3/integration: WaitLeader to follower
Fix https://github.com/coreos/etcd/issues/5601.
2016-06-08 16:45:32 -07:00
Anthony Romano 62f8ec25c0 clientv3: use grpc reconnection logic 2016-06-08 01:04:59 -07:00
Xiang Li 83ce1051ff auth: make naming consistent 2016-06-07 10:54:50 -07:00
Gyu-Ho Lee 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
Anthony Romano 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
Gyu-Ho Lee 75dc10574a clientv3: watch resp with error when client close 2016-06-01 10:39:48 -07:00
Anthony Romano a83051d0fc clientv3: don't panic on Get if NewKV is created with a closed client 2016-06-01 05:53:21 -07:00
Anthony Romano 1d88130522 clientv3: fix deadlock on Get with concurrent Close 2016-06-01 05:53:21 -07:00
Gyu-Ho Lee 7b5657cf1a clientv3: check if KV.Client is closed
For https://github.com/coreos/etcd/issues/5495.
2016-05-31 12:00:19 -07:00
Anthony Romano 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
Hitoshi Mitake 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
Xiang Li 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
Gyu-Ho Lee fd9e07a529 clientv3: update LICENSE header 2016-05-12 20:50:58 -07:00
Gyu-Ho Lee 68eaf4083a clientv3: WithRequireLeader 2016-05-12 19:25:42 -07:00
Anthony Romano 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
Anthony Romano 8b52fd0d2d clientv3: gracefully handle watcher resume on compacted revision
Fixes #5239
2016-05-03 09:30:53 -07:00
Gyu-Ho Lee b3ebe66c97 clientv3/integration: tests with new errors 2016-04-29 12:00:26 -07:00
Gyu-Ho Lee f148f4b2b9 clientv3/integration: tests error types (rpctypes) 2016-04-28 15:42:27 -07:00
Anthony Romano af1a0b60e2 etcdserver: respond with ttl=0 for revoked lease keep alive
Fixes #5172
2016-04-26 13:53:20 -07:00
Anthony Romano b7ac758969 *: rename storage package to mvcc 2016-04-25 15:25:51 -07:00
Ajit Yagaty 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
lolynx e3fd246414 clientv3: fix KeepAliveOnce return error message 2016-04-11 08:13:36 +08:00
Gyu-Ho Lee a9f1d5dfa6 clientv3/integration: use clientv3 event types
Fix https://github.com/coreos/etcd/issues/5001.
2016-04-07 19:29:32 -07:00
Anthony Romano 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
Hongchao Deng 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
Gyu-Ho Lee e72591b4a2 clientv3/integration: fix watch range test typo 2016-04-06 21:12:07 -07:00
Hitoshi Mitake 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
Gyu-Ho Lee b0cc0e443c *: clean up if, bool comparison 2016-04-02 12:55:11 -07:00
Anthony Romano d533c14881 Merge pull request #4876 from heyitsanthony/integration-races
*: fix races from clientv3/integration tests
2016-03-29 09:10:53 -07:00
Anthony Romano 096abb3f37 clientv3/integration: get quorum before watching in TestKVCompact
Fixes #4889
2016-03-28 22:18:10 -07:00
Anthony Romano 91dc6b29a6 clientv3/integration: fix race when setting progress report interval 2016-03-28 16:08:18 -07:00
Xiang Li 88e738fcb6 Merge pull request #4844 from ajityagaty/polish_naming_conventions
clientv3: Renaming SortByCreatedRev to maintain consistency.
2016-03-23 09:27:34 -07:00
Ajit Yagaty 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
Anthony Romano bd832e5b0a *: migrate Godeps to vendor/ 2016-03-22 17:10:28 -07:00
Ajit Yagaty 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
Anthony Romano a001651bc1 clientv3: remove dependency on lease package 2016-03-17 11:52:34 -07:00
Anthony Romano 44753594ec v3rpc: move errors to v3rpc/rpctypes
Fixes #4771
2016-03-17 11:52:34 -07:00
Xiang Li 22065fe334 clientv3: fix mirror and add integration test 2016-03-13 18:27:45 -07:00
Xiang Li 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
Anthony Romano e026b79c87 clientv3/integration: do not remove client member in TestMemberRemove
Fixes #4716
2016-03-08 11:55:26 -08:00
Anthony Romano 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
Gyu-Ho Lee 27316196d8 clientv3: add WithProgressNotify
Client side for https://github.com/coreos/etcd/issues/4628.
2016-03-04 09:47:13 -08:00
Anthony Romano 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
Anthony Romano 16c35167df clientv3: do not reconnect on request context cancellation 2016-03-03 13:43:16 -08:00
Anthony Romano eb327c690b clientv3: support watcher ranges 2016-02-29 15:20:41 -08:00
Anthony Romano 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
Gyu-Ho Lee 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
Gyu-Ho Lee a24d276891 clientv3: combine Watch, WatchPrefix with variadic
For https://github.com/coreos/etcd/issues/4598.
2016-02-23 20:02:21 -08:00
Anthony Romano 11bb07c248 Merge pull request #4564 from heyitsanthony/fix-watchreconnrequest
clientv3: fix current watcher reconnection
2016-02-18 15:14:22 -08:00
Anthony Romano 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
Anthony Romano 4fc89678b2 etcdserver: add >= support for v3 delete range 2016-02-18 12:34:04 -08:00
Anthony Romano 59291770d6 clientv3: WithPrefix operation option 2016-02-18 01:27:06 -08:00
Anthony Romano 2415303991 clientv3: typedef <-chan WatchResponse to WatchChan 2016-02-12 14:06:59 -08:00
Anthony Romano 8e411b1b3b clientv3: send compacted revision before closing watch chan 2016-02-12 14:06:59 -08:00
Xiang Li 5908e5b601 clientv3: support serializable 2016-02-12 12:24:46 -08:00
Anthony Romano 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
Anthony Romano 3c9e8540a7 clientv3: optionize put and delete 2016-02-10 15:03:11 -08:00
Anthony Romano 51c4894f62 clientv3: ctx-ize KV 2016-02-09 17:42:34 -08:00
Anthony Romano 8dcd24bd64 clientv3: withOption for Gets 2016-02-08 13:11:55 -08:00
Anthony Romano b7eb539b7a clientv3/integration: add delay after restart in TestTxnWriteFail
CI was timing out with publish failures
2016-02-05 16:44:41 -08:00
Anthony Romano 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
Anthony Romano e3e4d09653 clientv3/integration: add timeouts to TestTxnWriteFail
so it doesn't take ten minutes to fail
2016-02-05 10:24:56 -08:00
Gyu-Ho Lee d21ef68a0c Merge pull request #4413 from gyuho/TestKVCompact
clientv3/integration: add TestKVCompact
2016-02-04 14:14:37 -08:00
Gyu-Ho Lee 5b4b1c7039 clientv3/integration: add TestKVCompact 2016-02-04 13:45:51 -08:00
Anthony Romano 9523c2d29f clientv3/integration: txn tests 2016-02-04 08:40:24 -08:00
Quentin Perez 86aafcd15a clientv3/integration: fix args format in Errorf/Printf 2016-02-03 22:17:58 +01:00
Xiang Li c7876d4111 clientv3/integration: fix member remove
Do not connect to the member to remove.
2016-02-02 20:49:00 -08:00
Xiang Li 20673e384a Merge pull request #4382 from xiang90/lease_keep_test
clientv3/integration: test lease keepalive
2016-02-02 12:01:22 -08:00
Xiang Li fd0e68d16b clientv3/integration: test lease keepalive 2016-02-02 10:59:22 -08:00
Anthony Romano 5f20aaa457 Merge pull request #4360 from heyitsanthony/v3-client-watcher
V3 client watcher
2016-02-01 23:39:30 -08:00
Gyu-Ho Lee 87ed04ea6f Merge pull request #4372 from gyuho/kv_delete
clientv3/integration: add TestKVDelete*
2016-02-01 23:30:11 -08:00
Anthony Romano 580c563ed6 clientv3: watcher implementation 2016-02-01 23:21:55 -08:00
Xiang Li a25423ca99 clientv3: implement cluster api 2016-02-01 21:46:23 -08:00
Gyu-Ho Lee e49ae8b03f clientv3/integration: add TestKVDelete* 2016-02-01 17:07:52 -08:00
Gyu-Ho Lee 7d278ef6bb clientv3/integration: TestKVPut with lease id 2016-02-01 14:46:20 -08:00
Xiang Li bef7887c0d clientv3/integration: add basic lease test 2016-02-01 12:59:44 -08:00
Gyu-Ho Lee 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
Gyu-Ho Lee 57dedd8c89 Revert "*: TestKVRange to clientv3/integration, fix rev" 2016-01-29 18:20:56 -08:00
Gyu-Ho Lee 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
Shawn Smith 1ac0ca5317 clientv3/integration: add tt.key string formatting verb to Fatalf call 2016-01-29 15:56:04 +09:00
Gyu-Ho Lee 1767788074 *: expose integration functions for clientv3 2016-01-28 21:21:34 -08:00