From 385dec3b692c2042ea61f72b18c6accbe0fb49d8 Mon Sep 17 00:00:00 2001 From: congqixia Date: Fri, 1 Mar 2024 13:17:00 +0800 Subject: [PATCH] fix: index attr caches wrong result variable (#30960) See also #30757 #30756 Signed-off-by: Congqi Xia --- internal/querynodev2/segments/index_attr_cache.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/querynodev2/segments/index_attr_cache.go b/internal/querynodev2/segments/index_attr_cache.go index a4f9cc5161..1beb575dc3 100644 --- a/internal/querynodev2/segments/index_attr_cache.go +++ b/internal/querynodev2/segments/index_attr_cache.go @@ -59,7 +59,7 @@ func (c *IndexAttrCache) GetIndexResourceUsage(indexInfo *querypb.FieldIndexInfo } engineVersion := indexInfo.GetCurrentIndexVersion() - isLoadWithDisk, has := c.loadWithDisk.Get(typeutil.NewPair[string, int32](indexType, engineVersion)) + isLoadWithDisk, has := c.loadWithDisk.Get(typeutil.NewPair(indexType, engineVersion)) if !has { isLoadWithDisk, _, _ = c.sf.Do(fmt.Sprintf("%s_%d", indexType, engineVersion), func() (bool, error) { var result bool @@ -67,10 +67,10 @@ func (c *IndexAttrCache) GetIndexResourceUsage(indexInfo *querypb.FieldIndexInfo cIndexType := C.CString(indexType) defer C.free(unsafe.Pointer(cIndexType)) cEngineVersion := C.int32_t(indexInfo.GetCurrentIndexVersion()) - isLoadWithDisk = bool(C.IsLoadWithDisk(cIndexType, cEngineVersion)) + result = bool(C.IsLoadWithDisk(cIndexType, cEngineVersion)) return nil, nil }).Await() - c.loadWithDisk.Insert(typeutil.NewPair[string, int32](indexType, engineVersion), result) + c.loadWithDisk.Insert(typeutil.NewPair(indexType, engineVersion), result) return result, nil }) }