mirror of https://github.com/milvus-io/milvus.git
fix: index attr caches wrong result variable (#30960)
See also #30757 #30756 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/30777/head
parent
2180e2cfae
commit
385dec3b69
|
@ -59,7 +59,7 @@ func (c *IndexAttrCache) GetIndexResourceUsage(indexInfo *querypb.FieldIndexInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
engineVersion := indexInfo.GetCurrentIndexVersion()
|
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 {
|
if !has {
|
||||||
isLoadWithDisk, _, _ = c.sf.Do(fmt.Sprintf("%s_%d", indexType, engineVersion), func() (bool, error) {
|
isLoadWithDisk, _, _ = c.sf.Do(fmt.Sprintf("%s_%d", indexType, engineVersion), func() (bool, error) {
|
||||||
var result bool
|
var result bool
|
||||||
|
@ -67,10 +67,10 @@ func (c *IndexAttrCache) GetIndexResourceUsage(indexInfo *querypb.FieldIndexInfo
|
||||||
cIndexType := C.CString(indexType)
|
cIndexType := C.CString(indexType)
|
||||||
defer C.free(unsafe.Pointer(cIndexType))
|
defer C.free(unsafe.Pointer(cIndexType))
|
||||||
cEngineVersion := C.int32_t(indexInfo.GetCurrentIndexVersion())
|
cEngineVersion := C.int32_t(indexInfo.GetCurrentIndexVersion())
|
||||||
isLoadWithDisk = bool(C.IsLoadWithDisk(cIndexType, cEngineVersion))
|
result = bool(C.IsLoadWithDisk(cIndexType, cEngineVersion))
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}).Await()
|
}).Await()
|
||||||
c.loadWithDisk.Insert(typeutil.NewPair[string, int32](indexType, engineVersion), result)
|
c.loadWithDisk.Insert(typeutil.NewPair(indexType, engineVersion), result)
|
||||||
return result, nil
|
return result, nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue