diff --git a/internal/dataservice/grpc_services.go b/internal/dataservice/grpc_services.go index 839df860bd6f929ce5ea4de77e809637814d22a2..13b2700fdea76d6c76e649125956812b48210da3 100644 --- a/internal/dataservice/grpc_services.go +++ b/internal/dataservice/grpc_services.go @@ -194,6 +194,10 @@ func (s *Server) GetInsertBinlogPaths(ctx context.Context, req *datapb.GetInsert ErrorCode: commonpb.ErrorCode_UnexpectedError, }, } + if s.isClosed() { + resp.Status.Reason = "server is initializing" + return resp, nil + } p := path.Join(Params.SegmentBinlogSubPath, strconv.FormatInt(req.SegmentID, 10)) + "/" // prefix/id/ instead of prefix/id _, values, err := s.kvClient.LoadWithPrefix(p) if err != nil { @@ -237,6 +241,10 @@ func (s *Server) GetCollectionStatistics(ctx context.Context, req *datapb.GetCol ErrorCode: commonpb.ErrorCode_UnexpectedError, }, } + if s.isClosed() { + resp.Status.Reason = "server is initializing" + return resp, nil + } nums, err := s.meta.GetNumRowsOfCollection(req.CollectionID) if err != nil { resp.Status.Reason = err.Error() @@ -253,6 +261,10 @@ func (s *Server) GetPartitionStatistics(ctx context.Context, req *datapb.GetPart ErrorCode: commonpb.ErrorCode_UnexpectedError, }, } + if s.isClosed() { + resp.Status.Reason = "server is initializing" + return resp, nil + } nums, err := s.meta.GetNumRowsOfPartition(req.CollectionID, req.PartitionID) if err != nil { resp.Status.Reason = err.Error() @@ -380,6 +392,10 @@ func (s *Server) GetRecoveryInfo(ctx context.Context, req *datapb.GetRecoveryInf ErrorCode: commonpb.ErrorCode_UnexpectedError, }, } + if s.isClosed() { + resp.Status.Reason = "server is initializing" + return resp, nil + } segmentIDs := s.meta.GetSegmentsOfPartition(collectionID, partitionID) segment2Binlogs := make(map[UniqueID][]*datapb.FieldBinlog) for _, id := range segmentIDs {