Commit Graph

243 Commits

Author SHA1 Message Date
02f4a9a034 client: add GetVersion method
For retrieving etcdserver and etcdcluster version
2017-01-23 18:52:39 -08:00
9c364efef6 client: update generated ugorji codec 2016-12-06 07:53:47 +01:00
ad16b63cce client: update README about health monitoring 2016-11-28 12:28:33 -08:00
4f60f1b71f Merge pull request #6708 from bluepeppers/leader-sync-deadlock
client: Prevent deadlocks in Sync
2016-11-01 14:11:21 -07:00
de008c8a4a client: prevent deadlock in Sync 2016-11-01 17:26:53 +00:00
43df091067 client: Return the server's cluster ID as part of the Response
This allows the client to spot if the cluster ID changes, which
would indicate that the cluster has been rebuilt and watches may be
out of sync.

Helps work around #6652.
2016-10-24 14:51:00 +01:00
fb39e96862 client: change to 'NoValueOnSuccess' 2016-08-30 10:52:58 -07:00
82053f04b2 client: do not send previous node data (optional)
- Do not send back node data when specified
- remove node and prevNode when noDataOnSuccess is set
2016-08-30 10:04:09 -07:00
449923c98b build: support go install github.com/coreos/etcd/cmd/etcd
Could build via github.com/coreos/etcd/cmd but that would generate a binary
named "cmd", which is not ideal.
2016-08-15 15:08:41 -07:00
564bf8d17e client: utility functions for getting detail of v2 auth errors
Current v2 auth API doesn't propagate its error code. This commit adds
utility functions for parsing error messages and getting detail of v2
auth errors.

Fixes https://github.com/coreos/etcd/issues/5894
2016-07-31 21:23:58 +09:00
c30f89f1d0 client/integration: test v2 client one shot operations 2016-07-07 15:58:58 -07:00
946b3cce1d client: make set/delete one shot operations
Old behavior would retry set and delete even if there's an error. This
can lead to the client returning an error for deleting twice, instead
of returning an error for an interdeterminate state.

Fixes #5832
2016-07-07 15:51:08 -07:00
7f3b2e23a4 Merge pull request #5811 from davygeek/golintnotice
client: follow golint notice change errors.New to fmt.Errorf
2016-06-29 09:12:49 -07:00
3b91648070 client: follow golint notice change errors.New to fmt.Errorf and use 'var eps []string' instead 'var make([]string, 0)' 2016-06-29 13:21:49 +08:00
8e825de35f Merge pull request #5513 from vikstrous/clustererror
improve error message for ClusterError
2016-06-28 18:15:35 -07:00
da85108ca2 client: improve error message for ClusterError 2016-06-22 13:13:12 -07:00
e2138179e3 client: fix from go vet, go lint 2016-06-22 12:04:15 -07:00
ef44f71da9 *: update LICENSE header 2016-05-12 20:51:48 -07:00
c9ce92f635 client: accept roles in response for ListUser
Fixes #5046
2016-04-12 12:48:43 -07:00
78554c6de6 *: client vendoring README 2016-04-08 19:48:17 -07:00
6e6d64fb9b *: clean up unused vars, functions
With help from https://github.com/dominikh/go-unused.
IsNetTimeoutError seems useful, so moved to pkg/netutil.
2016-04-06 21:33:55 -07:00
b8d3b15206 *: document client package vendoring guide 2016-03-30 09:34:41 -07:00
8d0d10cce5 client: return original ctx error
Fix https://github.com/coreos/etcd/issues/3209.
2016-03-29 16:57:48 -07:00
9d49d35090 client: doc that client is thread-safe 2016-03-29 09:28:53 -07:00
86a477c2f6 doc: update client README to use vendor/ 2016-03-22 18:02:10 -07:00
bd832e5b0a *: migrate Godeps to vendor/ 2016-03-22 17:10:28 -07:00
25e47db416 client: drop go1.4 tests 2016-03-18 18:44:56 -07:00
9809da95da client: correctly unmarshal roles in ListRoles 2016-03-05 19:42:58 -08:00
2a0d64bb4a client: correctly unmarshal users in ListUsers 2016-03-05 19:42:58 -08:00
868728e5b5 client: if User unmarshal fails, decode user using full roles
Fixes #3702
2016-03-04 16:02:35 -08:00
4ffe823c67 client: fix go vet error at tip 2016-03-01 15:37:05 -08:00
7b57550484 client: minor typo fix 2016-02-26 15:16:00 -05:00
afa0368dcc *: fix godoc bugs in interfaces and slice fields
detected with goword
2016-02-24 00:45:40 -08:00
c5b51946eb *: exported godoc fixups 2016-02-21 20:36:44 -08:00
82778ed478 Add refresh parameter to allow TTL refreshes without firing watch/wait responses 2016-02-08 10:37:37 -07:00
20461ab11a *: fix many typos 2016-01-31 21:42:39 -08:00
5490db7cca client: fix typo in docstring (than -> then) 2016-01-28 18:07:39 +01:00
bbb7fb5a46 client: do not timeout when wait is true
Current V2 watch waits by encoding URL with wait=true.
When a client sets 'no-sync', it requests directly to
proxy and the proxy redirects it by cloning the request
object, which leads to cancel the original request when
it times out and the cloned request gets closed prematurely.

This fixes coreos#3894 by querying
the original client request in order to not use context timeout
when 'wait=true'.
2016-01-21 18:45:15 -08:00
2a3bd01f58 *: move EndpointSelection doc to godoc
This merges two redundant documentation into one.
2016-01-21 09:48:05 -08:00
d2d70513a1 Merge pull request #4185 from xiang90/client-srv
*: support client srv target
2016-01-13 11:26:35 -08:00
bfa21001a1 *: support client srv target 2016-01-13 11:12:15 -08:00
3ac8ff3a84 client: keys.go minor typo 2016-01-13 11:02:37 -08:00
f67f6d7c7c client: add IsKeyNotFound function
This can be used to check if an error is client.ErrorCodeKeyNotFound.
Related to https://github.com/coreos/etcd/issues/4080.
2016-01-12 20:04:08 -08:00
dac56faf61 Merge pull request #4030 from mitake/endpoint-selection
client: add a mechanism for various endpoint selection mode
2015-12-24 12:55:16 +01:00
a46ffc60e5 client: add a mechanism for various endpoint selection mode
Current etcd client library chooses a default destination node from
every member of a cluster in a random manner. However, requests of
write and read (for consistent results) need to be forwarded to the
leader node as the nature of Raft algorithm. If the chosen node is a
follower, additional network traffic will be caused by the forwarding
from follower to leader.

Mainly for reducing the forward traffic, this commit adds a new
mechanism for various endpoint selection mode to the client library
which can be configured with client.Config.SelectionMode.

Currently, two modes are provided:
 - EndpointSelectionRandom: default, same to existing behavior (pick
   a node in a random manner)
 - EndpointSelectionPrioritizeLeader: prioritize leader, for the above
   purpose

I evaluated the effectiveness of the EndpointSelectionPrioritizeLeader
with 4 t1.micro instances of AWS (3 nodes for etcd cluster and 1 node
for etcd client). Client executes this simple benchmark
(https://github.com/mitake/etcd-things/tree/master/prioritize-leader-bench),
just writes 10000 keys. When SelectionMode == EndpointSelectionRandom
(default), the benchmark needed 1 min and 32.102 sec to finish. When
SelectionMode == EndpointSelectionPrioritizeLeader, the benchmark
needed 1 min 4.760 sec.
2015-12-24 11:02:40 +09:00
53be8405f3 client: a new API for obtaining a leader node information 2015-12-23 22:54:04 +09:00
5587c4aa9a client: support reset Endpoints.
ResetEndpoints is useful when the there is a scheduled cluster
changes or when manually manage the cluster without auto-sync
enabled.
2015-12-21 11:59:13 -08:00
88aec09ddf client: fixes for govet -shadow
This fixes for shadowed error variables found by go tip go tool vet.
Fixes for https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:13:07 -08:00
938333a9fe client/README: correct Endpoints param 2015-12-09 20:49:52 -08:00
cb9a3e04b1 client: fix goroutine leak in unreleased context
If headerTimeout is not zero then two context are created but only one is released.
cancelCtx in this case is never released which leads to goroutine leak inside it.
2015-11-27 19:44:38 +03:00