Commit Graph

42 Commits (b7f0f52a16dbf83f18ca1d803f7892d750366a94)

Author SHA1 Message Date
Piotr Tabor 28f2b07623 *: Update references to code moved to the api/ dir.
Follow up to file-moves done in the previous commit.

The commit contains purely mechanical consequences of execution (apart
of scripts/genproto.sh):

  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/etcdserver/api/v3rpc/rpctypes|v3/api/v3rpc/rpctypes|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/version|v3/api/version|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/mvcc/mvccpb|v3/api/mvccpb|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/etcdserver/etcdserverpb|v3/api/etcdserverpb|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/etcdserver/api/membership/membershippb|v3/api/membershippb|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/auth/authpb|v3/api/authpb|g'

  % find ./ -name '*.proto' -o -name '*.md'  | xargs -L 1 sed --follow-symlinks -i 's|/mvcc/mvccpb/kv.proto|/api/mvccpb/kv.proto|g'
  % find ./ -name '*.proto' -o -name '*.md'  | xargs -L 1 sed --follow-symlinks -i 's|/auth/authpb/auth.proto|/api/authpb/auth.proto|g'
  % find ./ -name '*.proto' -o -name '*.md'  | xargs -L 1 sed --follow-symlinks -i 's|/etcdserver/api/membership/membershippb/membership.proto|/api/membershippb/membership.proto|g'

  I also modified manually paths in scripts/genproto.sh.

  % go fmt ./...
2020-10-06 11:56:16 +02:00
Brandon Philips 96cce208c2 go.mod: use go.etcd.io/etcd/v3 versioning
This change makes the etcd package compatible with the existing Go
ecosystem for module versioning.

Used this tool to update package imports:
  https://github.com/KSubedi/gomove
2020-04-28 00:57:35 +00:00
yoyinzyc d8b9b54348 etcdserver: add downgrade rpc proto api. 2020-03-20 17:37:26 -07:00
Vern Burton 071e70cdc4
*: add a new API and command for checking auth status (#11536)
This changes have started at etcdctl under auth.go, and make changes to stub out everything down into the internal raft.  Made changes to the .proto files and regenerated them so that the local version would build successfully.
2020-02-05 19:27:42 -08:00
Gyuho Lee 1caaa9ed4a test: test update for Go 1.12.5 and related changes
Update to Go 1.12.5 testing. Remove deprecated unused and gosimple
pacakges, and mask staticcheck 1006. Also, fix unconvert errors related
to unnecessary type conversions and following staticcheck errors:
- remove redundant return statements
- use for range instead of for select
- use time.Since instead of time.Now().Sub
- omit comparison to bool constant
- replace T.Fatal and T.Fatalf in tests with T.Error and T.Fatalf respectively because the goroutine calls T.Fatal must be called in the same goroutine as the test
- fix error strings that should not be capitalized
- use sort.Strings(...) instead of sort.Sort(sort.StringSlice(...))
- use he status code of Canceled instead of grpc.ErrClientConnClosing which is deprecated
- use use status.Errorf instead of grpc.Errorf which is deprecated

Related #10528 #10438
2019-06-05 17:02:05 -04:00
Gyuho Lee 34bd797e67 *: revert module import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 15:39:35 -07:00
Jingyi Hu a0d3c4d641 *: fix compilation after API change
Fixed compilation erros after API change for learner.
2019-05-14 13:10:22 -07:00
shivaramr 9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -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
Gyuho Lee 08da08bb19 clientv3: clarify retry function names, do not retry on dial error
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 13:41:28 -07:00
Joe Betz 55ef9cc1d0 clientv3: Add auth retry to retry interceptor 2018-06-15 13:41:28 -07:00
Joe Betz a5b2fb5563 clientv3: Introduce custom retry interceptor based on go-grpc-middleware/retry 2018-06-15 13:41:28 -07:00
Joe Betz 6080fa1270 clientv3: Integrate new grpc load balancer interface with etcd client 2018-06-15 13:41:28 -07:00
Gyuho Lee 3aa5711dca clientv3: move health balancer to "balancer"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-19 15:16:11 -07:00
Gyuho Lee 1f016f3b96 clientv3: use "pkg/logger"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-05 13:40:58 -08:00
Sahdev P. Zala 3b7e2ce0ca StatusFromError: handle return value of the function
status.FromError can return nil, false. We are handling the return values
most places in code but some places we aren't. Fixing it herewith.

Fixes #9117
2018-01-08 22:28:20 -05:00
Gyu-Ho Lee 255476b5e5 clientv3/retry: clean up retryRPCFunc
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-12-20 12:30:33 -08:00
Gyu-Ho Lee 805bcc828c clientv3: simplify V(4) logger with Lvl(4)
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-12-05 18:48:36 -08:00
Gyu-Ho Lee c669ff9765 clientv3: retry mutable ops on "no connection available"
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-10 15:40:06 -08:00
Gyu-Ho Lee 725df70664 clientv3: only stop if EtcdError code is not Unavailable, retry with more error codes
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-22 17:54:14 -07:00
Gyu-Ho Lee 54ef60d033 clientv3: remove redundant retries in Auth, set FailFast=true
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-19 16:03:12 -07:00
Gyu-Ho Lee 141170c1d4 clientv3: remove redundant retries in Maintenance, set FailFast=true
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-19 16:01:50 -07:00
Gyu-Ho Lee c09a89d834 clientv3: remove redundant retries in Cluster, set FailFast=true
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-19 16:00:45 -07:00
Gyu-Ho Lee fecd26f141 clientv3: rename to isRepeatableStopError, isNonRepeatableStopError
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-19 15:58:12 -07:00
Gyu-Ho Lee b46ab2c36e clientv3: remove redundant retries in KV, set FailFast=true
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-19 15:57:10 -07:00
Gyu-Ho Lee f95f865060 clientv3: unexport pb.LeaseClient in lease client
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-19 15:02:19 -07:00
Gyu-Ho Lee 87fe8c12ae clientv3: rename to repeatableRetry in lease client
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-19 14:58:54 -07:00
Gyu-Ho Lee 29aa4ce2a1 clientv3: remove redundant retries in Lease, set FailFast=true
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-19 14:53:01 -07:00
Gyu-Ho Lee 2540859ee7 clientv3: separate readyWait for ConnectNotify
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-19 13:07:22 -07:00
Gyu-Ho Lee 1549403dd2 clientv3: clean up logging, clarify var/field names
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-19 12:33:25 -07:00
Gyu-Ho Lee fbed568b6a clientv3/balancer: mark partitioned member as unhealthy
Previous behavior is when server returns errors, retry
wrapper does not do anything, while passively expecting
balancer to gray-list the isolated endpoint. This is
problematic when multiple endpoints are passed, and
network partition happens.

This patch adds 'endpointError' method to 'balancer' interface
to actively(possibly even before health-check API gets called)
handle RPC errors and gray-list endpoints for the time being,
thus speeding up the endpoint switch.

This is safe in a single-endpoint case, because balancer will
retry no matter what in such case.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-09 13:40:03 -07:00
Gyu-Ho Lee bed5f388a8 clientv3: add pinned() method to 'balancer'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-06 15:28:21 -07:00
Gyu-Ho Lee 1c6fbcd3d0 clientv3: add debugging lines to 'retry' paths
Helpful for debugging client balancer.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-06 10:13:25 -07:00
Gyu-Ho Lee a439095697 clientv3: wait for ConnectNotify before sending RPCs
With slow CPU, gRPC can lag behind with RPCs being sent before
calling 'Up', returning 'no address available' on the first try.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-27 13:12:08 -07:00
Anthony Romano efd7800e0f clientv3: try next endpoint point on unavailable error 2017-09-16 13:55:39 -07:00
Gyu-Ho Lee 6f76d52a1a *: deprecate grpc.Code, grpc.ErrorDesc
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-11 09:28:56 -07:00
Gyu-Ho Lee f65aee0759 *: replace 'golang.org/x/net/context' with 'context'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-07 13:39:42 -07:00
Anthony Romano 4669aaa9a2 clientv3: only retry mutable KV RPCs if no endpoints found
Was retrying when it shouldn't, causing multiple puts
2017-08-01 12:55:51 -07:00
Hitoshi Mitake 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
Xiang Li 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
Anthony Romano 267063efd0 clientv3: use grpc codes to translate raw grpc errors 2016-08-26 09:22:09 -07:00
Anthony Romano 3eadf964f4 clientv3: use failfast and retry wrappers for at-most-once rpcs 2016-08-16 10:49:50 -07:00