mirror of https://github.com/milvus-io/milvus.git
Cherry-pick from master pr: #33450 See also #30943 #30944 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/33560/head
parent
e68f0bf787
commit
b9b76ee9a4
|
@ -2461,7 +2461,6 @@ Max read concurrency must greater than or equal to 1, and less than or equal to
|
|||
}
|
||||
diskUsage, err := disk.Usage(localStoragePath)
|
||||
if err != nil {
|
||||
// panic(err)
|
||||
log.Fatal("failed to get disk usage", zap.String("localStoragePath", localStoragePath), zap.Error(err))
|
||||
}
|
||||
return strconv.FormatUint(diskUsage.Total, 10)
|
||||
|
@ -3748,9 +3747,16 @@ func (p *indexNodeConfig) init(base *BaseTable) {
|
|||
Version: "2.2.0",
|
||||
Formatter: func(v string) string {
|
||||
if len(v) == 0 {
|
||||
diskUsage, err := disk.Usage("/")
|
||||
// use local storage path to check correct device
|
||||
localStoragePath := base.Get("localStorage.path")
|
||||
if _, err := os.Stat(localStoragePath); os.IsNotExist(err) {
|
||||
if err := os.MkdirAll(localStoragePath, os.ModePerm); err != nil {
|
||||
log.Fatal("failed to mkdir", zap.String("localStoragePath", localStoragePath), zap.Error(err))
|
||||
}
|
||||
}
|
||||
diskUsage, err := disk.Usage(localStoragePath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
log.Fatal("failed to get disk usage", zap.String("localStoragePath", localStoragePath), zap.Error(err))
|
||||
}
|
||||
return strconv.FormatUint(diskUsage.Total, 10)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue