Create dir if mmap enabled for validating path (#25750)

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/25774/head
yah01 2023-07-19 18:48:58 +08:00 committed by GitHub
parent 172db82b23
commit 361db51337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -353,10 +353,19 @@ func (node *QueryNode) Start() error {
paramtable.SetCreateTime(time.Now())
paramtable.SetUpdateTime(time.Now())
mmapDirPath := paramtable.Get().QueryNodeCfg.MmapDirPath.GetValue()
mmapEnabled := len(mmapDirPath) > 0
if mmapEnabled {
err := os.MkdirAll(mmapDirPath, 0666)
if err != nil {
panic(err)
}
}
node.UpdateStateCode(commonpb.StateCode_Healthy)
log.Info("query node start successfully",
zap.Int64("queryNodeID", paramtable.GetNodeID()),
zap.String("Address", node.address),
zap.Bool("mmapEnabled", mmapEnabled),
)
})