Skip to content

Commit

Permalink
fix e2e
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Liu <[email protected]>
  • Loading branch information
weiliu1031 committed Sep 26, 2024
1 parent 1d6f3f5 commit 4721bd6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions internal/querycoordv2/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/querycoordv2/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4721bd6

Please sign in to comment.