Anthony Romano
f3053265ae
clientv3/integration: use new interfaces in lease tests
2017-04-24 23:49:44 -07:00
Anthony Romano
f224d74ed7
concurrency: use new lease interface in session
2017-04-24 23:49:44 -07:00
Anthony Romano
d5f414f69b
clientv3: don't halt lease client if there is a lease error
...
Fixes #7488
2017-04-24 23:49:44 -07:00
Anthony Romano
ca4acceb1e
clientv3: set current revision to create rev regardless of CreateNotify
...
Turns out the optimization to ignore setting the init rev for
current revision watches breaks some ordering assumptions. Since
Watch only returns a channel once it gets a response, it should
bind the revision at the time of the first create response.
Was causing TestWatchReconnInit to fail.
2017-04-22 13:04:38 -07:00
Anthony Romano
c1300c81b3
concurrency: clarify Observe semantics; only fetches subsequence
2017-04-22 11:26:11 -07:00
Anthony Romano
4ab818a856
clientv3: only update initReq.rev == 0 with creation watch revision
...
Always updating the initReq.rev on watch create will resume from the wrong
revision if initReq is ever nonzero.
2017-04-21 20:22:51 -07:00
Anthony Romano
ec470944f8
clientv3/integration: test watch resume with disconnect before first event
2017-04-21 20:22:51 -07:00
Anthony Romano
35dff4cbc3
Merge pull request #7769 from heyitsanthony/more-time-lease-test
...
clientv3/integration: sleep less in TestLeaseRenewLostQuorum
2017-04-19 00:57:49 -07:00
Hitoshi Mitake
d3456b5ecd
Merge pull request #7759 from mitake/fix-7724
...
*: simply ignore ErrAuthNotEnabled in clientv3 if auth is not enabled
2017-04-19 16:07:18 +09:00
Anthony Romano
c654370d6d
clientv3/integration: sleep less in TestLeaseRenewLostQuorum
...
Server Stop+Restart sometimes takes more than 500ms, so with a
one second window the lease client may not get a chance to issue
a keepalive and get a lease extension before the lease client
timer elapses. Instead, sleep for a shorter period of time (while
still guaranteeing a keepalive resend during quorum loss) and
skip the test if server restart takes longer than the lease TTL.
Fixes #7346
2017-04-18 19:35:20 -07:00
Hitoshi Mitake
e1306bff8f
*: simply ignore ErrAuthNotEnabled in clientv3 if auth is not enabled
...
Fix https://github.com/coreos/etcd/issues/7724
2017-04-19 11:27:14 +09:00
Anthony Romano
8fdf8f752b
Merge pull request #7752 from heyitsanthony/clientv3-fetch-keyspace-pfx
...
clientv3: translate WithPrefix() into WithFromKey() for empty key
2017-04-18 09:24:53 -07:00
Gyu-Ho Lee
81291b23b1
clientv3/integration: add 'TestUserErrorAuth'
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-17 17:11:37 -07:00
Anthony Romano
f92c11e1f2
clientv3: translate WithPrefix() into WithFromKey() for empty key
2017-04-16 20:47:18 -07:00
Anthony Romano
f0143916de
clientv3/integration: test fetching entire keyspace
2017-04-16 20:47:18 -07:00
darasion
0e7fd4a37c
clientv3/namespace: fix incorrect watching prefix-end
...
using "abc" will watch the wrong range when WithPrefix() specified.
2017-04-15 22:31:50 +08:00
Anthony Romano
2951e7f6e4
Merge pull request #7733 from heyitsanthony/fix-client-foreign-dial
...
clientv3: let client dial endpoints not in the balancer
2017-04-14 10:45:17 -07:00
Gyu-Ho Lee
6c2fb5105d
clientv3/integration: use 'transport.IsClosedConnError'
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-13 11:55:23 -07:00
Anthony Romano
46971fa1db
integration: test client can dial endpoints not in balancer
2017-04-12 20:07:04 -07:00
Anthony Romano
9b8e39e7ca
clientv3: let client.Dial() dial endpoints not in the balancer
2017-04-12 20:07:03 -07:00
Anthony Romano
4f9aa276bd
*: rename Snapshot STM isolation to SerializableSnapshot
...
Pure Snapshot isolation would permit read conflicts. Change the name
from Snapshot to SerializableSnapshot to reflect that it will also
reject read conflicts.
2017-04-11 17:17:50 -07:00
Anthony Romano
4b4f5be74a
concurrency: don't skip leader updates in Observe()
...
The Get for the leader key will fetch based on the latest revision
instead of the deletion revision, missing leader updates between
the delete and the Get.
Although it's usually safe to skip these updates since they're
stale, it makes testing more difficult and in some cases the
full leader update history is desirable.
2017-04-07 16:36:38 -07:00
Anthony Romano
80c1b9c13a
concurrency: support resuming elections if leadership already held
...
If a client already knows it holds leadership, let it create an
election object with its leadership information.
2017-04-07 16:36:38 -07:00
Anthony Romano
d1ae4cd5bd
concurrency: only delete on election resignation if create revision matches
...
Addresses a case where two clients share the same lease. A client resigns but
disconnects / crashes and doesn't realize it. Another client reuses the
lease and gets leadership with a new key. The old client comes back and
tries to resign again, revoking the new leadership of the new client.
2017-04-07 16:36:37 -07:00
Anthony Romano
4b5bb7f212
concurrency: return v3.GetResponse for Election.Leader()
...
The full information about the leader's key is necessary to
safely use elections with transactions. Instead of returning
only the value on Leader(), return the entire GetResposne.
2017-04-07 16:36:37 -07:00
Anthony Romano
a6cab69c88
concurrency: expose leader revision and proclaim headers for election
2017-04-07 16:36:37 -07:00
Gyu-Ho Lee
369d561350
clientv3/integration: fix minor typo in Fatalf
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-06 18:26:42 -07:00
Anthony Romano
bea4c62965
Merge pull request #7677 from heyitsanthony/fix-waitsubstream
...
clientv3: register waitCancelSubstreams closingc goroutine with waitgroup
2017-04-06 11:10:06 -07:00
Anthony Romano
aab2eda7df
clientv3: register waitCancelSubstreams closingc goroutine with waitgroup
...
Fixes #7598
2017-04-05 16:06:53 -07:00
Gyu-Ho Lee
dee467dc24
clientv3/yaml: use TLS 1.2 in min version
...
To be consistent with 'pkg/transport'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-05 11:50:35 -07:00
Anthony Romano
d42c1f5131
Merge pull request #7646 from andelf/fix-unix-socket-url
...
*: fix a bug in handling unix socket urls
2017-04-05 09:24:38 -07:00
andelf
4f27981c46
*: fix a bug in handling unix socket urls
...
Now use url.Host + url.Path as unix socket path
Fixes #7644
2017-04-05 14:33:13 +08:00
Gyu-Ho Lee
d51d381eca
Merge pull request #7656 from gyuho/more-adapter
...
*: add cluster API adapter
2017-04-04 20:10:24 -07:00
Gyu-Ho Lee
9bc3c0bd05
clientv3: remove unused fields from 'auth'
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-04 08:17:36 -07:00
Gyu-Ho Lee
7f2d6b3ef6
clientv3,v3client: add cluster embedded client
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-04 08:14:18 -07:00
Anthony Romano
a0149106b8
clientv3: fix go1.8 go fmt warning in test
2017-04-03 14:00:06 -07:00
Anthony Romano
f13bea0bb0
Merge pull request #7639 from heyitsanthony/fix-userflag-timeout
...
clientv3: respect dial timeout in auth
2017-04-03 09:30:48 -07:00
Anthony Romano
5aebe1a52d
clientv3: test dial timeout is respected when using auth
2017-03-31 15:14:46 -07:00
Anthony Romano
62d7bae496
clientv3: respect dial timeout when authenticating
...
Fixes #7627
2017-03-31 15:14:46 -07:00
Anthony Romano
8024a0d15f
clientv3: support WithRequireLeader in lease client
...
Unconditionally opens a WithRequireLeader stream in the lease client. Any
keep alive channels opened using WithRequireLeader will be closed when
the leader is lost.
Fixes #7275
2017-03-30 21:39:36 -07:00
Anthony Romano
7db7744737
clientv3/integration: test lease WithRequireLeader
2017-03-30 20:18:33 -07:00
Gyu-Ho Lee
0bf110e27f
clientv3,v3client: maintenance to embedded client
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-28 14:12:43 -07:00
Anthony Romano
36ece32a61
Merge pull request #7582 from heyitsanthony/fix-watch-stream-leak
...
clientv3: use waitgroup to wait for substream goroutine teardown
2017-03-23 12:24:06 -07:00
Anthony Romano
23719f99c6
Merge pull request #7563 from heyitsanthony/fix-testdialcancel-leak
...
clientv3: wait for Get goroutine in TestDialCancel
2017-03-23 10:07:23 -07:00
Anthony Romano
a39107a3b8
clientv3: use waitgroup to wait for substream goroutine teardown
...
When a grpc watch stream is torn down, it will join on its logical substream
goroutines by waiting for each to close a channel. This doesn't guarantee
the substream is fully exited, though, but only about to exit and can be
waiting to resume even after Watch.Close finishes. Instead, use a
waitgroup.Done at the very end of the substream defer.
Fixes #7573
2017-03-22 23:27:26 -07:00
Anthony Romano
85f989ab3d
Documentation, op-guide, clientv3: add documentation for namespacing
2017-03-22 16:45:38 -07:00
Anthony Romano
66d147766f
clientv3/integration: simple namespace wrapper tests
2017-03-22 16:45:38 -07:00
Anthony Romano
1f8c7b33e7
namespace: a wrapper for clientv3 to namespace requests
2017-03-22 14:09:09 -07:00
Anthony Romano
f9b6066dd6
clientv3: make ops and compares non-opaque and mutable
...
Fixes #7250
2017-03-22 14:08:59 -07:00
Anthony Romano
dd465d0e40
clientv3: remove redundant error handling code
2017-03-22 01:08:23 -07:00