From ceeefe47f8c3b1eb35728230b379fead871925f6 Mon Sep 17 00:00:00 2001 From: nebula-bots <88429921+nebula-bots@users.noreply.github.com> Date: Tue, 14 Sep 2021 16:01:56 +0800 Subject: [PATCH] fix running jobs in dropped space (#79) Co-authored-by: Doodle <13706157+critical27@users.noreply.github.com> --- src/meta/processors/job/JobManager.cpp | 31 +++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/meta/processors/job/JobManager.cpp b/src/meta/processors/job/JobManager.cpp index df90edb3a7c..9c712de581e 100644 --- a/src/meta/processors/job/JobManager.cpp +++ b/src/meta/processors/job/JobManager.cpp @@ -239,28 +239,27 @@ nebula::cpp2::ErrorCode JobManager::saveTaskStatus(TaskDescription& td, if (!jobExec) { LOG(WARNING) << folly::sformat("createMetaJobExecutor failed(), jobId={}", jobId); return nebula::cpp2::ErrorCode::E_TASK_REPORT_OUT_DATE; - } else { - if (!optJobDesc.getParas().empty()) { - auto spaceName = optJobDesc.getParas().back(); - auto spaceIdRet = getSpaceId(spaceName); - if (!nebula::ok(spaceIdRet)) { - auto retCode = nebula::error(spaceIdRet); - LOG(INFO) << "Get spaceName " << spaceName - << " failed, error: " << apache::thrift::util::enumNameSafe(retCode); - return retCode; - } - - auto spaceId = nebula::value(spaceIdRet); - if (spaceId != -1) { - jobExec->setSpaceId(spaceId); - } - } } auto rcSave = save(td.taskKey(), td.taskVal()); if (rcSave != nebula::cpp2::ErrorCode::SUCCEEDED) { return rcSave; } + + if (!optJobDesc.getParas().empty()) { + auto spaceName = optJobDesc.getParas().back(); + auto spaceIdRet = getSpaceId(spaceName); + if (!nebula::ok(spaceIdRet)) { + auto retCode = nebula::error(spaceIdRet); + LOG(WARNING) << "Get spaceName " << spaceName + << " failed, error: " << apache::thrift::util::enumNameSafe(retCode); + return retCode; + } else { + auto spaceId = nebula::value(spaceIdRet); + jobExec->setSpaceId(spaceId); + } + } + return jobExec->saveSpecialTaskStatus(req); }