mirror of https://github.com/milvus-io/milvus.git
Cherry-pick from master pr: #32001 The `err != nil` check is duplicated here and shall be removed Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/32115/head
parent
e04fa2b10d
commit
e3821f5a48
|
@ -1740,30 +1740,26 @@ func (node *Proxy) GetLoadState(ctx context.Context, request *milvuspb.GetLoadSt
|
|||
var progress int64
|
||||
if len(request.GetPartitionNames()) == 0 {
|
||||
if progress, _, err = getCollectionProgress(ctx, node.queryCoord, request.GetBase(), collectionID); err != nil {
|
||||
if err != nil {
|
||||
if errors.Is(err, merr.ErrCollectionNotLoaded) {
|
||||
successResponse.State = commonpb.LoadState_LoadStateNotLoad
|
||||
return successResponse, nil
|
||||
}
|
||||
return &milvuspb.GetLoadStateResponse{
|
||||
Status: merr.Status(err),
|
||||
}, nil
|
||||
if errors.Is(err, merr.ErrCollectionNotLoaded) {
|
||||
successResponse.State = commonpb.LoadState_LoadStateNotLoad
|
||||
return successResponse, nil
|
||||
}
|
||||
return &milvuspb.GetLoadStateResponse{
|
||||
Status: merr.Status(err),
|
||||
}, nil
|
||||
}
|
||||
} else {
|
||||
if progress, _, err = getPartitionProgress(ctx, node.queryCoord, request.GetBase(),
|
||||
request.GetPartitionNames(), request.GetCollectionName(), collectionID, request.GetDbName()); err != nil {
|
||||
if err != nil {
|
||||
if errors.IsAny(err,
|
||||
merr.ErrCollectionNotLoaded,
|
||||
merr.ErrPartitionNotLoaded) {
|
||||
successResponse.State = commonpb.LoadState_LoadStateNotLoad
|
||||
return successResponse, nil
|
||||
}
|
||||
return &milvuspb.GetLoadStateResponse{
|
||||
Status: merr.Status(err),
|
||||
}, nil
|
||||
if errors.IsAny(err,
|
||||
merr.ErrCollectionNotLoaded,
|
||||
merr.ErrPartitionNotLoaded) {
|
||||
successResponse.State = commonpb.LoadState_LoadStateNotLoad
|
||||
return successResponse, nil
|
||||
}
|
||||
return &milvuspb.GetLoadStateResponse{
|
||||
Status: merr.Status(err),
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
if progress >= 100 {
|
||||
|
|
Loading…
Reference in New Issue