2021-10-20 19:41:37 +08:00
|
|
|
// Licensed to the LF AI & Data foundation under one
|
|
|
|
// or more contributor license agreements. See the NOTICE file
|
|
|
|
// distributed with this work for additional information
|
|
|
|
// regarding copyright ownership. The ASF licenses this file
|
|
|
|
// to you under the Apache License, Version 2.0 (the
|
|
|
|
// "License"); you may not use this file except in compliance
|
2021-04-19 10:09:43 +08:00
|
|
|
// with the License. You may obtain a copy of the License at
|
|
|
|
//
|
2021-10-20 19:41:37 +08:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2021-04-19 10:09:43 +08:00
|
|
|
//
|
2021-10-20 19:41:37 +08:00
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
2021-04-19 10:09:43 +08:00
|
|
|
|
2021-06-22 14:40:07 +08:00
|
|
|
package grpcproxy
|
2021-01-22 09:36:18 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2022-05-10 20:05:53 +08:00
|
|
|
"crypto/tls"
|
|
|
|
"crypto/x509"
|
2021-02-26 17:44:24 +08:00
|
|
|
"fmt"
|
2021-02-23 09:58:06 +08:00
|
|
|
"io"
|
2022-05-10 20:05:53 +08:00
|
|
|
"io/ioutil"
|
2021-01-22 09:36:18 +08:00
|
|
|
"net"
|
2022-02-23 14:37:52 +08:00
|
|
|
"net/http"
|
2022-10-14 09:59:24 +08:00
|
|
|
"os"
|
2021-01-22 09:36:18 +08:00
|
|
|
"strconv"
|
|
|
|
"sync"
|
2021-01-28 20:51:44 +08:00
|
|
|
"time"
|
|
|
|
|
2022-11-10 17:09:06 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/proxy/accesslog"
|
2022-10-14 09:59:24 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/util/metricsinfo"
|
|
|
|
|
2022-02-23 14:37:52 +08:00
|
|
|
"github.com/gin-gonic/gin"
|
2022-09-26 18:06:54 +08:00
|
|
|
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
|
|
|
grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
|
2021-12-20 16:43:05 +08:00
|
|
|
ot "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
|
2022-10-16 20:49:27 +08:00
|
|
|
"github.com/milvus-io/milvus-proto/go-api/commonpb"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/milvuspb"
|
2021-12-20 16:43:05 +08:00
|
|
|
dcc "github.com/milvus-io/milvus/internal/distributed/datacoord/client"
|
|
|
|
icc "github.com/milvus-io/milvus/internal/distributed/indexcoord/client"
|
2022-02-23 14:37:52 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/distributed/proxy/httpserver"
|
2021-12-20 16:43:05 +08:00
|
|
|
qcc "github.com/milvus-io/milvus/internal/distributed/querycoord/client"
|
2021-06-18 21:30:08 +08:00
|
|
|
rcc "github.com/milvus-io/milvus/internal/distributed/rootcoord/client"
|
2021-04-22 14:45:57 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/log"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/internalpb"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/proxypb"
|
2021-06-22 14:40:07 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/proxy"
|
2021-12-20 16:43:05 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/types"
|
2022-04-07 22:05:32 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/util/dependency"
|
2021-12-29 14:35:21 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/util/etcd"
|
2021-04-22 14:45:57 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/util/funcutil"
|
2022-08-23 10:44:52 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/util/logutil"
|
2021-12-17 10:23:15 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/util/paramtable"
|
2021-04-22 14:45:57 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/util/trace"
|
2021-12-17 10:23:15 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/util/typeutil"
|
2022-09-26 18:06:54 +08:00
|
|
|
"github.com/opentracing/opentracing-go"
|
|
|
|
clientv3 "go.etcd.io/etcd/client/v3"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
"google.golang.org/grpc/codes"
|
|
|
|
"google.golang.org/grpc/credentials"
|
|
|
|
"google.golang.org/grpc/health/grpc_health_v1"
|
|
|
|
"google.golang.org/grpc/keepalive"
|
|
|
|
"google.golang.org/grpc/status"
|
2021-01-22 09:36:18 +08:00
|
|
|
)
|
|
|
|
|
2021-12-17 10:23:15 +08:00
|
|
|
var Params paramtable.GrpcServerConfig
|
2022-02-23 14:37:52 +08:00
|
|
|
var HTTPParams paramtable.HTTPConfig
|
2021-12-17 10:23:15 +08:00
|
|
|
|
2022-04-11 19:49:34 +08:00
|
|
|
var (
|
|
|
|
errMissingMetadata = status.Errorf(codes.InvalidArgument, "missing metadata")
|
|
|
|
errInvalidToken = status.Errorf(codes.Unauthenticated, "invalid token")
|
2022-06-24 15:34:14 +08:00
|
|
|
// registerHTTPHandlerOnce avoid register http handler multiple times
|
|
|
|
registerHTTPHandlerOnce sync.Once
|
2022-04-11 19:49:34 +08:00
|
|
|
)
|
|
|
|
|
2022-06-24 15:34:14 +08:00
|
|
|
const apiPathPrefix = "/api/v1"
|
|
|
|
|
2021-11-29 19:57:57 +08:00
|
|
|
// Server is the Proxy Server
|
2021-01-22 09:36:18 +08:00
|
|
|
type Server struct {
|
2022-05-10 20:05:53 +08:00
|
|
|
ctx context.Context
|
|
|
|
wg sync.WaitGroup
|
|
|
|
proxy types.ProxyComponent
|
|
|
|
grpcInternalServer *grpc.Server
|
|
|
|
grpcExternalServer *grpc.Server
|
2021-01-22 09:36:18 +08:00
|
|
|
|
2021-12-29 14:35:21 +08:00
|
|
|
etcdCli *clientv3.Client
|
2021-10-14 17:48:34 +08:00
|
|
|
rootCoordClient types.RootCoord
|
|
|
|
dataCoordClient types.DataCoord
|
2021-12-25 16:10:17 +08:00
|
|
|
queryCoordClient types.QueryCoord
|
2021-10-14 17:48:34 +08:00
|
|
|
indexCoordClient types.IndexCoord
|
2021-02-23 09:58:06 +08:00
|
|
|
|
|
|
|
tracer opentracing.Tracer
|
|
|
|
closer io.Closer
|
2021-01-29 09:27:26 +08:00
|
|
|
}
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-11-03 19:50:27 +08:00
|
|
|
// NewServer create a Proxy server.
|
2022-04-07 22:05:32 +08:00
|
|
|
func NewServer(ctx context.Context, factory dependency.Factory) (*Server, error) {
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-02-23 09:58:06 +08:00
|
|
|
var err error
|
2021-01-29 09:27:26 +08:00
|
|
|
server := &Server{
|
2022-05-13 17:43:53 +08:00
|
|
|
ctx: ctx,
|
2021-01-28 20:51:44 +08:00
|
|
|
}
|
|
|
|
|
2021-06-22 14:40:07 +08:00
|
|
|
server.proxy, err = proxy.NewProxy(server.ctx, factory)
|
2021-01-28 20:51:44 +08:00
|
|
|
if err != nil {
|
2021-01-29 09:27:26 +08:00
|
|
|
return nil, err
|
2021-01-28 20:51:44 +08:00
|
|
|
}
|
2021-01-29 09:27:26 +08:00
|
|
|
return server, err
|
|
|
|
}
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2022-06-24 15:34:14 +08:00
|
|
|
// registerHTTPServer register the http server, panic when failed
|
|
|
|
func (s *Server) registerHTTPServer() {
|
2022-03-10 10:35:59 +08:00
|
|
|
// (Embedded Milvus Only) Discard gin logs if logging is disabled.
|
|
|
|
// We might need to put these logs in some files in the further.
|
|
|
|
// But we don't care about these logs now, at least not in embedded Milvus.
|
2022-12-07 18:01:19 +08:00
|
|
|
if !proxy.Params.ProxyCfg.GinLogging.GetAsBool() {
|
2022-03-10 10:35:59 +08:00
|
|
|
gin.DefaultWriter = io.Discard
|
|
|
|
gin.DefaultErrorWriter = io.Discard
|
|
|
|
}
|
2022-04-29 15:15:47 +08:00
|
|
|
if !HTTPParams.DebugMode {
|
|
|
|
gin.SetMode(gin.ReleaseMode)
|
|
|
|
}
|
2022-02-23 14:37:52 +08:00
|
|
|
ginHandler := gin.Default()
|
2022-06-24 15:34:14 +08:00
|
|
|
apiv1 := ginHandler.Group(apiPathPrefix)
|
2022-02-23 14:37:52 +08:00
|
|
|
httpserver.NewHandlers(s.proxy).RegisterRoutesTo(apiv1)
|
2022-06-24 15:34:14 +08:00
|
|
|
http.Handle("/", ginHandler)
|
2022-02-23 14:37:52 +08:00
|
|
|
}
|
|
|
|
|
2022-05-13 17:43:53 +08:00
|
|
|
func (s *Server) startInternalRPCServer(grpcInternalPort int, errChan chan error) {
|
|
|
|
s.wg.Add(1)
|
|
|
|
go s.startInternalGrpc(grpcInternalPort, errChan)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) startExternalRPCServer(grpcExternalPort int, errChan chan error) {
|
|
|
|
s.wg.Add(1)
|
|
|
|
go s.startExternalGrpc(grpcExternalPort, errChan)
|
2022-05-10 20:05:53 +08:00
|
|
|
}
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2022-05-13 17:43:53 +08:00
|
|
|
func (s *Server) startExternalGrpc(grpcPort int, errChan chan error) {
|
2022-05-10 20:05:53 +08:00
|
|
|
defer s.wg.Done()
|
2021-11-29 14:25:17 +08:00
|
|
|
var kaep = keepalive.EnforcementPolicy{
|
|
|
|
MinTime: 5 * time.Second, // If a client pings more than once every 5 seconds, terminate the connection
|
|
|
|
PermitWithoutStream: true, // Allow pings even when there are no active streams
|
|
|
|
}
|
|
|
|
|
|
|
|
var kasp = keepalive.ServerParameters{
|
|
|
|
Time: 60 * time.Second, // Ping the client if it is idle for 60 seconds to ensure the connection is still active
|
|
|
|
Timeout: 10 * time.Second, // Wait 10 second for the ping ack before assuming the connection is dead
|
|
|
|
}
|
|
|
|
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("Proxy server listen on tcp", zap.Int("port", grpcPort))
|
2021-01-29 09:27:26 +08:00
|
|
|
lis, err := net.Listen("tcp", ":"+strconv.Itoa(grpcPort))
|
2021-01-28 20:51:44 +08:00
|
|
|
if err != nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Warn("Proxy server failed to listen on", zap.Error(err), zap.Int("port", grpcPort))
|
2022-05-13 17:43:53 +08:00
|
|
|
errChan <- err
|
2021-01-29 09:27:26 +08:00
|
|
|
return
|
2021-01-28 20:51:44 +08:00
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("Proxy server already listen on tcp", zap.Int("port", grpcPort))
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2022-09-16 09:56:47 +08:00
|
|
|
limiter, err := s.proxy.GetRateLimiter()
|
|
|
|
if err != nil {
|
|
|
|
log.Error("Get proxy rate limiter failed", zap.Int("port", grpcPort), zap.Error(err))
|
|
|
|
errChan <- err
|
|
|
|
return
|
|
|
|
}
|
|
|
|
log.Debug("Get proxy rate limiter done", zap.Int("port", grpcPort))
|
|
|
|
|
2021-06-17 14:17:56 +08:00
|
|
|
opts := trace.GetInterceptorOpts()
|
2022-05-10 20:05:53 +08:00
|
|
|
grpcOpts := []grpc.ServerOption{
|
2021-11-29 14:25:17 +08:00
|
|
|
grpc.KeepaliveEnforcementPolicy(kaep),
|
|
|
|
grpc.KeepaliveParams(kasp),
|
2021-08-04 13:03:24 +08:00
|
|
|
grpc.MaxRecvMsgSize(Params.ServerMaxRecvSize),
|
|
|
|
grpc.MaxSendMsgSize(Params.ServerMaxSendSize),
|
2022-04-11 19:49:34 +08:00
|
|
|
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
|
|
|
|
ot.UnaryServerInterceptor(opts...),
|
|
|
|
grpc_auth.UnaryServerInterceptor(proxy.AuthenticationInterceptor),
|
2022-09-23 09:50:52 +08:00
|
|
|
proxy.UnaryServerHookInterceptor(),
|
2022-08-04 11:04:34 +08:00
|
|
|
proxy.UnaryServerInterceptor(proxy.PrivilegeInterceptor),
|
2022-08-23 10:44:52 +08:00
|
|
|
logutil.UnaryTraceLoggerInterceptor,
|
2022-09-16 09:56:47 +08:00
|
|
|
proxy.RateLimitInterceptor(limiter),
|
2022-11-10 17:09:06 +08:00
|
|
|
accesslog.UnaryAccessLoggerInterceptor,
|
2022-04-11 19:49:34 +08:00
|
|
|
)),
|
2022-05-10 20:05:53 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 18:56:04 +08:00
|
|
|
if Params.TLSMode == 1 {
|
|
|
|
creds, err := credentials.NewServerTLSFromFile(Params.ServerPemPath, Params.ServerKeyPath)
|
|
|
|
if err != nil {
|
|
|
|
log.Warn("proxy can't create creds", zap.Error(err))
|
|
|
|
errChan <- err
|
|
|
|
return
|
|
|
|
}
|
|
|
|
grpcOpts = append(grpcOpts, grpc.Creds(creds))
|
|
|
|
} else if Params.TLSMode == 2 {
|
2022-05-10 20:05:53 +08:00
|
|
|
cert, err := tls.LoadX509KeyPair(Params.ServerPemPath, Params.ServerKeyPath)
|
|
|
|
if err != nil {
|
|
|
|
log.Warn("proxy cant load x509 key pair", zap.Error(err))
|
2022-06-02 18:56:04 +08:00
|
|
|
errChan <- err
|
|
|
|
return
|
2022-05-10 20:05:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
certPool := x509.NewCertPool()
|
|
|
|
rootBuf, err := ioutil.ReadFile(Params.CaPemPath)
|
|
|
|
if err != nil {
|
|
|
|
log.Warn("failed read ca pem", zap.Error(err))
|
2022-06-02 18:56:04 +08:00
|
|
|
errChan <- err
|
|
|
|
return
|
2022-05-10 20:05:53 +08:00
|
|
|
}
|
|
|
|
if !certPool.AppendCertsFromPEM(rootBuf) {
|
|
|
|
log.Warn("fail to append ca to cert")
|
2022-06-02 18:56:04 +08:00
|
|
|
errChan <- fmt.Errorf("fail to append ca to cert")
|
|
|
|
return
|
2022-05-10 20:05:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
tlsConf := &tls.Config{
|
|
|
|
ClientAuth: tls.RequireAndVerifyClientCert,
|
|
|
|
Certificates: []tls.Certificate{cert},
|
|
|
|
ClientCAs: certPool,
|
|
|
|
MinVersion: tls.VersionTLS13,
|
|
|
|
}
|
|
|
|
grpcOpts = append(grpcOpts, grpc.Creds(credentials.NewTLS(tlsConf)))
|
|
|
|
}
|
|
|
|
s.grpcExternalServer = grpc.NewServer(grpcOpts...)
|
|
|
|
milvuspb.RegisterMilvusServiceServer(s.grpcExternalServer, s)
|
|
|
|
grpc_health_v1.RegisterHealthServer(s.grpcExternalServer, s)
|
2022-05-13 17:43:53 +08:00
|
|
|
errChan <- nil
|
|
|
|
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("create Proxy grpc server",
|
|
|
|
zap.Any("enforcement policy", kaep),
|
|
|
|
zap.Any("server parameters", kasp))
|
|
|
|
|
2022-05-10 20:05:53 +08:00
|
|
|
if err := s.grpcExternalServer.Serve(lis); err != nil {
|
2022-05-13 17:43:53 +08:00
|
|
|
log.Error("failed to serve on Proxy's listener", zap.Error(err))
|
2022-06-02 18:56:04 +08:00
|
|
|
errChan <- err
|
|
|
|
return
|
2021-01-28 20:51:44 +08:00
|
|
|
}
|
2021-01-29 09:27:26 +08:00
|
|
|
}
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2022-05-13 17:43:53 +08:00
|
|
|
func (s *Server) startInternalGrpc(grpcPort int, errChan chan error) {
|
2022-05-10 20:05:53 +08:00
|
|
|
defer s.wg.Done()
|
|
|
|
var kaep = keepalive.EnforcementPolicy{
|
|
|
|
MinTime: 5 * time.Second, // If a client pings more than once every 5 seconds, terminate the connection
|
|
|
|
PermitWithoutStream: true, // Allow pings even when there are no active streams
|
|
|
|
}
|
|
|
|
|
|
|
|
var kasp = keepalive.ServerParameters{
|
|
|
|
Time: 60 * time.Second, // Ping the client if it is idle for 60 seconds to ensure the connection is still active
|
|
|
|
Timeout: 10 * time.Second, // Wait 10 second for the ping ack before assuming the connection is dead
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Debug("Proxy internal server listen on tcp", zap.Int("port", grpcPort))
|
|
|
|
lis, err := net.Listen("tcp", ":"+strconv.Itoa(grpcPort))
|
|
|
|
if err != nil {
|
|
|
|
log.Warn("Proxy internal server failed to listen on", zap.Error(err), zap.Int("port", grpcPort))
|
2022-05-13 17:43:53 +08:00
|
|
|
errChan <- err
|
2022-05-10 20:05:53 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
log.Debug("Proxy internal server already listen on tcp", zap.Int("port", grpcPort))
|
|
|
|
|
|
|
|
opts := trace.GetInterceptorOpts()
|
|
|
|
s.grpcInternalServer = grpc.NewServer(
|
|
|
|
grpc.KeepaliveEnforcementPolicy(kaep),
|
|
|
|
grpc.KeepaliveParams(kasp),
|
|
|
|
grpc.MaxRecvMsgSize(Params.ServerMaxRecvSize),
|
|
|
|
grpc.MaxSendMsgSize(Params.ServerMaxSendSize),
|
|
|
|
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
|
|
|
|
ot.UnaryServerInterceptor(opts...),
|
2022-08-23 10:44:52 +08:00
|
|
|
logutil.UnaryTraceLoggerInterceptor,
|
2022-05-10 20:05:53 +08:00
|
|
|
)),
|
|
|
|
)
|
|
|
|
proxypb.RegisterProxyServer(s.grpcInternalServer, s)
|
|
|
|
grpc_health_v1.RegisterHealthServer(s.grpcInternalServer, s)
|
2022-05-13 17:43:53 +08:00
|
|
|
errChan <- nil
|
|
|
|
|
2022-05-10 20:05:53 +08:00
|
|
|
log.Debug("create Proxy internal grpc server",
|
|
|
|
zap.Any("enforcement policy", kaep),
|
|
|
|
zap.Any("server parameters", kasp))
|
|
|
|
|
|
|
|
if err := s.grpcInternalServer.Serve(lis); err != nil {
|
2022-05-13 17:43:53 +08:00
|
|
|
log.Error("failed to internal serve on Proxy's listener", zap.Error(err))
|
2022-06-02 18:56:04 +08:00
|
|
|
errChan <- err
|
|
|
|
return
|
2022-05-10 20:05:53 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-29 19:57:57 +08:00
|
|
|
// Start start the Proxy Server
|
2021-01-29 09:27:26 +08:00
|
|
|
func (s *Server) Run() error {
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("init Proxy server")
|
2021-01-29 09:27:26 +08:00
|
|
|
if err := s.init(); err != nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Warn("init Proxy server failed", zap.Error(err))
|
2021-01-29 17:29:31 +08:00
|
|
|
return err
|
2021-01-28 20:51:44 +08:00
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("init Proxy server done")
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("start Proxy server")
|
2021-01-29 09:27:26 +08:00
|
|
|
if err := s.start(); err != nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Warn("start Proxy server failed", zap.Error(err))
|
2021-01-28 20:51:44 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("start Proxy server done")
|
|
|
|
|
2021-01-28 20:51:44 +08:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
func (s *Server) init() error {
|
2021-12-17 10:23:15 +08:00
|
|
|
Params.InitOnce(typeutil.ProxyRole)
|
2022-01-14 21:17:34 +08:00
|
|
|
log.Debug("Proxy init service's parameter table done")
|
2022-02-23 14:37:52 +08:00
|
|
|
HTTPParams.InitOnce()
|
|
|
|
log.Debug("Proxy init http server's parameter table done")
|
2021-01-22 12:57:23 +08:00
|
|
|
|
2022-01-14 21:17:34 +08:00
|
|
|
if !funcutil.CheckPortAvailable(Params.Port) {
|
|
|
|
Params.Port = funcutil.GetAvailablePort()
|
|
|
|
log.Warn("Proxy get available port when init", zap.Int("Port", Params.Port))
|
2021-12-25 16:10:17 +08:00
|
|
|
}
|
2021-08-31 10:25:59 +08:00
|
|
|
|
2022-05-10 20:05:53 +08:00
|
|
|
log.Debug("init Proxy's parameter table done", zap.String("internal address", Params.GetInternalAddress()), zap.String("external address", Params.GetAddress()))
|
2021-01-29 17:29:31 +08:00
|
|
|
|
2021-12-25 16:10:17 +08:00
|
|
|
serviceName := fmt.Sprintf("Proxy ip: %s, port: %d", Params.IP, Params.Port)
|
|
|
|
closer := trace.InitTracing(serviceName)
|
2021-02-26 17:44:24 +08:00
|
|
|
s.closer = closer
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("init Proxy's tracer done", zap.String("service name", serviceName))
|
2021-03-23 01:49:50 +08:00
|
|
|
|
2022-11-30 18:23:15 +08:00
|
|
|
etcdCli, err := etcd.GetEtcdClient(
|
|
|
|
Params.EtcdCfg.UseEmbedEtcd.GetAsBool(),
|
|
|
|
Params.EtcdCfg.EtcdUseSSL.GetAsBool(),
|
|
|
|
Params.EtcdCfg.Endpoints.GetAsStrings(),
|
|
|
|
Params.EtcdCfg.EtcdTLSCert.GetValue(),
|
|
|
|
Params.EtcdCfg.EtcdTLSKey.GetValue(),
|
|
|
|
Params.EtcdCfg.EtcdTLSCACert.GetValue(),
|
|
|
|
Params.EtcdCfg.EtcdTLSMinVersion.GetValue())
|
2021-12-29 14:35:21 +08:00
|
|
|
if err != nil {
|
|
|
|
log.Debug("Proxy connect to etcd failed", zap.Error(err))
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
s.etcdCli = etcdCli
|
|
|
|
s.proxy.SetEtcdClient(s.etcdCli)
|
2022-11-15 16:53:07 +08:00
|
|
|
s.proxy.SetAddress(fmt.Sprintf("%s:%d", Params.IP, Params.InternalPort))
|
2022-05-13 17:43:53 +08:00
|
|
|
|
|
|
|
errChan := make(chan error, 1)
|
|
|
|
{
|
|
|
|
s.startInternalRPCServer(Params.InternalPort, errChan)
|
|
|
|
if err := <-errChan; err != nil {
|
|
|
|
log.Error("failed to create internal rpc server", zap.Error(err))
|
|
|
|
return err
|
|
|
|
}
|
2021-01-22 12:57:23 +08:00
|
|
|
}
|
2022-05-13 17:43:53 +08:00
|
|
|
{
|
|
|
|
s.startExternalRPCServer(Params.Port, errChan)
|
|
|
|
if err := <-errChan; err != nil {
|
|
|
|
log.Error("failed to create external rpc server", zap.Error(err))
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-23 14:37:52 +08:00
|
|
|
if HTTPParams.Enabled {
|
2022-06-24 15:34:14 +08:00
|
|
|
registerHTTPHandlerOnce.Do(func() {
|
|
|
|
log.Info("register http server of proxy")
|
|
|
|
s.registerHTTPServer()
|
|
|
|
})
|
2022-02-23 14:37:52 +08:00
|
|
|
}
|
2021-01-29 09:27:26 +08:00
|
|
|
|
2021-10-14 17:48:34 +08:00
|
|
|
if s.rootCoordClient == nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
var err error
|
|
|
|
log.Debug("create RootCoord client for Proxy")
|
2022-11-17 18:59:09 +08:00
|
|
|
s.rootCoordClient, err = rcc.NewClient(s.ctx, proxy.Params.EtcdCfg.MetaRootPath.GetValue(), etcdCli)
|
2021-10-14 17:48:34 +08:00
|
|
|
if err != nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Warn("failed to create RootCoord client for Proxy", zap.Error(err))
|
2021-10-14 17:48:34 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("create RootCoord client for Proxy done")
|
2021-01-22 12:57:23 +08:00
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
|
|
|
|
log.Debug("init RootCoord client for Proxy")
|
|
|
|
if err := s.rootCoordClient.Init(); err != nil {
|
|
|
|
log.Warn("failed to init RootCoord client for Proxy", zap.Error(err))
|
2021-01-29 09:27:26 +08:00
|
|
|
return err
|
2021-01-22 12:57:23 +08:00
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("init RootCoord client for Proxy done")
|
|
|
|
|
|
|
|
log.Debug("Proxy wait for RootCoord to be healthy")
|
|
|
|
if err := funcutil.WaitForComponentHealthy(s.ctx, s.rootCoordClient, "RootCoord", 1000000, time.Millisecond*200); err != nil {
|
|
|
|
log.Warn("Proxy failed to wait for RootCoord to be healthy", zap.Error(err))
|
|
|
|
return err
|
2021-03-04 22:27:12 +08:00
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("Proxy wait for RootCoord to be healthy done")
|
|
|
|
|
|
|
|
log.Debug("set RootCoord client for Proxy")
|
2021-06-22 14:40:07 +08:00
|
|
|
s.proxy.SetRootCoordClient(s.rootCoordClient)
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("set RootCoord client for Proxy done")
|
2021-01-22 12:57:23 +08:00
|
|
|
|
2021-10-14 17:48:34 +08:00
|
|
|
if s.dataCoordClient == nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
var err error
|
|
|
|
log.Debug("create DataCoord client for Proxy")
|
2022-11-17 18:59:09 +08:00
|
|
|
s.dataCoordClient, err = dcc.NewClient(s.ctx, proxy.Params.EtcdCfg.MetaRootPath.GetValue(), etcdCli)
|
2021-10-14 17:48:34 +08:00
|
|
|
if err != nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Warn("failed to create DataCoord client for Proxy", zap.Error(err))
|
2021-10-14 17:48:34 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("create DataCoord client for Proxy done")
|
2021-06-23 09:24:10 +08:00
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
|
|
|
|
log.Debug("init DataCoord client for Proxy")
|
|
|
|
if err := s.dataCoordClient.Init(); err != nil {
|
|
|
|
log.Warn("failed to init DataCoord client for Proxy", zap.Error(err))
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
log.Debug("init DataCoord client for Proxy done")
|
|
|
|
|
|
|
|
log.Debug("Proxy wait for DataCoord to be healthy")
|
|
|
|
if err := funcutil.WaitForComponentHealthy(s.ctx, s.dataCoordClient, "DataCoord", 1000000, time.Millisecond*200); err != nil {
|
|
|
|
log.Warn("Proxy failed to wait for DataCoord to be healthy", zap.Error(err))
|
2021-01-29 09:27:26 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("Proxy wait for DataCoord to be healthy done")
|
2021-06-22 16:44:09 +08:00
|
|
|
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("set DataCoord client for Proxy")
|
2021-06-22 14:40:07 +08:00
|
|
|
s.proxy.SetDataCoordClient(s.dataCoordClient)
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("set DataCoord client for Proxy done")
|
2021-01-29 09:27:26 +08:00
|
|
|
|
2021-10-14 17:48:34 +08:00
|
|
|
if s.indexCoordClient == nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
var err error
|
|
|
|
log.Debug("create IndexCoord client for Proxy")
|
2022-11-17 18:59:09 +08:00
|
|
|
s.indexCoordClient, err = icc.NewClient(s.ctx, proxy.Params.EtcdCfg.MetaRootPath.GetValue(), etcdCli)
|
2021-10-14 17:48:34 +08:00
|
|
|
if err != nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Warn("failed to create IndexCoord client for Proxy", zap.Error(err))
|
2021-10-14 17:48:34 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("create IndexCoord client for Proxy done")
|
2021-06-23 09:24:10 +08:00
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
|
|
|
|
log.Debug("init IndexCoord client for Proxy")
|
|
|
|
if err := s.indexCoordClient.Init(); err != nil {
|
|
|
|
log.Warn("failed to init IndexCoord client for Proxy", zap.Error(err))
|
2021-01-22 09:36:18 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("init IndexCoord client for Proxy done")
|
2021-06-22 16:44:09 +08:00
|
|
|
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("Proxy wait for IndexCoord to be healthy")
|
|
|
|
if err := funcutil.WaitForComponentHealthy(s.ctx, s.indexCoordClient, "IndexCoord", 1000000, time.Millisecond*200); err != nil {
|
|
|
|
log.Warn("Proxy failed to wait for IndexCoord to be healthy", zap.Error(err))
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
log.Debug("Proxy wait for IndexCoord to be healthy done")
|
|
|
|
|
|
|
|
log.Debug("set IndexCoord client for Proxy")
|
2021-06-22 14:40:07 +08:00
|
|
|
s.proxy.SetIndexCoordClient(s.indexCoordClient)
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("set IndexCoord client for Proxy done")
|
2021-01-29 17:29:31 +08:00
|
|
|
|
2021-12-25 16:10:17 +08:00
|
|
|
if s.queryCoordClient == nil {
|
|
|
|
var err error
|
|
|
|
log.Debug("create QueryCoord client for Proxy")
|
2022-11-17 18:59:09 +08:00
|
|
|
s.queryCoordClient, err = qcc.NewClient(s.ctx, proxy.Params.EtcdCfg.MetaRootPath.GetValue(), etcdCli)
|
2021-10-14 17:48:34 +08:00
|
|
|
if err != nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Warn("failed to create QueryCoord client for Proxy", zap.Error(err))
|
2021-10-14 17:48:34 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("create QueryCoord client for Proxy done")
|
2021-02-05 10:29:14 +08:00
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
|
|
|
|
log.Debug("init QueryCoord client for Proxy")
|
|
|
|
if err := s.queryCoordClient.Init(); err != nil {
|
|
|
|
log.Warn("failed to init QueryCoord client for Proxy", zap.Error(err))
|
2021-02-05 10:29:14 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("init QueryCoord client for Proxy done")
|
|
|
|
|
|
|
|
log.Debug("Proxy wait for QueryCoord to be healthy")
|
|
|
|
if err := funcutil.WaitForComponentHealthy(s.ctx, s.queryCoordClient, "QueryCoord", 1000000, time.Millisecond*200); err != nil {
|
|
|
|
log.Warn("Proxy failed to wait for QueryCoord to be healthy", zap.Error(err))
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
log.Debug("Proxy wait for QueryCoord to be healthy done")
|
|
|
|
|
|
|
|
log.Debug("set QueryCoord client for Proxy")
|
|
|
|
s.proxy.SetQueryCoordClient(s.queryCoordClient)
|
|
|
|
log.Debug("set QueryCoord client for Proxy done")
|
2021-01-22 09:36:18 +08:00
|
|
|
|
2022-10-10 15:55:22 +08:00
|
|
|
log.Debug(fmt.Sprintf("update Proxy's state to %s", commonpb.StateCode_Initializing.String()))
|
|
|
|
s.proxy.UpdateStateCode(commonpb.StateCode_Initializing)
|
2021-01-22 09:36:18 +08:00
|
|
|
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("init Proxy")
|
2021-06-22 14:40:07 +08:00
|
|
|
if err := s.proxy.Init(); err != nil {
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Warn("failed to init Proxy", zap.Error(err))
|
2021-01-29 09:27:26 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
log.Debug("init Proxy done")
|
2022-04-14 19:57:34 +08:00
|
|
|
// Intentionally print to stdout, which is usually a sign that Milvus is ready to serve.
|
|
|
|
fmt.Println("---Milvus Proxy successfully initialized and ready to serve!---")
|
2021-01-29 09:27:26 +08:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
2021-01-22 09:36:18 +08:00
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
func (s *Server) start() error {
|
2021-12-25 16:10:17 +08:00
|
|
|
if err := s.proxy.Start(); err != nil {
|
|
|
|
log.Warn("failed to start Proxy server", zap.Error(err))
|
|
|
|
return err
|
2021-12-15 11:47:10 +08:00
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
|
|
|
|
if err := s.proxy.Register(); err != nil {
|
|
|
|
log.Warn("failed to register Proxy", zap.Error(err))
|
2021-12-15 11:47:10 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-12-25 16:10:17 +08:00
|
|
|
|
2021-12-15 11:47:10 +08:00
|
|
|
return nil
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-11-29 19:57:57 +08:00
|
|
|
// Stop stop the Proxy Server
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) Stop() error {
|
2022-05-10 20:05:53 +08:00
|
|
|
log.Debug("Proxy stop", zap.String("internal address", Params.GetInternalAddress()), zap.String("external address", Params.GetInternalAddress()))
|
2021-01-22 09:36:18 +08:00
|
|
|
var err error
|
2021-03-26 15:13:33 +08:00
|
|
|
if s.closer != nil {
|
|
|
|
if err = s.closer.Close(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2021-01-22 09:36:18 +08:00
|
|
|
|
2021-12-29 14:35:21 +08:00
|
|
|
if s.etcdCli != nil {
|
|
|
|
defer s.etcdCli.Close()
|
|
|
|
}
|
|
|
|
|
2022-02-23 14:37:52 +08:00
|
|
|
gracefulWg := sync.WaitGroup{}
|
2022-05-10 20:05:53 +08:00
|
|
|
|
2022-02-23 14:37:52 +08:00
|
|
|
gracefulWg.Add(1)
|
|
|
|
go func() {
|
|
|
|
defer gracefulWg.Done()
|
2022-05-10 20:05:53 +08:00
|
|
|
if s.grpcInternalServer != nil {
|
|
|
|
log.Debug("Graceful stop grpc internal server...")
|
|
|
|
s.grpcInternalServer.GracefulStop()
|
|
|
|
}
|
|
|
|
if s.grpcExternalServer != nil {
|
|
|
|
log.Debug("Graceful stop grpc external server...")
|
|
|
|
s.grpcExternalServer.GracefulStop()
|
2022-02-23 14:37:52 +08:00
|
|
|
}
|
|
|
|
}()
|
|
|
|
gracefulWg.Wait()
|
2021-01-22 09:36:18 +08:00
|
|
|
|
2022-05-10 20:05:53 +08:00
|
|
|
s.wg.Wait()
|
|
|
|
|
2021-06-22 14:40:07 +08:00
|
|
|
err = s.proxy.Stop()
|
2021-01-22 09:36:18 +08:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-11-29 19:57:57 +08:00
|
|
|
// GetComponentStates get the component states
|
2022-10-10 15:55:22 +08:00
|
|
|
func (s *Server) GetComponentStates(ctx context.Context, request *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.GetComponentStates(ctx)
|
2021-03-12 14:22:09 +08:00
|
|
|
}
|
|
|
|
|
2021-11-29 19:57:57 +08:00
|
|
|
// GetStatisticsChannel get the statistics channel
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetStatisticsChannel(ctx context.Context, request *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.GetStatisticsChannel(ctx)
|
2021-03-12 14:22:09 +08:00
|
|
|
}
|
|
|
|
|
2021-11-29 19:57:57 +08:00
|
|
|
// InvalidateCollectionMetaCache notifies Proxy to clear all the meta cache of specific collection.
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) InvalidateCollectionMetaCache(ctx context.Context, request *proxypb.InvalidateCollMetaCacheRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.InvalidateCollectionMetaCache(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-11-29 19:57:57 +08:00
|
|
|
// CreateCollection notifies Proxy to create a collection
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) CreateCollection(ctx context.Context, request *milvuspb.CreateCollectionRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.CreateCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-11-29 19:57:57 +08:00
|
|
|
// DropCollection notifies Proxy to drop a collection
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) DropCollection(ctx context.Context, request *milvuspb.DropCollectionRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.DropCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-11-29 19:57:57 +08:00
|
|
|
// HasCollection notifies Proxy to check a collection's existence at specified timestamp
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) HasCollection(ctx context.Context, request *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.HasCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-11-29 19:57:57 +08:00
|
|
|
// LoadCollection notifies Proxy to load a collection's data
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) LoadCollection(ctx context.Context, request *milvuspb.LoadCollectionRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.LoadCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-12-14 11:59:10 +08:00
|
|
|
// ReleaseCollection notifies Proxy to release a collection's data
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) ReleaseCollection(ctx context.Context, request *milvuspb.ReleaseCollectionRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.ReleaseCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-12-15 17:01:49 +08:00
|
|
|
// DescribeCollection notifies Proxy to describe a collection
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) DescribeCollection(ctx context.Context, request *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.DescribeCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-12-15 16:59:56 +08:00
|
|
|
// GetCollectionStatistics notifies Proxy to get a collection's Statistics
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetCollectionStatistics(ctx context.Context, request *milvuspb.GetCollectionStatisticsRequest) (*milvuspb.GetCollectionStatisticsResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.GetCollectionStatistics(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) ShowCollections(ctx context.Context, request *milvuspb.ShowCollectionsRequest) (*milvuspb.ShowCollectionsResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.ShowCollections(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2022-10-10 20:31:22 +08:00
|
|
|
func (s *Server) AlterCollection(ctx context.Context, request *milvuspb.AlterCollectionRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.AlterCollection(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-12-14 16:19:33 +08:00
|
|
|
// CreatePartition notifies Proxy to create a partition
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) CreatePartition(ctx context.Context, request *milvuspb.CreatePartitionRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.CreatePartition(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-12-14 16:21:22 +08:00
|
|
|
// DropPartition notifies Proxy to drop a partition
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) DropPartition(ctx context.Context, request *milvuspb.DropPartitionRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.DropPartition(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-12-22 19:29:50 +08:00
|
|
|
// HasPartition notifies Proxy to check a partition's existence
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) HasPartition(ctx context.Context, request *milvuspb.HasPartitionRequest) (*milvuspb.BoolResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.HasPartition(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-12-15 12:00:20 +08:00
|
|
|
// LoadPartitions notifies Proxy to load the partitions data
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) LoadPartitions(ctx context.Context, request *milvuspb.LoadPartitionsRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.LoadPartitions(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-12-16 16:33:44 +08:00
|
|
|
// ReleasePartitions notifies Proxy to release the partitions data
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) ReleasePartitions(ctx context.Context, request *milvuspb.ReleasePartitionsRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.ReleasePartitions(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-12-16 16:37:27 +08:00
|
|
|
// GetPartitionStatistics notifies Proxy to get the partitions Statistics info.
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetPartitionStatistics(ctx context.Context, request *milvuspb.GetPartitionStatisticsRequest) (*milvuspb.GetPartitionStatisticsResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.GetPartitionStatistics(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-12-16 20:47:14 +08:00
|
|
|
// ShowPartitions notifies Proxy to show the partitions
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) ShowPartitions(ctx context.Context, request *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.ShowPartitions(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2022-10-01 09:02:55 +08:00
|
|
|
func (s *Server) GetLoadingProgress(ctx context.Context, request *milvuspb.GetLoadingProgressRequest) (*milvuspb.GetLoadingProgressResponse, error) {
|
|
|
|
return s.proxy.GetLoadingProgress(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-12-17 14:27:30 +08:00
|
|
|
// CreateIndex notifies Proxy to create index
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) CreateIndex(ctx context.Context, request *milvuspb.CreateIndexRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.CreateIndex(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-12-17 14:30:27 +08:00
|
|
|
// DropIndex notifies Proxy to drop index
|
2021-02-20 18:30:37 +08:00
|
|
|
func (s *Server) DropIndex(ctx context.Context, request *milvuspb.DropIndexRequest) (*commonpb.Status, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.DropIndex(ctx, request)
|
2021-02-20 18:30:37 +08:00
|
|
|
}
|
|
|
|
|
2021-12-23 18:11:31 +08:00
|
|
|
// DescribeIndex notifies Proxy to get index describe
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) DescribeIndex(ctx context.Context, request *milvuspb.DescribeIndexRequest) (*milvuspb.DescribeIndexResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.DescribeIndex(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-04-27 15:46:45 +08:00
|
|
|
// GetIndexBuildProgress gets index build progress with filed_name and index_name.
|
|
|
|
// IndexRows is the num of indexed rows. And TotalRows is the total number of segment rows.
|
2022-09-27 19:12:54 +08:00
|
|
|
// Deprecated: use DescribeIndex instead
|
2021-04-27 15:46:45 +08:00
|
|
|
func (s *Server) GetIndexBuildProgress(ctx context.Context, request *milvuspb.GetIndexBuildProgressRequest) (*milvuspb.GetIndexBuildProgressResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.GetIndexBuildProgress(ctx, request)
|
2021-04-27 15:46:45 +08:00
|
|
|
}
|
|
|
|
|
2022-09-27 19:12:54 +08:00
|
|
|
// GetIndexState gets the index states from proxy.
|
|
|
|
// Deprecated: use DescribeIndex instead
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetIndexState(ctx context.Context, request *milvuspb.GetIndexStateRequest) (*milvuspb.GetIndexStateResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.GetIndexState(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-06-21 11:42:18 +08:00
|
|
|
func (s *Server) Insert(ctx context.Context, request *milvuspb.InsertRequest) (*milvuspb.MutationResult, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.Insert(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-08-26 12:15:52 +08:00
|
|
|
func (s *Server) Delete(ctx context.Context, request *milvuspb.DeleteRequest) (*milvuspb.MutationResult, error) {
|
|
|
|
return s.proxy.Delete(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) Search(ctx context.Context, request *milvuspb.SearchRequest) (*milvuspb.SearchResults, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.Search(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-06-23 16:56:11 +08:00
|
|
|
func (s *Server) Flush(ctx context.Context, request *milvuspb.FlushRequest) (*milvuspb.FlushResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.Flush(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-06-04 12:02:34 +08:00
|
|
|
func (s *Server) Query(ctx context.Context, request *milvuspb.QueryRequest) (*milvuspb.QueryResults, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.Query(ctx, request)
|
2021-06-04 12:02:34 +08:00
|
|
|
}
|
|
|
|
|
2021-07-01 18:56:17 +08:00
|
|
|
func (s *Server) CalcDistance(ctx context.Context, request *milvuspb.CalcDistanceRequest) (*milvuspb.CalcDistanceResults, error) {
|
|
|
|
return s.proxy.CalcDistance(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetDdChannel(ctx context.Context, request *internalpb.GetDdChannelRequest) (*milvuspb.StringResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.GetDdChannel(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
2021-02-03 18:55:00 +08:00
|
|
|
|
2021-12-23 18:15:21 +08:00
|
|
|
//GetPersistentSegmentInfo notifies Proxy to get persistent segment info.
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetPersistentSegmentInfo(ctx context.Context, request *milvuspb.GetPersistentSegmentInfoRequest) (*milvuspb.GetPersistentSegmentInfoResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.GetPersistentSegmentInfo(ctx, request)
|
2021-02-03 18:55:00 +08:00
|
|
|
}
|
2021-02-04 14:37:12 +08:00
|
|
|
|
2021-12-21 11:55:31 +08:00
|
|
|
//GetQuerySegmentInfo notifies Proxy to get query segment info.
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetQuerySegmentInfo(ctx context.Context, request *milvuspb.GetQuerySegmentInfoRequest) (*milvuspb.GetQuerySegmentInfoResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.GetQuerySegmentInfo(ctx, request)
|
2021-02-04 14:37:12 +08:00
|
|
|
|
|
|
|
}
|
2021-03-04 22:27:12 +08:00
|
|
|
|
2021-05-25 14:44:43 +08:00
|
|
|
func (s *Server) Dummy(ctx context.Context, request *milvuspb.DummyRequest) (*milvuspb.DummyResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.Dummy(ctx, request)
|
2021-05-25 14:44:43 +08:00
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) RegisterLink(ctx context.Context, request *milvuspb.RegisterLinkRequest) (*milvuspb.RegisterLinkResponse, error) {
|
2021-06-22 14:40:07 +08:00
|
|
|
return s.proxy.RegisterLink(ctx, request)
|
2021-03-04 22:27:12 +08:00
|
|
|
}
|
2021-08-18 10:12:10 +08:00
|
|
|
|
2021-12-20 18:58:50 +08:00
|
|
|
// GetMetrics gets the metrics info of proxy.
|
2021-08-18 10:12:10 +08:00
|
|
|
func (s *Server) GetMetrics(ctx context.Context, request *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) {
|
|
|
|
return s.proxy.GetMetrics(ctx, request)
|
|
|
|
}
|
2021-09-18 11:13:51 +08:00
|
|
|
|
2021-11-06 16:54:59 +08:00
|
|
|
func (s *Server) LoadBalance(ctx context.Context, request *milvuspb.LoadBalanceRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.LoadBalance(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-12-20 19:16:37 +08:00
|
|
|
// CreateAlias notifies Proxy to create alias
|
2021-09-18 11:13:51 +08:00
|
|
|
func (s *Server) CreateAlias(ctx context.Context, request *milvuspb.CreateAliasRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.CreateAlias(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-12-21 15:12:55 +08:00
|
|
|
// DropAlias notifies Proxy to drop an alias
|
2021-09-18 11:13:51 +08:00
|
|
|
func (s *Server) DropAlias(ctx context.Context, request *milvuspb.DropAliasRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.DropAlias(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-12-23 18:17:15 +08:00
|
|
|
// AlterAlias alters the alias for the specified collection.
|
2021-09-18 11:13:51 +08:00
|
|
|
func (s *Server) AlterAlias(ctx context.Context, request *milvuspb.AlterAliasRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.AlterAlias(ctx, request)
|
|
|
|
}
|
2021-11-09 14:47:02 +08:00
|
|
|
|
2021-12-22 19:37:19 +08:00
|
|
|
// GetCompactionState gets the state of a compaction
|
2021-11-09 14:47:02 +08:00
|
|
|
func (s *Server) GetCompactionState(ctx context.Context, req *milvuspb.GetCompactionStateRequest) (*milvuspb.GetCompactionStateResponse, error) {
|
|
|
|
return s.proxy.GetCompactionState(ctx, req)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) ManualCompaction(ctx context.Context, req *milvuspb.ManualCompactionRequest) (*milvuspb.ManualCompactionResponse, error) {
|
|
|
|
return s.proxy.ManualCompaction(ctx, req)
|
|
|
|
}
|
|
|
|
|
2021-12-22 19:13:14 +08:00
|
|
|
// GetCompactionStateWithPlans gets the state of a compaction by plan
|
2021-11-09 14:47:02 +08:00
|
|
|
func (s *Server) GetCompactionStateWithPlans(ctx context.Context, req *milvuspb.GetCompactionPlansRequest) (*milvuspb.GetCompactionPlansResponse, error) {
|
|
|
|
return s.proxy.GetCompactionStateWithPlans(ctx, req)
|
|
|
|
}
|
2021-11-23 10:55:14 +08:00
|
|
|
|
2021-12-22 19:35:27 +08:00
|
|
|
// GetFlushState gets the flush state of multiple segments
|
2021-11-23 10:55:14 +08:00
|
|
|
func (s *Server) GetFlushState(ctx context.Context, req *milvuspb.GetFlushStateRequest) (*milvuspb.GetFlushStateResponse, error) {
|
|
|
|
return s.proxy.GetFlushState(ctx, req)
|
|
|
|
}
|
2022-01-17 14:41:35 +08:00
|
|
|
|
2022-03-09 18:33:59 +08:00
|
|
|
func (s *Server) Import(ctx context.Context, req *milvuspb.ImportRequest) (*milvuspb.ImportResponse, error) {
|
|
|
|
return s.proxy.Import(ctx, req)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) GetImportState(ctx context.Context, req *milvuspb.GetImportStateRequest) (*milvuspb.GetImportStateResponse, error) {
|
|
|
|
return s.proxy.GetImportState(ctx, req)
|
|
|
|
}
|
2022-03-15 15:05:21 +08:00
|
|
|
|
2022-04-25 17:37:46 +08:00
|
|
|
func (s *Server) ListImportTasks(ctx context.Context, req *milvuspb.ListImportTasksRequest) (*milvuspb.ListImportTasksResponse, error) {
|
|
|
|
return s.proxy.ListImportTasks(ctx, req)
|
|
|
|
}
|
|
|
|
|
2022-04-06 14:57:31 +08:00
|
|
|
func (s *Server) GetReplicas(ctx context.Context, req *milvuspb.GetReplicasRequest) (*milvuspb.GetReplicasResponse, error) {
|
|
|
|
return s.proxy.GetReplicas(ctx, req)
|
|
|
|
}
|
|
|
|
|
2022-03-15 15:05:21 +08:00
|
|
|
// Check is required by gRPC healthy checking
|
|
|
|
func (s *Server) Check(ctx context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) {
|
|
|
|
ret := &grpc_health_v1.HealthCheckResponse{
|
|
|
|
Status: grpc_health_v1.HealthCheckResponse_NOT_SERVING,
|
|
|
|
}
|
|
|
|
state, err := s.proxy.GetComponentStates(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return ret, err
|
|
|
|
}
|
|
|
|
if state.Status.ErrorCode != commonpb.ErrorCode_Success {
|
|
|
|
return ret, nil
|
|
|
|
}
|
2022-10-10 15:55:22 +08:00
|
|
|
if state.State.StateCode != commonpb.StateCode_Healthy {
|
2022-03-15 15:05:21 +08:00
|
|
|
return ret, nil
|
|
|
|
}
|
|
|
|
ret.Status = grpc_health_v1.HealthCheckResponse_SERVING
|
|
|
|
return ret, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Watch is required by gRPC healthy checking
|
|
|
|
func (s *Server) Watch(req *grpc_health_v1.HealthCheckRequest, server grpc_health_v1.Health_WatchServer) error {
|
|
|
|
ret := &grpc_health_v1.HealthCheckResponse{
|
|
|
|
Status: grpc_health_v1.HealthCheckResponse_NOT_SERVING,
|
|
|
|
}
|
|
|
|
state, err := s.proxy.GetComponentStates(s.ctx)
|
|
|
|
if err != nil {
|
|
|
|
return server.Send(ret)
|
|
|
|
}
|
|
|
|
if state.Status.ErrorCode != commonpb.ErrorCode_Success {
|
|
|
|
return server.Send(ret)
|
|
|
|
}
|
2022-10-10 15:55:22 +08:00
|
|
|
if state.State.StateCode != commonpb.StateCode_Healthy {
|
2022-03-15 15:05:21 +08:00
|
|
|
return server.Send(ret)
|
|
|
|
}
|
|
|
|
ret.Status = grpc_health_v1.HealthCheckResponse_SERVING
|
|
|
|
return server.Send(ret)
|
|
|
|
}
|
2022-04-11 19:49:34 +08:00
|
|
|
|
|
|
|
func (s *Server) InvalidateCredentialCache(ctx context.Context, request *proxypb.InvalidateCredCacheRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.InvalidateCredentialCache(ctx, request)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) UpdateCredentialCache(ctx context.Context, request *proxypb.UpdateCredCacheRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.UpdateCredentialCache(ctx, request)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) CreateCredential(ctx context.Context, req *milvuspb.CreateCredentialRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.CreateCredential(ctx, req)
|
|
|
|
}
|
|
|
|
|
2022-04-19 16:35:39 +08:00
|
|
|
func (s *Server) UpdateCredential(ctx context.Context, req *milvuspb.UpdateCredentialRequest) (*commonpb.Status, error) {
|
2022-04-11 19:49:34 +08:00
|
|
|
return s.proxy.UpdateCredential(ctx, req)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) DeleteCredential(ctx context.Context, req *milvuspb.DeleteCredentialRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.DeleteCredential(ctx, req)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) ListCredUsers(ctx context.Context, req *milvuspb.ListCredUsersRequest) (*milvuspb.ListCredUsersResponse, error) {
|
|
|
|
return s.proxy.ListCredUsers(ctx, req)
|
|
|
|
}
|
2022-05-28 00:04:01 +08:00
|
|
|
|
2022-08-04 11:04:34 +08:00
|
|
|
func (s *Server) CreateRole(ctx context.Context, req *milvuspb.CreateRoleRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.CreateRole(ctx, req)
|
2022-05-28 00:04:01 +08:00
|
|
|
}
|
|
|
|
|
2022-08-04 11:04:34 +08:00
|
|
|
func (s *Server) DropRole(ctx context.Context, req *milvuspb.DropRoleRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.DropRole(ctx, req)
|
2022-05-28 00:04:01 +08:00
|
|
|
}
|
|
|
|
|
2022-08-04 11:04:34 +08:00
|
|
|
func (s *Server) OperateUserRole(ctx context.Context, req *milvuspb.OperateUserRoleRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.OperateUserRole(ctx, req)
|
2022-05-28 00:04:01 +08:00
|
|
|
}
|
|
|
|
|
2022-08-04 11:04:34 +08:00
|
|
|
func (s *Server) SelectRole(ctx context.Context, req *milvuspb.SelectRoleRequest) (*milvuspb.SelectRoleResponse, error) {
|
|
|
|
return s.proxy.SelectRole(ctx, req)
|
2022-05-28 00:04:01 +08:00
|
|
|
}
|
|
|
|
|
2022-08-04 11:04:34 +08:00
|
|
|
func (s *Server) SelectUser(ctx context.Context, req *milvuspb.SelectUserRequest) (*milvuspb.SelectUserResponse, error) {
|
|
|
|
return s.proxy.SelectUser(ctx, req)
|
2022-05-28 00:04:01 +08:00
|
|
|
}
|
|
|
|
|
2022-08-04 11:04:34 +08:00
|
|
|
func (s *Server) OperatePrivilege(ctx context.Context, req *milvuspb.OperatePrivilegeRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.OperatePrivilege(ctx, req)
|
2022-05-28 00:04:01 +08:00
|
|
|
}
|
|
|
|
|
2022-08-04 11:04:34 +08:00
|
|
|
func (s *Server) SelectGrant(ctx context.Context, req *milvuspb.SelectGrantRequest) (*milvuspb.SelectGrantResponse, error) {
|
|
|
|
return s.proxy.SelectGrant(ctx, req)
|
2022-05-28 00:04:01 +08:00
|
|
|
}
|
|
|
|
|
2022-08-04 11:04:34 +08:00
|
|
|
func (s *Server) RefreshPolicyInfoCache(ctx context.Context, req *proxypb.RefreshPolicyInfoCacheRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.RefreshPolicyInfoCache(ctx, req)
|
2022-05-28 00:04:01 +08:00
|
|
|
}
|
2022-09-16 09:56:47 +08:00
|
|
|
|
|
|
|
// SetRates notifies Proxy to limit rates of requests.
|
|
|
|
func (s *Server) SetRates(ctx context.Context, request *proxypb.SetRatesRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxy.SetRates(ctx, request)
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetProxyMetrics gets the metrics of proxy.
|
|
|
|
func (s *Server) GetProxyMetrics(ctx context.Context, request *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) {
|
|
|
|
return s.proxy.GetProxyMetrics(ctx, request)
|
|
|
|
}
|
2022-10-14 09:59:24 +08:00
|
|
|
|
|
|
|
func (s *Server) GetVersion(ctx context.Context, request *milvuspb.GetVersionRequest) (*milvuspb.GetVersionResponse, error) {
|
|
|
|
buildTags := os.Getenv(metricsinfo.GitBuildTagsEnvKey)
|
|
|
|
return &milvuspb.GetVersionResponse{
|
2022-10-20 19:47:33 +08:00
|
|
|
Status: &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_Success,
|
|
|
|
Reason: "",
|
|
|
|
},
|
2022-10-14 09:59:24 +08:00
|
|
|
Version: buildTags,
|
|
|
|
}, nil
|
|
|
|
}
|
2022-10-18 13:39:26 +08:00
|
|
|
|
|
|
|
func (s *Server) CheckHealth(ctx context.Context, request *milvuspb.CheckHealthRequest) (*milvuspb.CheckHealthResponse, error) {
|
|
|
|
return s.proxy.CheckHealth(ctx, request)
|
|
|
|
}
|