enhance: use local path as mmap file path if no mmap path provided (#28992)

the mmap mode isn't controlled by the config anymore, so we don't
require user to set it when they enabled mmap mode.

Signed-off-by: yah01 <yah2er0ne@outlook.com>
pull/29410/head
yah01 2023-12-21 18:12:45 +08:00 committed by GitHub
parent a0e1a1eb31
commit 1997fd150c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -234,7 +234,11 @@ func (node *QueryNode) InitSegcore() error {
mmapDirPath := paramtable.Get().QueryNodeCfg.MmapDirPath.GetValue()
if len(mmapDirPath) == 0 {
mmapDirPath = paramtable.Get().LocalStorageCfg.Path.GetValue()
paramtable.Get().Save(
paramtable.Get().QueryNodeCfg.MmapDirPath.Key,
path.Join(paramtable.Get().LocalStorageCfg.Path.GetValue(), "mmap"),
)
mmapDirPath = paramtable.Get().QueryNodeCfg.MmapDirPath.GetValue()
}
chunkCachePath := path.Join(mmapDirPath, "chunk_cache")
policy := paramtable.Get().QueryNodeCfg.ReadAheadPolicy.GetValue()