Unverified Commit 636f5c9c authored by 蔡宇东's avatar 蔡宇东 Committed by GitHub
Browse files

#1234 do service check when Milvus startup (#1404)



* #1234 do service check when Milvus startup

Signed-off-by: default avataryudong.cai <yudong.cai@zilliz.com>

* #1234 update error log

Signed-off-by: default avataryudong.cai <yudong.cai@zilliz.com>
parent 09b0a69c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ Please mark all change in change log and use the issue from GitHub
- \#1078 - Move 'insert_buffer_size' to Cache Config section
- \#1105 - Error message is not clear when creating IVFSQ8H index without gpu resources
- \#740, #849, #878, #972, #1033, #1161, #1173, #1199, #1190, #1223, #1222, #1257, #1264, #1269, #1164, #1303, #1304, #1324, #1388 - Various fixes and improvements for Milvus documentation.
- \#1234 - Do S3 server validation check when Milvus startup
- \#1263 - Allow system conf modifiable and some take effect directly
- \#1320 - Remove debug logging from faiss

+27 −6
Original line number Diff line number Diff line
@@ -196,8 +196,7 @@ Server::Start() {
        server::Metrics::GetInstance().Init();
        server::SystemInfo::GetInstance().Init();

        StartService();
        return Status::OK();
        return StartService();
    } catch (std::exception& ex) {
        std::string str = "Milvus server encounter exception: " + std::string(ex.what());
        return Status(SERVER_UNEXPECTED_ERROR, str);
@@ -253,14 +252,36 @@ Server::LoadConfig() {
    return milvus::Status::OK();
}

void
Status
Server::StartService() {
    engine::KnowhereResource::Initialize();
    Status stat;
    stat = engine::KnowhereResource::Initialize();
    if (!stat.ok()) {
        SERVER_LOG_ERROR << "KnowhereResource initialize fail: " << stat.message();
        goto FAIL;
    }

    scheduler::StartSchedulerService();
    DBWrapper::GetInstance().StartService();

    stat = DBWrapper::GetInstance().StartService();
    if (!stat.ok()) {
        SERVER_LOG_ERROR << "DBWrapper start service fail: " << stat.message();
        goto FAIL;
    }

    grpc::GrpcServer::GetInstance().Start();
    web::WebServer::GetInstance().Start();
    storage::S3ClientWrapper::GetInstance().StartService();

    stat = storage::S3ClientWrapper::GetInstance().StartService();
    if (!stat.ok()) {
        SERVER_LOG_ERROR << "S3Client start service fail: " << stat.message();
        goto FAIL;
    }

    return Status::OK();
FAIL:
    std::cerr << "Milvus initializes fail: " << stat.message() << std::endl;
    return stat;
}

void
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ class Server {
    Status
    LoadConfig();

    void
    Status
    StartService();
    void
    StopService();
+4 −1
Original line number Diff line number Diff line
@@ -64,7 +64,10 @@ S3ClientWrapper::StartService() {
        client_ptr_ = std::make_shared<S3ClientMock>();
    }

    return CreateBucket();
    std::cout << "S3 service connection check ...... " << std::flush;
    Status stat = CreateBucket();
    std::cout << (stat.ok() ? "OK" : "FAIL") << std::endl;
    return stat;
}

void