204 Commits

Author SHA1 Message Date
Anthony Romano
1d3afd4bb5 etcdhttp, v2http, etcdserver: use etcdserver.{Server,ServerV2} interfaces 2017-08-31 11:47:40 -07:00
fanmin shi
d2ca782277 v3rpc: limit recv size using MaxRecvMsgSize and send using MaxSendMsgSize
grpc 1.3 uses MaxMsgSize() to limit received message size. However, grpc 1.4 introduces a 4mb default limit on send message size. In etcd, server shouldn't be limit size of message that it can be sent. Hence, set maximum size of send message using MaxSendMsgSize().
2017-08-22 14:31:01 -07:00
Anthony Romano
35dffc7bc1 rpctypes,v3rpc: add Corrupt error code 2017-08-22 09:59:59 -07:00
Gyu-Ho Lee
d25ae50c02 etcdserver: implement LeaseLeases API
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-08-14 14:18:56 -07:00
Xiang Li
2a348fb8e9 Merge pull request #8263 from fanminshi/hash_by_rev
api: hash by rev
2017-07-26 11:22:33 -07:00
Anthony Romano
6fb08672d8 v3rpc: set canceled=true when stream is compacted
Fixes #8231
2017-07-25 12:36:01 -07:00
fanmin shi
fbb75d24a4 v3rpc: add HashKV to server rpc 2017-07-14 16:44:00 -07:00
Iwasaki Yudai
52101e6e93 v3rpc: Let clients establish unlimited streams
From go-grpc v1.2.0, the number of max streams per client is set to 100
by default by the server side. This change makes it impossible
for third party proxies and custom clients to establish many streams.
2017-07-11 13:02:01 -07:00
Gyu-Ho Lee
b1a0ae3a3e etcdserver/api/v3rpc: add 'MoveLeader' to 'maintenanceServer'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-06-23 12:51:24 -07:00
Gyu-Ho Lee
939bbd77c0 etcdserver/*: add 'ErrNotLeader'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-06-23 12:46:07 -07:00
Anthony Romano
6ed51dc621 etcdserver, v3rpc: support nested txns 2017-06-21 14:33:15 -07:00
Gyu-Ho Lee
c1e3172e3a etcdserver/api/v3rpc: add default grpc health service 2017-06-20 10:48:06 -07:00
Gyu-Ho Lee
5e059fd8dc *: use metadata Incoming/OutgoingContext
Fix https://github.com/coreos/etcd/issues/7888.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-06-15 16:41:23 -07:00
Anthony Romano
fb086ef13f v3rpc: dedup resp.Header == nil checks 2017-06-07 09:25:42 -07:00
Anthony Romano
8542f2e673 v3rpc: use map for translating errors to grpc errors
Switch statement had poor coverage, use a map instead
2017-06-06 16:55:44 -07:00
Anthony Romano
d8210da505 v3rpc: treat nil txn request op as error
Fixes #7889
2017-05-31 12:39:52 -07:00
fanmin shi
68a72c6b6e v3rpc: change grpc max recv size as needed. 2017-05-25 11:01:51 -07:00
fanmin shi
e9f464debc integration: creation of cluster now takes maxTxnOps 2017-05-24 14:48:44 -07:00
fanmin shi
ae7ddfb483 etcdserver: add --max-txn-ops flag
--max-txn-ops allows users to define the maximum transaction operations
for each txn request. it defaults at 128.

Fixes #7826
2017-05-24 10:32:32 -07:00
Hitoshi Mitake
939912c425 clientv3, etcdserver: support auth in Watch() 2017-05-20 11:34:45 +09:00
Iwasaki Yudai
010ffc0692 v3rpc: remove duplicated error case for lease.ErrLeaseNotFound 2017-05-08 20:09:41 -07:00
Xiang Li
957c9cd1df Merge pull request #7734 from mitake/status-auth
etcdserver: let Status() not require authentication
2017-04-13 15:53:33 -07:00
Hitoshi Mitake
67f2e41f20 etcdserver: let Status() not require authentication
The information that can be obtained with the RPC doesn't need to be
protected.

Fix https://github.com/coreos/etcd/issues/7721
2017-04-13 17:39:09 +09:00
Anthony Romano
d9ec6b4d22 *: return updated member list in v3 rpcs
Now it's possible to atomically know the new member configuration from
issuing a membership change RPC.
2017-04-12 16:24:51 -07:00
Anthony Romano
135a40751e v3rpc: force RangeEnd=nil if length is 0
gRPC will replace empty strings with nil, but for the embedded case it's
possible for []byte{} to slip in and confuse the single key / >= key
watch logic.
2017-04-07 16:36:38 -07:00
Anthony Romano
833769f59f v3rpc: return leader loss error if lease stream is canceled
Canceling the stream won't cancel the receive since it's using the internal
grpc context, not the one assigned by etcd.
2017-03-30 20:18:33 -07:00
Hitoshi Mitake
c40b86bcde auth, etcdserver: forbid invalid auth management
If auth is enabled,
1. deleting the user root
2. revoking the role root from the user root
must not be allowed. This commit forbids them.
2017-03-23 16:47:58 +09:00
fanmin shi
2ca1823a96 v3rpc: LeaseTimeToLive returns TTL=-1 resp on lease not found 2017-02-10 16:33:31 -08:00
Hitoshi Mitake
0191509637 auth, etcdserver: authenticate clients based on certificate CommonName
This commit lets v3 auth mechanism authenticate clients based on
CommonName of certificate like v2 auth.
2017-01-31 17:22:12 +09:00
sharat
5ac4e4255a v3rpc: error for non empty lease with 'ignore_lease' 2017-01-25 03:04:07 +05:30
Xiang Li
26d99269c0 Merge pull request #6898 from mitake/auth-maintain
RFC, WIP: etcdserver: let maintenance services require root role
2017-01-14 11:22:14 -08:00
Hitoshi Mitake
9886e9448e auth, etcdserver: let maintenance services require root role
This commit lets maintenance services require root privilege. It also
moves AuthInfoFromCtx() from etcdserver to auth pkg for cleaning purpose.
2017-01-14 19:36:24 +09:00
Gyu-Ho Lee
e655420d33 v3rpc: error for non-empty value with ignore_value 2017-01-13 15:13:18 -08: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
Gyu-Ho Lee
2b5f9e1c6b etcdserver: expose ErrNotEnoughStartedMembers
Fix https://github.com/coreos/etcd/issues/7072.
2017-01-03 15:23:06 -08:00
Anthony Romano
87b1d9571f v3api, rpctypes: add ErrTimeoutDueToConnectionLost
Lack of GRPC code was causing this to look like a halting error to the client.
2016-12-16 10:25:35 -08:00
Gyu-Ho Lee
eb8646a381 v3rpc: remove unused 'splitMethodName' function 2016-12-12 10:07:14 -08:00
Anthony Romano
be1f36d97c v3rpc, etcdserver, leasehttp: ctxize Renew with request timeout
Would retry a few times before returning a not primary error that
the client should never see. Instead, use proper timeouts and
then return a request timeout error on failure.

Fixes #6922
2016-12-06 14:09:57 -08:00
Anthony Romano
9a20743190 v3rpc: don't close watcher if client closes send
grpc-gateway will CloseSend but still want to receive updates.
2016-11-17 15:33:37 -08:00
Gyu-Ho Lee
5e810e30cc v3rpc: replace grpc metrics w/ go-grpc-prometheus
And disable histogram
2016-11-14 15:20:09 -08:00
Gyu-Ho Lee
67082e5bd1 v3rpc: add gRPC active streamsGauge 2016-11-04 11:09:20 -07:00
Hitoshi Mitake
f85701a46f auth, etcdserver: forbid adding a user with empty name 2016-11-03 13:45:39 +09:00
fanmin shi
ea9e857eb9 Merge pull request #6599 from fanminshi/lease_error_type_fix
Lease: Add lease errors to togRPCError()
2016-10-06 15:47:51 -07:00
fanmin shi
a862fd9f0f Lease: Add lease errors to togRPCError()
This allows lease's function to convert lease error to appropriate GRPC errors
2016-10-06 14:29:31 -07:00
Xiang Li
10cafe56b8 v3rpc: return nil as error explicitly 2016-10-06 14:14:43 -07:00
Xiang Li
962433c17f *: set repo correctly for logging 2016-10-03 17:03:22 +08:00
Gyu-Ho Lee
63b0cd470d etcdserver: implement 'LeaseTimeToLive' 2016-09-09 08:14:14 +09:00
Anthony Romano
1defeda792 v3api, rpctypes: add ErrUnhealthy 2016-09-07 16:51:49 -07:00
Anthony Romano
64ac631863 rpctypes: set unknown codes to Unknown instead of internal
An unrecognized error code isn't "very broken".
2016-08-28 19:37:35 -07:00
Anthony Romano
df54ad2208 v3rpc, rpctypes: add error types for timeouts 2016-08-26 09:22:09 -07:00