27 Commits

Author SHA1 Message Date
Xiang
109f52e3d6 clientv3: fix balancer unresponsiveness
When no address is pined, and balancer ignores the addr Up due to
its current unhealthy state, balancer will be unresponsive forever.

This PR fixes it by doing a full reset when there is no pined addr,
thus re-trigger the Up call.
2017-10-23 21:19:21 -07:00
Xiang
5943229921 clientv3: wait for current pin endpoint down on notify 2017-10-22 18:02:58 -07:00
Gyu-Ho Lee
439c97d465 clientv3: remove balancer interface
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-20 16:31:02 -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
3f596db104 clientv3: add more health balancer debugging logs
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-02 15:38:36 -07:00
Gyu-Ho Lee
090c192517 clientv3: add debugging logs, warnings
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-26 07:16:16 +09:00
Anthony Romano
efd7800e0f clientv3: try next endpoint point on unavailable error 2017-09-16 13:55:39 -07:00
Anthony Romano
84db8fdaea clientv3: health check balancer 2017-09-15 14:24:46 -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
2d0eec0b35 clientv3: goword spelling check 2017-09-06 22:11:33 -07:00
Anthony Romano
43e5f892f6 clientv3: don't race on upc/downc/switch endpoints in balancer
If the balancer update notification loop starts with a downed
connection and endpoints are switched while the old connection is up,
the balancer can potentially wait forever for an up connection without
refreshing the connections to reflect the current endpoints.

Instead, fetch upc/downc together, only caring about a single transition
either from down->up or up->down for each iteration

Simple way to reproduce failures: add time.Sleep(time.Second) to the
beginning of the update notification loop.
2017-05-02 16:43:24 -07:00
fanmin shi
a23609efe6 clientv3: update eps if pinAddr is not included in updateAddrs
FIXES #7392
2017-03-15 11:03:25 -07:00
fanmin shi
8baaa06cce clientv3: serialize updating notifych in balancer
FIXES #7283
2017-03-09 12:20:28 -08:00
fanmin shi
0c4e67c1f4 clientv3: fix balancer update address bug 2017-01-26 13:33:10 -08:00
fanmin shi
df55438a60 clientv3: balancer uses one connection at a time
FIX #7080
2017-01-17 10:09:41 -08: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
Iwasaki Yudai
6a33f0ffd5 clientv3: make balancer respect FastFail
The simpleBalancer.Get() blocks grpc.Invoke() even when the Invoke() is called
with the FailFast option. Therefore currently any requests with the
FastFail option actually doesn't fail fast. They get blocked when there is
no endpoints available.
Get() method needs to respect the BlockingWait option when
picks up an endpoint address from the list and fail immediately when the option is
enabled and no endpoint is available.
2016-10-17 14:11:51 -07:00
Gyu-Ho Lee
4a07bbec59 clientv3: implement new grpc.Balancer interface 2016-10-10 11:18:29 -07:00
Gyu-Ho Lee
cdb1e34799 clientv3: add 'Sync' method 2016-09-21 09:10:25 -07:00
Gyu-Ho Lee
b9d18d4ac9 clientv3: add 'SetEndpoints' method 2016-09-20 04:36:01 +09:00
Xiang Li
004a5f0dbc clientv3: balancer panics when call up after close
Fix the issue by adding a simple guard varable.
2016-09-15 07:43:42 +08:00
Anthony Romano
3eadf964f4 clientv3: use failfast and retry wrappers for at-most-once rpcs 2016-08-16 10:49:50 -07:00
Anthony Romano
46765ad79c clientv3: respect up/down notifications from grpc
Fixes #5842
2016-08-16 09:49:36 -07:00
Anthony Romano
4a13c9f9b3 clientv3: use grpc balancer 2016-06-08 09:24:13 -07:00