Return NotShardLeader error code when dml channel is not watched (#18055)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2022-07-05 13:08:19 +08:00 committed by GitHub
parent b31f937301
commit d652fa567a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -519,6 +519,7 @@ func (node *QueryNode) Search(ctx context.Context, req *queryPb.SearchRequest) (
//from Proxy
cluster, ok := qs.clusterService.getShardCluster(req.GetDmlChannel())
if !ok {
failRet.Status.ErrorCode = commonpb.ErrorCode_NotShardLeader
failRet.Status.Reason = fmt.Sprintf("channel %s leader is not here", req.GetDmlChannel())
return failRet, nil
}
@ -663,6 +664,7 @@ func (node *QueryNode) Query(ctx context.Context, req *queryPb.QueryRequest) (*i
cluster, ok := qs.clusterService.getShardCluster(req.GetDmlChannel())
if !ok {
failRet.Status.ErrorCode = commonpb.ErrorCode_NotShardLeader
failRet.Status.Reason = fmt.Sprintf("channel %s leader is not here", req.GetDmlChannel())
return failRet, nil
}