-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add support for health service in gRPC server #9528
Conversation
cf63c9e
to
e4db397
Compare
Signed-off-by: Shichao An <shichaoan.cn@gmail.com>
e4db397
to
501f545
Compare
This doesn't break anything, but I'm not exactly convinced that the generic GRPC health service API makes sense for Vitess, as our health status is already exposed via other APIs and it is more complex than what this generic API provides (most notably, Vitess distinguishes between serving/not serving -- which applies to queries but not the GRPC interface itself, and cannot be modelled with this API). Is there a particular use case you have in mind for wiring up this API? If you're trying to health check a specific service in a Vitess cluster, I would recommend you use the GRPC APIs which we already provide and that relay much more relevant information about the actual health status of the Vitess cluster and its services. Cheers. |
@vmg Our Service Networking infrastructure uses Envoy health check (link), which requires "grpc.health.v1.health" service endpoint and an optional service name (for example, "vtgateservice.Vitess") to send to this endpoint. Almost all our gRPC services have "grpc.health.v1.health" and that's why SN team made that assumption without supporting custom health endpoint for gRPC (they do support custom HTTP endpoint, but only for HTTP services). Without "grpc.health.v1.health", the Envoy HC simply fails. On the higher level, it is for Envoy to determine load balancing semantics such as panic mode, so it doesn't really matter whether it is serving/not_serving from Vitess's perspective. |
Sounds good to me. Have you tested that this change makes your Envoy work in your infrastructure? From looking at the Godoc for the HealthCheck API, it seems like you may need to call |
@vmg Need your input on this as well, since by default our gRPC applications use a custom health check that implements the standard Health service interface (something like this, So if I only registered the default Server (as in this PR) like this I think for Vitess gRPC server (which is used by vtgate, vttablet, etc.), if we want to explicitly set serving services, we can simply use vitess/go/vt/vtadmin/grpcserver/server.go Line 228 in f88d121
|
The code seen in that commit looks good to me. Iterating the services and calling |
Signed-off-by: Shichao An <shichaoan.cn@gmail.com>
Done. Here are the local tests I've done. Make and start local docker:
Test gRPC calls using grpcurl
|
@vmg Thank you! |
Description
servenv.GRPCServer
Related Issue(s)
Fixes #9333
Checklist
Deployment Notes