未验证 提交 52fb48a3 编写于 作者: X Xiaofan 提交者: GitHub

Add more log when search result is empty (#23421)

Signed-off-by: Nxiaofan-luan <xiaofan.luan@zilliz.com>
上级 aa26fce8
......@@ -528,8 +528,6 @@ func (sched *taskScheduler) queryLoop() {
if !sched.dqQueue.utEmpty() {
t := sched.scheduleDqTask()
go sched.processTask(t, sched.dqQueue)
} else {
log.Debug("query queue is empty ...")
}
}
}
......
......@@ -409,7 +409,7 @@ func (t *searchTask) Execute(ctx context.Context) error {
t.resultBuf = make(chan *internalpb.SearchResults, len(shard2Leaders))
t.toReduceResults = make([]*internalpb.SearchResults, 0, len(shard2Leaders))
if err := t.searchShardPolicy(ctx, t.shardMgr, t.searchShard, shard2Leaders); err != nil {
log.Warn("failed to do search", zap.String("Shards", fmt.Sprintf("%v", shard2Leaders)), zap.Error(err))
log.Warn("failed to do search", zap.String("Shards", fmt.Sprintf("%v", shard2Leaders)), zap.Int64("msgId", t.ID()), zap.Error(err))
return err
}
return nil
......@@ -422,8 +422,7 @@ func (t *searchTask) Execute(ctx context.Context) error {
cancel()
}
if searchErr != nil {
log.Warn("first search failed, updating shardleader caches and retry search",
zap.Error(searchErr))
log.Warn("first search failed, updating shardleader caches and retry search", zap.Int64("msgId", t.ID()), zap.Error(searchErr))
globalMetaCache.DeprecateShardCache(t.collectionName)
}
return searchErr
......@@ -466,7 +465,7 @@ func (t *searchTask) PostExecute(ctx context.Context) error {
metrics.SearchLabel).Observe(float64(tr.RecordSpan().Milliseconds()))
if len(validSearchResults) <= 0 {
log.Ctx(ctx).Warn("search result is empty", zap.Int64("msgID", t.ID()))
log.Ctx(ctx).Warn("search result is empty", zap.String("collection", t.collectionName), zap.String("DSL", t.Dsl), zap.Int64("msgID", t.ID()))
t.fillInEmptyResult(Nq)
return nil
......
......@@ -792,6 +792,16 @@ func (node *QueryNode) Search(ctx context.Context, req *querypb.SearchRequest) (
rateCol.Add(metricsinfo.SearchThroughput, float64(proto.Size(req)))
metrics.QueryNodeExecuteCounter.WithLabelValues(strconv.FormatInt(Params.QueryNodeCfg.GetNodeID(), 10), metrics.SearchLabel).Add(float64(proto.Size(req)))
}
if ret.SlicedBlob == nil {
log.Ctx(ctx).Info("search result is empty",
zap.Strings("vChannels", req.GetDmlChannels()),
zap.Int64s("segmentIDs", req.GetSegmentIDs()),
zap.Int64("collection", req.Req.CollectionID),
zap.Strings("shard", req.DmlChannels),
zap.Bool("from shard leader", req.FromShardLeader),
zap.String("dsl", req.Req.Dsl))
}
return ret, nil
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册