From 248bbc749d537970b85698ec628898552e44004e Mon Sep 17 00:00:00 2001 From: smellthemoon <64083300+smellthemoon@users.noreply.github.com> Date: Fri, 11 Aug 2023 10:21:29 +0800 Subject: [PATCH] Fix GetCollectionID to return err (#26239) Signed-off-by: lixinguo Co-authored-by: lixinguo --- internal/proxy/meta_cache.go | 2 +- internal/proxy/task_search.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/proxy/meta_cache.go b/internal/proxy/meta_cache.go index c0749d9db0..b3b8e6ddbd 100644 --- a/internal/proxy/meta_cache.go +++ b/internal/proxy/meta_cache.go @@ -289,7 +289,7 @@ func (m *MetaCache) GetCollectionName(ctx context.Context, database string, coll } } - method := "GeCollectionName" + method := "GetCollectionName" if collInfo == nil || !collInfo.isCollectionCached() { metrics.ProxyCacheStatsCounter.WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), method, metrics.CacheMissLabel).Inc() tr := timerecord.NewTimeRecorder("UpdateCache") diff --git a/internal/proxy/task_search.go b/internal/proxy/task_search.go index 554baae2f6..8f943ea3a7 100644 --- a/internal/proxy/task_search.go +++ b/internal/proxy/task_search.go @@ -221,7 +221,11 @@ func (t *searchTask) PreExecute(ctx context.Context) error { t.SearchRequest.DbID = 0 // todo t.SearchRequest.CollectionID = collID - t.schema, _ = globalMetaCache.GetCollectionSchema(ctx, t.request.GetDbName(), collectionName) + t.schema, err = globalMetaCache.GetCollectionSchema(ctx, t.request.GetDbName(), collectionName) + if err != nil { + log.Warn("get collection schema failed", zap.Error(err)) + return err + } partitionKeyMode, err := isPartitionKeyMode(ctx, t.request.GetDbName(), collectionName) if err != nil {