Commit Graph

366 Commits (5c60478953b46e91074a54f5f6683b8afbef8968)

Author SHA1 Message Date
Gyu-Ho Lee 1644679d00 clientv3: add 'ExampleConfig_withTLS' 2016-08-10 14:37:34 -07:00
Anthony Romano 1c83a46c6d clientv3: handle watchGrpcStream shutdown if prior to goroutine start
Fixes #6141
2016-08-09 19:59:04 -07:00
Anthony Romano 8c1c291332 clientv3/integration: test watcher cancelation propagation to server 2016-08-09 00:10:57 -07:00
Anthony Romano 5e651a0d0d clientv3: close watcher stream once all watchers detach
Fixes #6134
2016-08-09 00:10:57 -07:00
Gyu-Ho Lee ddddecc3ab clientv3: ignore sort-ascend-key option 2016-08-04 11:13:41 -07:00
Xiang Li 57c68ab1db grpcproxy: handle create event 2016-08-02 20:51:30 -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 943fe70178 clientv3: support watch filters 2016-07-27 21:24:52 -07:00
Anthony Romano ac96963003 clientv3: support creating a Watch from a WatchClient 2016-07-25 09:34:36 -07:00
Anthony Romano e001848270 Merge pull request #5772 from heyitsanthony/integration-proxy
integration: build tag for proxy
2016-07-20 16:28:12 -07:00
Anthony Romano 17e0164f57 clientv3: add KV constructor using pb.KVClient 2016-07-20 15:40:33 -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
Anthony Romano 8abae076d1 rpctypes, clientv3: retry RPC on EtcdStopped
Fixes #5983
2016-07-19 18:29:12 -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
Anthony Romano 984badeb03 testutil, clientv3: wait for panics in txn tests to complete
Fixes #5901
2016-07-18 09:37:33 -07:00
Anthony Romano d8f0ef0e80 clientv3: use grpc.FailFast(false) for all calls 2016-07-14 17:58:58 -07:00
Anthony Romano dc2dced129 Merge pull request #5892 from heyitsanthony/auth-cheap-bcrypt
auth: cheap bcrypt for tests
2016-07-07 09:04:57 -07:00
Anthony Romano 0b0cbaac09 clientv3: use cheap bcrypt for ExampleAuth and use embedded auth api
Fixes #5783
2016-07-06 23:35:14 -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
westhood 88a9cf2cea clientv3: add public function to get prefix range end 2016-07-07 10:35:40 +08:00
Xiang Li 7ec822107a *: add put prevkv 2016-07-05 20:45:01 -07:00
Xiang Li 12bf1a3382 *: rename preserveKVs to prevKv 2016-07-05 20:45:01 -07:00
Xiang Li c853704ac9 *: support get-old-kv in watch 2016-07-05 16:17:09 -07:00
Xiang Li c8c5f41a01 Merge pull request #5836 from xiang90/better_d_prev
*: support return prev deleted kv
2016-07-01 14:43:33 -07:00
Xiang Li 40c4a7894d *: support return prev deleted kv 2016-07-01 14:01:48 -07:00
davygeek 8c96d2573f *: fixed some warning 2016-06-30 23:13:46 +08:00
Xiang Li 4f57bb313f clientv3: add grpc naming resolver 2016-06-28 17:06:58 -07:00
Anthony Romano 1db4ee8c61 clientv3: only use closeErr on watch when donec is closed
Fixes #5800
2016-06-28 16:14:09 -07:00
Anthony Romano 1c25aa6c48 clientv3, ctl3, clientv3/integration: add compact response to compact 2016-06-28 09:32:31 -07:00
Gyu-Ho Lee 76e2bf03b8 etcdctl: v3 compact with physical flag 2016-06-27 12:07:46 -07:00
Gyu-Ho Lee 859e336d68 clientv3: configurable physical in compact 2016-06-27 12:04:04 -07:00
Gyu-Ho Lee 2da5bdd4df clientv3: add auth example 2016-06-22 20:06:13 -07:00
James Shubin 6480066054 *: misc typos and go vet fixes 2016-06-22 10:32:13 -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 722f5b2a8c clientv3: watch with arbitrary ctx values
Sets up a new watch stream for every unique set of ctx values.

