diff --git a/internal/proto/query_coord.proto b/internal/proto/query_coord.proto index c375154ddf..f77ce1c604 100644 --- a/internal/proto/query_coord.proto +++ b/internal/proto/query_coord.proto @@ -342,7 +342,6 @@ message SegmentLoadInfo { int64 readableVersion = 16; data.SegmentLevel level = 17; int64 storageVersion = 18; - bool lazy_load = 19; } message FieldIndexInfo { diff --git a/internal/querynodev2/segments/segment.go b/internal/querynodev2/segments/segment.go index 79192907c7..1275ef1f07 100644 --- a/internal/querynodev2/segments/segment.go +++ b/internal/querynodev2/segments/segment.go @@ -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) { diff --git a/internal/querynodev2/segments/segment_loader.go b/internal/querynodev2/segments/segment_loader.go index b89b722a16..17d7b290a0 100644 --- a/internal/querynodev2/segments/segment_loader.go +++ b/internal/querynodev2/segments/segment_loader.go @@ -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 } diff --git a/pkg/common/common.go b/pkg/common/common.go index 79090d36cb..fe0d663120 100644 --- a/pkg/common/common.go +++ b/pkg/common/common.go @@ -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 } }