enhance: [2.4]Return collection not loaded rather than not found on querynode (#38593) (#38920)

issue: https://github.com/milvus-io/milvus/issues/38586

master pr: https://github.com/milvus-io/milvus/pull/38593

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
pull/39021/head
cai.zhang 2025-01-05 18:56:55 +08:00 committed by GitHub
parent 52a135cf78
commit b4c773de69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -766,7 +766,7 @@ func (node *QueryNode) Search(ctx context.Context, req *querypb.SearchRequest) (
}
collection := node.manager.Collection.Get(req.GetReq().GetCollectionID())
if collection == nil {
resp.Status = merr.Status(merr.WrapErrCollectionNotFound(req.GetReq().GetCollectionID()))
resp.Status = merr.Status(merr.WrapErrCollectionNotLoaded(req.GetReq().GetCollectionID()))
return resp, nil
}
if req.Req.MetricType == "" && !req.GetReq().GetIsAdvanced() {

View File

@ -1258,8 +1258,8 @@ func (suite *ServiceSuite) TestSearch_Failed() {
// collection not exist
resp, err := suite.node.Search(ctx, req)
suite.NoError(err)
suite.Equal(commonpb.ErrorCode_CollectionNotExists, resp.GetStatus().GetErrorCode())
suite.Contains(resp.GetStatus().GetReason(), merr.ErrCollectionNotFound.Error())
suite.Equal(merr.Code(merr.ErrCollectionNotLoaded), resp.GetStatus().GetCode())
suite.Contains(resp.GetStatus().GetReason(), merr.ErrCollectionNotLoaded.Error())
// metric type mismatch
LoadMeta := &querypb.LoadMetaInfo{