Commit Graph

863 Commits (ae25c5e1320f731a2ffaafbf756aca8b0a94dfab)

Author SHA1 Message Date
Shin'ya Ueoka aa4313a55a *: fix github links 2018-11-10 11:14:18 +09:00
Joe Betz 6a43db1eff
clientv3: Fix concurrent clientv3 client creation in 3.4 by using proper UUIDs 2018-10-22 14:08:58 -07:00
Joe Betz 49450aaa60
clientv3: Clarify lessor KeepAlive docs 2018-10-11 15:11:28 -07:00
yura 64e8b2e905 clientv3: concurrency.Mutex.Lock() - preserve invariant
Convenient invariant:
- if werr == nil then lock is supposed to be locked at the moment.

While we could not be confident in stronger invariant ('is exactly locked'),
it were inconvenient that previous code could return `werr == nil` after
Mutex.Unlock.

It could happen when ctx is canceled/timeouted exactly after waitDeletes
successfully returned werr == nil and before `<-ctx.Done()` checked.
While such situation is very rare, it is still possible.

fixes #10111
2018-10-05 14:17:32 +03:00
Jingyi Hu 87beb8336f clientv3: add test for snapshot status
Add unit test to check if we can correctly identify a corrupted snapshot
backup file.
2018-10-03 18:17:19 -07:00
Jingyi Hu 7d57ee3427 clientv3: fix goword checking in config.go 2018-10-02 23:02:10 -07:00
Sahdev P. Zala f6f375109e clientv3: let etcd client use all available keepalive ClientParams
We should allow etcd client use all of the available keepalive
client parameters as documented in this link,
https://godoc.org/google.golang.org/grpc/keepalive#ClientParameters
Currently in the etcd, by default PermitWithoutStream is set to
false, and user has no way to override it.
On the server side, we explicitely setting EnforcementPolicy
PermitWithoutStream to false and don't provide option to override it
to user but on the client side we should allow this option as
provided by the grpc.
2018-10-02 15:51:27 -04:00
Gyuho Lee fb674833c2
Merge pull request #10094 from nolouch/drop-read
server: drop read request if the leader is changed
2018-09-23 19:32:44 -07:00
Jingyi Hu 422f867f6b clientv3: add integrity check in snapshot status
Add snapshot file integrity check in snapshot status. If the file is
corrupted, return with error message.
2018-09-20 12:59:27 -07:00
nolouch 6ea54195a6 client/integration: try to fix tests 2018-09-18 01:44:57 +08:00
nolouch c15fb607f6 server: broadcast leader changed 2018-09-17 14:15:04 +08:00
nolouch fd5ef74b80 clientv3/integration: try to fix tests 2018-09-14 17:57:56 +08:00
nolouch f3f6427586 server: prevent blocking 2018-09-14 16:08:29 +08:00
nolouch 4de27039cb server: drop read request if found leader changed 2018-09-14 15:58:35 +08:00
Gyuho Lee 001bbb97cc
Merge pull request #9999 from vimalk78/9377_document_election_api
clientv3/concurrency: Document Election API context parameter
2018-09-13 10:47:23 -07:00
Vimal K 35fa6e13b9 clientv3/concurrency: Document Election API context parameter
fixes #9377
2018-09-13 12:15:01 +05:30
Xiang Li ec5ff10436
Merge pull request #10019 from thrawn01/grpc-proxy-watch-errors
Improve watch error reporting when using grpc proxy
2018-09-10 12:54:33 -07:00
Gyuho Lee 484f622034
Merge pull request #10054 from vcaesar/docs-pr
client,clientv3: update client docs to "go.etcd.io"
2018-08-30 16:44:16 -07:00
vcaesar fc7ef659cc client,clientv3: update client docs to "go.etcd.io" 2018-08-30 19:26:12 -04:00
Shin'ya UEOKA e9afd51f47 clientv3/doc: Fix code example 2018-08-30 22:10:58 +00:00
Gyuho Lee d627719881
Merge pull request #10050 from gyuho/bbolt
vendor: use "go.etcd.io/bbolt" v1.3.1-etcd.7
2018-08-30 10:20:53 -07:00
Gyuho Lee 572d486c5b *: update github links
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-29 14:28:36 -07:00
Gyuho Lee 8db439d693 *: use "go.etcd.io/bbolt"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-29 12:31:28 -07:00
Gyuho Lee 839f202195 clientv3/integration: fix race condition from closing channel
Go 1.11 now marks len(channel) over being-closed channel
as racey operation, fix tests by receiving from channel first
and then check the length of channel.

