mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 03:18:29 +08:00
fix server start failed if wal directory exist (#2144)
* fix server start failed if wal directory exist Signed-off-by: wxyu <xy.wang@zilliz.com> * add wal_enable check Signed-off-by: wxyu <xy.wang@zilliz.com> * fix compile error Signed-off-by: wxyu <xy.wang@zilliz.com>
This commit is contained in:
parent
bf42dbd5b6
commit
b65f5072f3
@ -10,6 +10,7 @@ Please mark all change in change log and use the issue from GitHub
|
||||
- \#1997 Index file missed after compact
|
||||
- \#2073 Fix CheckDBConfigBackendUrl error message
|
||||
- \#2076 CheckMetricConfigAddress error message
|
||||
- \#2141 Fix server start failed if wal directory exist
|
||||
|
||||
## Feature
|
||||
- \#1751 Add api SearchByID
|
||||
|
@ -205,25 +205,43 @@ Server::Start() {
|
||||
return s;
|
||||
}
|
||||
|
||||
try {
|
||||
// True if a new directory was created, otherwise false.
|
||||
boost::filesystem::create_directories(db_path);
|
||||
} catch (...) {
|
||||
return Status(SERVER_UNEXPECTED_ERROR, "Cannot create db directory");
|
||||
}
|
||||
|
||||
s = InstanceLockCheck::Check(db_path);
|
||||
if (!s.ok()) {
|
||||
std::cerr << "deploy_mode: " << deploy_mode << " instance lock db path failed." << std::endl;
|
||||
return s;
|
||||
}
|
||||
|
||||
std::string wal_path;
|
||||
s = config.GetWalConfigWalPath(wal_path);
|
||||
bool wal_enable = false;
|
||||
s = config.GetWalConfigEnable(wal_enable);
|
||||
if (!s.ok()) {
|
||||
return s;
|
||||
}
|
||||
|
||||
if (not boost::filesystem::create_directories(wal_path)) {
|
||||
return Status(SERVER_UNEXPECTED_ERROR, "Cannot create wal dir");
|
||||
}
|
||||
s = InstanceLockCheck::Check(wal_path);
|
||||
if (!s.ok()) {
|
||||
std::cerr << "deploy_mode: " << deploy_mode << " instance lock wal path failed." << std::endl;
|
||||
return s;
|
||||
if (wal_enable) {
|
||||
std::string wal_path;
|
||||
s = config.GetWalConfigWalPath(wal_path);
|
||||
if (!s.ok()) {
|
||||
return s;
|
||||
}
|
||||
|
||||
try {
|
||||
// True if a new directory was created, otherwise false.
|
||||
boost::filesystem::create_directories(wal_path);
|
||||
} catch (...) {
|
||||
return Status(SERVER_UNEXPECTED_ERROR, "Cannot create wal directory");
|
||||
}
|
||||
s = InstanceLockCheck::Check(wal_path);
|
||||
if (!s.ok()) {
|
||||
std::cerr << "deploy_mode: " << deploy_mode << " instance lock wal path failed." << std::endl;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user