Merge pull request #12706 from ptabor/20210218

clientv3: PS: Replace balancer with upstream grpc solution
This commit is contained in:
Piotr Tabor
2021-02-23 10:56:20 +01:00
committed by GitHub
11 changed files with 216 additions and 73 deletions

View File

@@ -208,7 +208,13 @@ func startGRPCProxy(cmd *cobra.Command, args []string) {
}()
client := mustNewClient(lg)
proxyClient := mustNewProxyClient(lg, tlsinfo)
// The proxy client is used for self-healthchecking.
// TODO: The mechanism should be refactored to use internal connection.
var proxyClient *clientv3.Client
if grpcProxyAdvertiseClientURL != "" {
proxyClient = mustNewProxyClient(lg, tlsinfo)
}
httpClient := mustNewHTTPClient(lg)
srvhttp, httpl := mustHTTPListener(lg, m, tlsinfo, client, proxyClient)

View File

@@ -56,6 +56,9 @@ func checkHealth(c *clientv3.Client) etcdhttp.Health {
}
func checkProxyHealth(c *clientv3.Client) etcdhttp.Health {
if c == nil {
return etcdhttp.Health{Health: "false", Reason: "no connection to proxy"}
}
h := checkHealth(c)
if h.Health != "true" {
return h