Commit 9e029594 authored by jinhai's avatar jinhai
Browse files

Merge branch 'branch-0.5.0' into 'branch-0.5.0'

MS-653 fix when config check fail, Milvus close without message

See merge request megasearch/milvus!732

Former-commit-id: 5629f4d07ae7bf130fc00a340b594868acac9fb2
parents fff91fc9 7929ecd5
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -11,17 +11,18 @@ Please mark all change in change log and use the ticket from JIRA.
- MS-587 - Count get wrong result after adding vectors and index built immediately
- MS-599 - Search wrong result when table created with metric_type: IP
- MS-601 - Docker logs error caused by get CPUTemperature error
- MS-622 - Delete vectors should be failed if date range is invalid
- MS-605 - Server going down during searching vectors
- MS-620 - Get table row counts display wrong error code
- MS-622 - Delete vectors should be failed if date range is invalid
- MS-624 - Search vectors failed if time ranges long enough
- MS-637 - Out of memory when load too many tasks
- MS-639 - SQ8H index created failed and server hang
- MS-640 - Cache object size calculate incorrect
- MS-641 - Segment fault(signal 11) in PickToLoad
- MS-639 - SQ8H index created failed and server hang
- MS-647 - [monitor] grafana display average cpu-temp
- MS-644 - Search crashed with index-type: flat
- MS-624 - Search vectors failed if time ranges long enough
- MS-647 - grafana display average cpu-temp
- MS-652 - IVFSQH quantization double free
- MS-605 - Server going down during searching vectors
- MS-653 - When config check fail, Milvus close without message
- MS-654 - Describe index timeout when building index
- MS-658 - Fix SQ8 Hybrid can't search

@@ -41,8 +42,8 @@ Please mark all change in change log and use the ticket from JIRA.
- MS-608 - Update TODO names
- MS-609 - Update task construct function
- MS-611 - Add resources validity check in ResourceMgr
- MS-619 - Add optimizer class in scheduler
- MS-614 - Preload table at startup
- MS-619 - Add optimizer class in scheduler
- MS-626 - Refactor DataObj to support cache any type data
- MS-648 - Improve unittest
- MS-655 - Upgrade SPTAG
@@ -63,8 +64,8 @@ Please mark all change in change log and use the ticket from JIRA.
- MS-600 - Reconstruct unittest code
- MS-602 - Remove zilliz namespace
- MS-610 - Change error code base value from hex to decimal
- MS-635 - Add compile option to support customized faiss
- MS-624 - Re-organize project directory for open-source
- MS-635 - Add compile option to support customized faiss

# Milvus 0.4.0 (2019-09-12)

core/src/config/ConfigMgr.cpp

deleted100644 → 0
+0 −31
Original line number Diff line number Diff line
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

#include "config/ConfigMgr.h"
#include "YamlConfigMgr.h"

namespace milvus {
namespace server {

ConfigMgr*
ConfigMgr::GetInstance() {
    static YamlConfigMgr mgr;
    return &mgr;
}

}  // namespace server
}  // namespace milvus
+7 −21
Original line number Diff line number Diff line
@@ -17,42 +17,28 @@

#pragma once

#include "ConfigNode.h"
#include "utils/Error.h"

#include <string>

#include "ConfigNode.h"
#include "utils/Status.h"

namespace milvus {
namespace server {

// this class can parse nested config file and return config item
// config file example(yaml style)
//       AAA: 1
//       BBB:
//         CCC: hello
//         DDD: 23.5
//
// usage
//   const ConfigMgr* mgr = ConfigMgr::GetInstance();
//   const ConfigNode& node = mgr->GetRootNode();
//   std::string val = node.GetValue("AAA"); // return '1'
//   const ConfigNode& child = node.GetChild("BBB");
//   val = child.GetValue("CCC"); //return 'hello'

class ConfigMgr {
 public:
    static ConfigMgr*
    GetInstance();

    virtual ErrorCode
    virtual Status
    LoadConfigFile(const std::string& filename) = 0;

    virtual void
    Print() const = 0;  // will be deleted

    virtual std::string
    DumpString() const = 0;

    virtual const ConfigNode&
    GetRootNode() const = 0;

    virtual ConfigNode&
    GetRootNode() = 0;
};
+4 −13
Original line number Diff line number Diff line
@@ -18,29 +18,20 @@
#include "config/YamlConfigMgr.h"
#include "utils/Log.h"

#include <sys/stat.h>

namespace milvus {
namespace server {

ErrorCode
Status
YamlConfigMgr::LoadConfigFile(const std::string& filename) {
    struct stat directoryStat;
    int statOK = stat(filename.c_str(), &directoryStat);
    if (statOK != 0) {
        SERVER_LOG_ERROR << "File not found: " << filename;
        return SERVER_UNEXPECTED_ERROR;
    }

    try {
        node_ = YAML::LoadFile(filename);
        LoadConfigNode(node_, config_);
    } catch (YAML::Exception& e) {
        SERVER_LOG_ERROR << "Failed to load config file: " << std::string(e.what());
        return SERVER_UNEXPECTED_ERROR;
        std::string str = "Exception: load config file fail: " + std::string(e.what());
        return Status(SERVER_UNEXPECTED_ERROR, str);
    }

    return SERVER_SUCCESS;
    return Status::OK();
}

void
+13 −5
Original line number Diff line number Diff line
@@ -17,27 +17,35 @@

#pragma once

#include "ConfigMgr.h"
#include "ConfigNode.h"
#include "utils/Error.h"

#include <yaml-cpp/yaml.h>
#include <string>

#include "ConfigMgr.h"
#include "utils/Status.h"

namespace milvus {
namespace server {

class YamlConfigMgr : public ConfigMgr {
 public:
    virtual ErrorCode
    static ConfigMgr*
    GetInstance() {
        static YamlConfigMgr mgr;
        return &mgr;
    }

    virtual Status
    LoadConfigFile(const std::string& filename);

    virtual void
    Print() const;

    virtual std::string
    DumpString() const;

    virtual const ConfigNode&
    GetRootNode() const;

    virtual ConfigNode&
    GetRootNode();

Loading