mirror of https://github.com/milvus-io/milvus.git
issue: #31351 pr: #31380 This PR fixed that search doesn't expire shard leader cache when send request to query node failed, which make every request keep trying to connect a offline query node Signed-off-by: Wei Liu <wei.liu@zilliz.com>pull/31472/head
parent
1ca7cba222
commit
5994b6a7b0
|
@ -542,10 +542,12 @@ func (t *searchTask) searchShard(ctx context.Context, nodeID int64, qn types.Que
|
|||
result, err = qn.Search(ctx, req)
|
||||
if err != nil {
|
||||
log.Warn("QueryNode search return error", zap.Error(err))
|
||||
globalMetaCache.DeprecateShardCache(t.request.GetDbName(), t.collectionName)
|
||||
return err
|
||||
}
|
||||
if result.GetStatus().GetErrorCode() == commonpb.ErrorCode_NotShardLeader {
|
||||
log.Warn("QueryNode is not shardLeader")
|
||||
globalMetaCache.DeprecateShardCache(t.request.GetDbName(), t.collectionName)
|
||||
return errInvalidShardLeaders
|
||||
}
|
||||
if result.GetStatus().GetErrorCode() != commonpb.ErrorCode_Success {
|
||||
|
|
|
@ -301,7 +301,6 @@ func (g *getStatisticsTask) getStatisticsShard(ctx context.Context, nodeID int64
|
|||
log.Warn("QueryNode statistic result error",
|
||||
zap.Int64("nodeID", nodeID),
|
||||
zap.String("reason", result.GetStatus().GetReason()))
|
||||
globalMetaCache.DeprecateShardCache(g.request.GetDbName(), g.collectionName)
|
||||
return fmt.Errorf("fail to get statistic, QueryNode ID=%d, reason=%s", nodeID, result.GetStatus().GetReason())
|
||||
}
|
||||
g.resultBuf.Insert(result)
|
||||
|
|
Loading…
Reference in New Issue