Fixes #5354
2016-06-20 12:44:51 -07:00
Ajit Yagaty ad5d55dd4c v3api: Add a flag to RangeRequest to return only the keys.
Currently the user can't list only the keys in a prefix search. In
order to support such operations the filtering will be done on the
server side to reduce the encoding and network transfer costs.
2016-06-19 14:18:39 -07:00
Hitoshi Mitake 18253e2723 *: support getting all users and roles in auth v3
This commit expands RPCs for getting user and role and support list up
all users and roles. etcdctl v3 is now support getting all users and
roles with the newly added option --all e.g. etcdctl user get --all
2016-06-17 16:22:41 +09:00
Gyu-Ho Lee 5225a4e4bc clientv3: fix client for grpc change
Fix https://github.com/coreos/etcd/issues/5638.
2016-06-10 20:40:46 -07:00
Anthony Romano a7c5058953 Merge pull request #5608 from heyitsanthony/clientv3-auth-opts
clientv3: use separate dialopts for auth dial
2016-06-09 12:56:59 -07:00
Anthony Romano 349eaf117a clientv3: use separate dialopts for auth dial
Needs to use a different balancer from the main client connection
because of the way grpc uses the Notify channel.
2016-06-09 10:38:57 -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
Anthony Romano e534532523 clientv3: close keep alive channel if no response within TTL 2016-06-09 09:12:59 -07:00
Gyu-Ho Lee a548cab828 Merge pull request #5602 from gyuho/get_leader
clientv3/integration: WaitLeader to follower
2016-06-08 17:03:25 -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
Hitoshi Mitake 253e313c09 *: support granting and revoking range
This commit adds a feature for granting and revoking range of keys,
not a single key.

Example:
$ ETCDCTL_API=3 bin/etcdctl role grant r1 readwrite k1 k3
Role r1 updated
$ ETCDCTL_API=3 bin/etcdctl role get r1
Role r1
KV Read:
        [a, b)
        [k1, k3)
        [k2, k4)
KV Write:
        [a, b)
        [k1, k3)
        [k2, k4)
$ ETCDCTL_API=3 bin/etcdctl --user u1:p get k1 k4
k1
v1
$ ETCDCTL_API=3 bin/etcdctl --user u1:p get k1 k5
Error:  etcdserver: permission denied
2016-06-08 14:58:25 -07:00
Anthony Romano 4a13c9f9b3 clientv3: use grpc balancer 2016-06-08 09:24:13 -07:00
Anthony Romano 62f8ec25c0 clientv3: use grpc reconnection logic 2016-06-08 01:04:59 -07:00
Gyu-Ho Lee 1e4d3603db clientv3,ctlv3: following changes for proto change 2016-06-07 13:32:36 -07:00
Xiang Li 83ce1051ff auth: make naming consistent 2016-06-07 10:54:50 -07:00
Hitoshi Mitake 94f22e8a07 *: rename RPCs and structs related to revoking
This commit renames RPCs and structs related to revoking.
1. UserRevoke -> UserRevokeRole
2. RoleRevoke -> RoleRevokePermission
2016-06-05 16:57:23 +09:00
Xiang Li 429b2eee58 Merge pull request #5548 from mitake/auth-v3-revoke-delete
revoke user, revoke role, and delete role in auth v3
2016-06-03 21:44:37 -07:00
Hitoshi Mitake c7a1423d45 *: support deleting a role in auth v3
This commit implements RoleDelete() RPC for supporting deleting a role
in auth v3. It also adds a new subcommand "role delete" to etcdctl.
2016-06-04 13:42:45 +09:00
Hitoshi Mitake 0cb1343109 *: support revoking a key from a role in auth v3
This commit implements RoleRevoke() RPC for supporting revoking a key
from a role in auth v3. It also adds a new subcommand "role revoke" to
etcdctl.
2016-06-04 13:42:45 +09:00
Hitoshi Mitake 957b07c408 *: support revoking a role from a user in auth v3
This commit implements UserRevoke() RPC for supporting revoking a role
from a user in auth v3. It also adds a new subcommand "user revoke" to
etcdctl.
2016-06-04 13:39:26 +09: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 7dfe7db243 clientv3: panic if ActiveConnection tries to return non-nil connection 2016-06-03 10:25:20 -07:00
Anthony Romano 267d1cb16f clientv3: fix watch to reconnect on failure
It was spinning before.
2016-06-03 10:25:20 -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
Hitoshi Mitake 10ee69b44c *: support getting role in auth v3
This commit implements RoleGet() RPC of etcdserver and adds a new
subcommand "role get" to etcdctl v3. It will list up permissions that
are granted to a given role.

$ ETCDCTL_API=3 bin/etcdctl role get r1
Role r1
KV Read:
        b
        d
KV Write:
        a
        c
        d
2016-06-03 13:03:54 +09:00
Anthony Romano 84a487f723 Revert "etcdserverpb: make RangeResponse.More an int64"
This reverts commit 84e1ab8765.
2016-06-02 13:43:40 -07:00
Hitoshi Mitake 5609fdb9a8 *: support getting user in etcdctl v3
This commit adds a new subcommand "user get" to etcdctl v3. It will
list up roles that are granted to a given user.

