mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
enhance: add lazyload global config (#31610)
Signed-off-by: sunby <sunbingyi1992@gmail.com>
This commit is contained in:
parent
4eb4df1e81
commit
fbff46a005
@ -358,6 +358,7 @@ queryNode:
|
||||
maxPendingTaskPerUser: 1024 # 50 by default, max pending task in scheduler per user.
|
||||
mmap:
|
||||
mmapEnabled: false # enable mmap global, if set true, will use mmap to load segment data
|
||||
lazyloadEnabled: false
|
||||
|
||||
# can specify ip for example
|
||||
# ip: 127.0.0.1
|
||||
|
@ -611,7 +611,8 @@ func (loader *segmentLoader) Load(ctx context.Context,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if common.IsCollectionLazyLoadEnabled(collection.Schema().Properties...) {
|
||||
if common.IsCollectionLazyLoadEnabled(collection.Schema().Properties...) ||
|
||||
(!common.HasLazyload(collection.Schema().Properties) && params.Params.QueryNodeCfg.LazyLoadEnabled.GetAsBool()) {
|
||||
loadStatus = LoadStatusMeta
|
||||
}
|
||||
|
||||
|
@ -179,6 +179,15 @@ func FieldHasMmapKey(schema *schemapb.CollectionSchema, fieldID int64) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func HasLazyload(props []*commonpb.KeyValuePair) bool {
|
||||
for _, kv := range props {
|
||||
if kv.Key == LazyLoadEnableKey {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func IsCollectionLazyLoadEnabled(kvs ...*commonpb.KeyValuePair) bool {
|
||||
for _, kv := range kvs {
|
||||
if kv.Key == LazyLoadEnableKey && strings.ToLower(kv.Value) == "true" {
|
||||
|
@ -1947,6 +1947,8 @@ type queryNodeConfig struct {
|
||||
MmapDirPath ParamItem `refreshable:"false"`
|
||||
MmapEnabled ParamItem `refreshable:"false"`
|
||||
|
||||
LazyLoadEnabled ParamItem `refreshable:"false"`
|
||||
|
||||
// chunk cache
|
||||
ReadAheadPolicy ParamItem `refreshable:"false"`
|
||||
ChunkCacheWarmingUp ParamItem `refreshable:"true"`
|
||||
@ -2179,6 +2181,14 @@ func (p *queryNodeConfig) init(base *BaseTable) {
|
||||
}
|
||||
p.MmapEnabled.Init(base.mgr)
|
||||
|
||||
p.LazyLoadEnabled = ParamItem{
|
||||
Key: "queryNode.lazyloadEnabled",
|
||||
Version: "2.4.0",
|
||||
DefaultValue: "false",
|
||||
Doc: "Enable lazyload for loading data",
|
||||
}
|
||||
p.LazyLoadEnabled.Init(base.mgr)
|
||||
|
||||
p.ReadAheadPolicy = ParamItem{
|
||||
Key: "queryNode.cache.readAheadPolicy",
|
||||
Version: "2.3.2",
|
||||
|
Loading…
Reference in New Issue
Block a user