```
WARNING: DATA RACE
Write at 0x00c000e872c0 by goroutine 198:
  runtime.closechan()
      /usr/local/go/src/runtime/chan.go:327 +0x0
  go.etcd.io/etcd/clientv3.(*lessor).closeRequireLeader()
      /Users/leegyuho/go/src/go.etcd.io/etcd/clientv3/lease.go:379 +0x748
  go.etcd.io/etcd/clientv3.(*lessor).recvKeepAliveLoop()
      /Users/leegyuho/go/src/go.etcd.io/etcd/clientv3/lease.go:455 +0x3a5

Previous read at 0x00c000e872c0 by goroutine 27:
  go.etcd.io/etcd/clientv3/integration.TestLeaseWithRequireLeader()
      /Users/leegyuho/go/src/go.etcd.io/etcd/clientv3/integration/lease_test.go:828 +0x810
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162
```

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 22:27:11 -07:00
Gyuho Lee 07fcc26799 *: fix gofmt warnings with Go 1.11
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 21:45:24 -07:00
Gyuho Lee 0ef9ef3c74 *: rerun "gofmt"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 18:25:39 -07:00
Gyuho Lee 2ac04381a2 clientv3: update Go import paths to "go.etcd.io"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 17:47:55 -07:00
Louis-Paul Dareau a3c09ee8e9
clientv3/doc: Improve error handling comment 2018-08-23 19:47:27 +02:00
Louis-Paul Dareau 2ee4525cd2
clientv3/doc: Update error handling godoc
0c5bcd5d80 updated error handling for
`ErrEmptyKey` but missed the godoc.
2018-08-23 13:37:39 +02:00
Derrick J. Wippler eb9c8d3c2f clientv3: return reason to user when server cancels watch
This change allows Watch users to retrieve the cancel reason when a
watch is canceled by the server. Additionally WatchResponses with
closeErr set now have Canceled set true which is in line with the
documentation for the Canceled field.
2018-08-16 23:11:02 -05:00
Gyuho Lee aeb418b815 clientv3/integration: remove "transport.ErrConnClosing" match
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-08-09 19:27:37 -07:00
Daniel Lipovetsky ddde272fb0 clientv3: Make saved snapshot readable by user only
Fixes #9976
2018-08-08 12:46:17 -07:00
Joe Betz 1c382a4868
Merge pull request #9945 from jpbetz/balancer-maintanance-api-fix
clientv3: Fix maintenance APIs to directly dial grpc endpoints directly
2018-07-27 10:15:25 -07:00
Joe Betz 67bcf28c4e
clientv3: Use passthrough resolver for direct endpoint dialing 2018-07-27 10:15:02 -07:00
Joe Betz a2ecd6b676
clientv3: Simplify TestDialTLSNoConfig now that dial with grpc.WithBlock correctly results in a client timeout error 2018-07-24 10:45:03 -07:00
Joe Betz 750b87d622
Merge pull request #9924 from jpbetz/persist-lease-deadline
lease: Persist remainingTTL to prevent indefinite auto-renewal of long lived leases
2018-07-24 09:39:57 -07:00
Joe Betz b3b06a862a
clientv3: Fix maintenance APIs to directly dial grpc endpoints correctly. 2018-07-23 11:20:15 -07:00
Gyuho Lee 0458c5d54b
Merge pull request #9951 from gyuho/revive
*: integrate https://github.com/mgechev/revive with fmt tests
2018-07-23 06:39:33 -07:00
Gyuho Lee e93fb56037 clientv3: clean up variables, add response dropping warning
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-22 17:59:38 -07:00
Gyuho Lee f3385418bb clientv3: fix keepalive send interval when response queue is full
client should update next keepalive send time
even when lease keepalive response queue becomes full.

Otherwise, client sends keepalive request every 500ms
regardless of TTL when the send is only expected to happen
with the interval of TTL / 3 at minimum.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-22 17:59:32 -07:00
Gyuho Lee 90a5da18cf clientv3: clean up code format
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-21 16:03:12 -07:00
Joe Betz bbe2d777b1
lease: Add LessorConfig and wire zap logger into Lessor 2018-07-17 13:10:34 -07:00
Gyuho Lee dbccfe06fb clientv3/balancer: debugging balancer test failures
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-05 12:18:13 -07:00
Gyuho Lee 7e542078bc clientv3/balancer: skip "TestRoundRobinBalancedResolvableFailoverFromServerFail" for now
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-05 11:57:45 -07:00
Joe Betz 4b51b6de49
*: Add progress notify request watch request 2018-06-27 16:46:13 -07:00
Gyuho Lee 11ead62b9d clientv3: clarify "WithRequireLeader" for network partition
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-20 10:28:41 -07:00
Gyuho Lee 6d15396bc7 clientv3: add link to architecture docs
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-18 13:51:20 -07:00
Joe Betz 8451a1715f clientv3: Enable balancer logging if ETCD_CLIENT_DEBUG environment variable is set 2018-06-15 16:28:36 -07:00
Gyuho Lee 6e521d2f3f clientv3: add "IsConnCanceled", deprecate "grpc.ErrClientConnClosing"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 14:47:08 -07:00
Gyuho Lee a76681073d clientv3: add "zap.Config" to replace global logger
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 13:41:28 -07:00