fix: check collection lazy load prop using schema (#30992)

issue: https://github.com/milvus-io/milvus/issues/30361

---------

Signed-off-by: sunby <sunbingyi1992@gmail.com>
pull/31067/head
Bingyi Sun 2024-03-06 16:19:01 +08:00 committed by GitHub
parent df7aafa3ec
commit fd17a5f050
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View File

@ -342,7 +342,6 @@ message SegmentLoadInfo {
int64 readableVersion = 16;
data.SegmentLevel level = 17;
int64 storageVersion = 18;
bool lazy_load = 19;
}
message FieldIndexInfo {

View File

@ -93,6 +93,7 @@ type baseSegment struct {
isLazyLoad bool
startPosition *msgpb.MsgPosition // for growing segment release
bloomFilterSet *pkoracle.BloomFilterSet
loadInfo *querypb.SegmentLoadInfo
}
func newBaseSegment(id, partitionID, collectionID int64, shard string, typ SegmentType, level datapb.SegmentLevel, version int64, startPosition *msgpb.MsgPosition) baseSegment {
@ -156,8 +157,7 @@ func (s *baseSegment) IsLazyLoad() bool {
}
func (s *baseSegment) LoadInfo() *querypb.SegmentLoadInfo {
// TODO
return nil
return s.loadInfo
}
func (s *baseSegment) UpdateBloomFilter(pks []storage.PrimaryKey) {

View File

@ -934,7 +934,8 @@ func (loader *segmentLoader) loadSegment(ctx context.Context,
if segment.Type() == SegmentTypeSealed {
loadStatus := LoadStatusInMemory
if loadInfo.GetLazyLoad() {
if common.IsCollectionLazyLoadEnabled(collection.Schema().GetProperties()...) {
segment.baseSegment.loadInfo = loadInfo
loadStatus = LoadStatusMeta
}

View File

@ -18,6 +18,7 @@ package common
import (
"encoding/binary"
"strings"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
@ -142,7 +143,7 @@ func IsSystemField(fieldID int64) bool {
func IsMmapEnabled(kvs ...*commonpb.KeyValuePair) bool {
for _, kv := range kvs {
if kv.Key == MmapEnabledKey && kv.Value == "true" {
if kv.Key == MmapEnabledKey && strings.ToLower(kv.Value) == "true" {
return true
}
}
@ -160,7 +161,7 @@ func IsFieldMmapEnabled(schema *schemapb.CollectionSchema, fieldID int64) bool {
func IsCollectionLazyLoadEnabled(kvs ...*commonpb.KeyValuePair) bool {
for _, kv := range kvs {
if kv.Key == LazyLoadEnableKey && kv.Value == "true" {
if kv.Key == LazyLoadEnableKey && strings.ToLower(kv.Value) == "true" {
return true
}
}