-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: refactor clientv3 balancer, upgrade gRPC to v1.7.2 #8840
Conversation
8f3298c
to
171d291
Compare
b382fd9
to
b08eac4
Compare
f4f7817
to
eef8ecf
Compare
let us focus on existing test. not #8841 |
can we remove the new test out of this? |
eef8ecf
to
be80e48
Compare
@gyuho why this is closed? |
004ca1a
to
345e89d
Compare
f85a0db
to
44ad0ae
Compare
c2deb20
to
936229e
Compare
I ran test suites several times in other VMs: they all pass, except coverage tests...
Do we want to block on this? |
No. The coverage thing is a separate issue I believe. I am going to review the whole thing tomorrow, and hopefully get this merged. |
936229e
to
4bbb03e
Compare
clientv3/retry.go
Outdated
@@ -62,6 +62,11 @@ func (c *Client) newRetryWrapper(isStop retryStopErrFunc) retryRPCFunc { | |||
if logger.V(4) { | |||
logger.Infof("clientv3/retry: error %q on pinned endpoint %q", err.Error(), pinned) | |||
} | |||
// retry when initial connection has not been established | |||
// grpc/grpc-go >v1.7.x (balancer v1 wrapper) | |||
if rpctypes.ErrorDesc(err) == "there is no connection available" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make the error msg as a const?
097252d
to
4985bd0
Compare
clientv3/health_balancer_test.go
Outdated
@@ -66,8 +66,8 @@ func TestBalancerGetUnblocking(t *testing.T) { | |||
} | |||
|
|||
down1(errors.New("error")) | |||
if addrs := <-sb.Notify(); len(addrs) != len(endpoints) { | |||
t.Errorf("closing the only connection should triggered balancer to send the all endpoints via Notify chan so that we can establish a connection") | |||
if addrs := <-sb.Notify(); len(addrs) != 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
len(addrs) != len(endpoints) - 1 // we call down on one endpoint
clientv3/health_balancer_test.go
Outdated
@@ -121,8 +121,8 @@ func TestBalancerGetBlocking(t *testing.T) { | |||
} | |||
|
|||
down1(errors.New("error")) | |||
if addrs := <-sb.Notify(); len(addrs) != len(endpoints) { | |||
t.Errorf("closing the only connection should triggered balancer to send the all endpoints via Notify chan so that we can establish a connection") | |||
if addrs := <-sb.Notify(); len(addrs) != 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
len(addrs) != len(endpoints) - 1 // we call down on one endpoint
ca99730
to
3ca6d9e
Compare
lgtm if CI is reliably passing. |
c417ed1
to
335d8a6
Compare
Signed-off-by: Gyu-Ho Lee <[email protected]>
Signed-off-by: Gyu-Ho Lee <[email protected]>
…erClose Signed-off-by: Gyu-Ho Lee <[email protected]>
Signed-off-by: Gyu-Ho Lee <[email protected]>
Signed-off-by: Gyu-Ho Lee <[email protected]>
335d8a6
to
c669ff9
Compare
I'm wondering if the gRPC proxy uses this enough to put in front of older clients so that I can get this behavior until I can get them on updated to use this directly. |
Copying from slack conversation: gRPC Proxy is implemented as an etcd client wrapper, so if the gRPC Proxy is built with latest v3.2 release, it should support failover. But, "client talking to gRPC Proxy" may not work as well as regular client talking to core etcd server, because we do not support keepalive ping in gRPC proxy layer yet. Need more tests around gRPC proxy. |
If we want to notify only healthy addresses, we need a way to look up an endpoint is healthy or not, which is tracked in
healthBalancer
. This combineshealthBalancer
andsimpleBalancer
. Plus, they already have many redundant fields (e.g.eps
,hostPort2eps
, etc.).Fix #8828.