Skip to content
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

L9: new balancer and resolver APIs for gRPC-go #30

Merged
merged 6 commits into from
Feb 6, 2018

Conversation

menghanl
Copy link
Contributor

@menghanl menghanl commented Jul 24, 2017

The new API will support:

  • switching balancers based on service config
  • get service config updates from resolver

Tracking issue: grpc/grpc-go#1388


## Abstract

The current balancer API in gRPC-go cannot suport balancer hot switching. There are also other issues related to balancer, resolver and connectivity state.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: s/suport/support


#### Connection up and down

gRPC notifies the balancer of addresses to which the connection is established or lost. So balancer can make load balancing decisions based on the connection status.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how will this interact with health checking? if http2 or customized health checker fails, will the connection change state to lost, and will the balancer get notified?

Copy link
Contributor Author

@menghanl menghanl Oct 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gRPC notices a connection is lost when it fails to read-from/write-to the connection. (We also have keepalive package for point-to-point healthcheck, that could force close a transport in some situation).

If there's another custom health checker reporting unhealthy but the connection is actually working, gRPC will not notice that.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's another custom health checker reporting unhealthy but the connection is actually working, gRPC will not notice that.

we probably need a hook for that too. Or we have to manually close that connection somehow.

for quorum based systems, network partitioned server (partitioned from the majority of its peers) is not really usable for some types of RPC although the network between that server and client is OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, I think it would make more sense for the health checker to communicate to the balancer directly, not through gRPC.

This is what we do in grpclb. grpclb connects to a remote balancer, and the remote balancer decides which backends to connect and which to disconnect.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what you suggest is what we are doing right now. but then down (or done) func will have multiple consumers, and i feel it is less cleaner. i will take a look at grpcLB code.

thank you.

@hsaliak
Copy link
Contributor

hsaliak commented Feb 2, 2018

@dfawley @menghanl please merge this gRFC

@menghanl menghanl merged commit ec00555 into grpc:master Feb 6, 2018
@menghanl menghanl deleted the balancer_api branch February 6, 2018 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants