!32094 [bugfix] PS Server recovery failed

Merge pull request !32094 from zyli2020/worker_failover_bp
This commit is contained in:
i-robot 2022-03-28 11:23:53 +00:00 committed by Gitee
commit de1f3f153f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 13 deletions

View File

@ -1145,19 +1145,8 @@ void ParameterServer::RecoverHandler::Init() {
MS_EXCEPTION_IF_NULL(ps_->server_node_); MS_EXCEPTION_IF_NULL(ps_->server_node_);
std::string persistent_storage_file_path = std::string persistent_storage_file_path =
std::string(kCurrentDirOfServer) + std::to_string(ps_->server_node_->rank_id()) + "_persistent_storage.json"; std::string(kCurrentDirOfServer) + std::to_string(ps_->server_node_->rank_id()) + "_persistent_storage.json";
if (!distributed::storage::FileIOUtils::IsFileOrDirExist(persistent_storage_file_path)) { storage_ = std::make_unique<core::FileConfiguration>(persistent_storage_file_path);
distributed::storage::FileIOUtils::CreateFile(persistent_storage_file_path); (void)storage_->Initialize();
}
auto ret = FileUtils::GetRealPath(persistent_storage_file_path.c_str());
if (!ret.has_value()) {
MS_LOG(EXCEPTION) << "Cannot get real path for persistent storage file";
}
storage_ = std::make_unique<core::FileConfiguration>(ret.value());
if (!storage_->Initialize()) {
MS_LOG(EXCEPTION) << "Initialize file storage module failed, file path: " << ret.value();
}
} }
void ParameterServer::RecoverHandler::Recover() { void ParameterServer::RecoverHandler::Recover() {