Example:
$ ETCDCTL_API=3 bin/etcdctl user get u1
User: u1
Roles: r1 r2 r3

This commit also modifies the layout of InternalRaftRequest for
frequent update of auth related members.
2016-06-02 12:10:19 +09:00
Anthony Romano b95c5b7da9 Merge pull request #5526 from heyitsanthony/more-to-int64
etcdserverpb: make RangeResponse.More an int64
2016-06-01 20:03:15 -07:00
Anthony Romano 84e1ab8765 etcdserverpb: make RangeResponse.More an int64 2016-06-01 17:10:23 -07:00
Anthony Romano fb64c8ccfe Merge pull request #5521 from heyitsanthony/clientv3-hide-retrydial
clientv3: hide retry dial api
2016-06-01 13:00:02 -07:00
Anthony Romano 22744566f4 clientv3: hide retry dial api 2016-06-01 11:36:16 -07:00
Gyu-Ho Lee 75dc10574a clientv3: watch resp with error when client close 2016-06-01 10:39:48 -07:00
Xiang Li 9ed3b446ca Merge pull request #5509 from heyitsanthony/clientv3-fix-concurrent-close
clientv3: fix deadlock on Get with concurrent Close
2016-06-01 07:37:28 -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
Anthony Romano 51551abef5 concurrency, benchmark: read-committed STM isolation policy 2016-05-31 14:35:27 -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
Gyu-Ho Lee d116c116fe clientv3: getRemote comment about release 2016-05-31 12:00:19 -07:00
Gyu-Ho Lee 9a0fe2620e clientv3: fix panic message in OpPut 2016-05-28 11:55:28 -07:00
Anthony Romano 9dc0782f45 clientv3: handle URL scheme when given in endpoint
Fixes #5427
2016-05-25 18:01:36 -06:00
James Shubin 374b3ee40b clientv3: fix typo 2016-05-20 17:18:52 -04:00
James Shubin edca3cbe44 clientv3: Fix typos
Found randomly when going through docs. HTH
2016-05-20 14:06:29 -04:00
Gyu-Ho Lee fa1e40c120 clientv3/concurrency: preallocate slice in stm 2016-05-19 14:42:19 -07:00
Gyu-Ho Lee f9306fb817 clientv3: preallocate watch streams slice
To avoid slice growth when appending
2016-05-19 12:55:55 -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
Anthony Romano 782a8802c0 clientv3: avoid reusing closed connection in KV 2016-05-18 14:46:17 -07:00
Gyu-Ho Lee 86c85b88ad Merge pull request #5377 from purpleidea/bug/typos
clientv3: fix typos
2016-05-17 12:51:13 -07:00
James Shubin 42f3b4964f clientv3: fix typos 2016-05-17 15:39:56 -04: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
Anthony Romano e8101ddf09 clientv3: throttle reconnection rate
Client was reconnecting after establishing connections because the lease
and watch APIs were thrashing. Instead, wait a little before accepting
new reconnect requests.
2016-05-16 11:14:45 -07:00
Xiang Li ec2ac72585 proxy: initial grpc kv service proxy 2016-05-13 23:00:29 -07: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
Anthony Romano 120020fa9c clientv3/concurrency: use session id for election keys to avoid deadlock 2016-05-13 10:07:35 -07:00
Anthony Romano 393725fe5f clientv3/concurrency: ctx-ize Leader(), Resign(), and Unlock() 2016-05-13 10:07:35 -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
Xiang Li 0d43a2b7e7 Merge pull request #5295 from ajityagaty/auth_disable
auth: Adding support for "auth disable" command.
2016-05-07 23:09:37 -07:00
Ajit Yagaty adc981c53d auth: Adding support for "auth disable" command.
Added support for the auth disable command in the server, added the
etcdctl command and a respective testcase.
2016-05-07 19:21:49 -07:00
Anthony Romano 712090fc09 clientv3: keep watcher client active if reconnect has network error
Otherwise watchers created after a long disconnect period will always
close immediately.
2016-05-05 19:30:11 -07:00
Anthony Romano 22c3a439bc clientv3: do not stop lease client on lost receive stream
Fixes #5242
2016-05-05 19:30:11 -07:00
Anthony Romano cdc8f99658 clientv3: rework reconnection logic
Avoids go routine flood for tight loops with a dead connection.
Now uses request ctx when reconnecting for immediate retry.
2016-05-05 19:30:11 -07:00