mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
enhance: remove extra get collection (#42042)
Signed-off-by: yangxuan <xuan.yang@zilliz.com>
This commit is contained in:
parent
f1a4526bac
commit
83877b9faf
@ -259,7 +259,12 @@ func (loader *segmentLoader) Load(ctx context.Context,
|
||||
addBucketNameStorageV2(segmentInfo)
|
||||
}
|
||||
|
||||
coll := loader.manager.Collection.Get(collectionID)
|
||||
collection := loader.manager.Collection.Get(collectionID)
|
||||
if collection == nil {
|
||||
err := merr.WrapErrCollectionNotFound(collectionID)
|
||||
log.Warn("failed to get collection", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Filter out loaded & loading segments
|
||||
infos := loader.prepare(ctx, segmentType, segments...)
|
||||
@ -276,7 +281,7 @@ func (loader *segmentLoader) Load(ctx context.Context,
|
||||
var err error
|
||||
var requestResourceResult requestResourceResult
|
||||
|
||||
if !isLazyLoad(coll, segmentType) {
|
||||
if !isLazyLoad(collection, segmentType) {
|
||||
// Check memory & storage limit
|
||||
// no need to check resource for lazy load here
|
||||
requestResourceResult, err = loader.requestResource(ctx, infos...)
|
||||
@ -300,13 +305,6 @@ func (loader *segmentLoader) Load(ctx context.Context,
|
||||
debug.FreeOSMemory()
|
||||
}()
|
||||
|
||||
collection := loader.manager.Collection.Get(collectionID)
|
||||
if collection == nil {
|
||||
err := merr.WrapErrCollectionNotFound(collectionID)
|
||||
log.Warn("failed to get collection", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, info := range infos {
|
||||
loadInfo := info
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user