From 4721bd655d0a9ee3c1ef2f6fff8e36a6f0362a35 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Thu, 26 Sep 2024 19:02:40 +0800 Subject: [PATCH] fix e2e Signed-off-by: Wei Liu --- internal/querycoordv2/services.go | 17 +++++++++++++++++ internal/querycoordv2/utils/util.go | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/internal/querycoordv2/services.go b/internal/querycoordv2/services.go index 95ca6cead963a..bd45d3ea8e5b7 100644 --- a/internal/querycoordv2/services.go +++ b/internal/querycoordv2/services.go @@ -35,6 +35,7 @@ import ( "github.com/milvus-io/milvus/internal/querycoordv2/meta" "github.com/milvus-io/milvus/internal/querycoordv2/utils" "github.com/milvus-io/milvus/internal/util/componentutil" + "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg/metrics" "github.com/milvus-io/milvus/pkg/util/merr" @@ -112,6 +113,14 @@ func (s *Server) ShowCollections(ctx context.Context, req *querypb.ShowCollectio }, nil } + if !s.targetMgr.IsCurrentTargetExist(collectionID, common.AllPartitionsID) { + err := merr.WrapErrCollectionNotFullyLoaded(collectionID) + log.Warn("show collection failed", zap.Error(err)) + return &querypb.ShowCollectionsResponse{ + Status: merr.Status(err), + }, nil + } + if collection.IsRefreshed() { refreshProgress = 100 } @@ -174,6 +183,14 @@ func (s *Server) ShowPartitions(ctx context.Context, req *querypb.ShowPartitions percentages = append(percentages, int64(percentage)) } + if !s.targetMgr.IsCurrentTargetExist(req.GetCollectionID(), common.AllPartitionsID) { + err := merr.WrapErrCollectionNotFullyLoaded(req.GetCollectionID()) + log.Warn("show collection failed", zap.Error(err)) + return &querypb.ShowPartitionsResponse{ + Status: merr.Status(err), + }, nil + } + collection := s.meta.GetCollection(req.GetCollectionID()) if collection != nil && collection.IsRefreshed() { refreshProgress = 100 diff --git a/internal/querycoordv2/utils/util.go b/internal/querycoordv2/utils/util.go index f27b2843eb258..cf91ba0a79510 100644 --- a/internal/querycoordv2/utils/util.go +++ b/internal/querycoordv2/utils/util.go @@ -75,7 +75,7 @@ func CheckLeaderAvailable(nodeMgr *session.NodeManager, targetMgr meta.TargetMan if leader.TargetVersion <= 0 || currentTargetVersion <= 0 || leader.TargetVersion != currentTargetVersion { return merr.WrapErrServiceInternal( fmt.Sprintf("target version mismatch, collection: %d, current target version: %v, leader version: %v", - leader.CollectionID, currentTargetVersion, leader)) + leader.CollectionID, currentTargetVersion, leader.TargetVersion)) } segmentDist := targetMgr.GetSealedSegmentsByChannel(leader.CollectionID, leader.Channel, meta.CurrentTarget)