From 2d0d6a0dca90697373f4a23bcee8e0c7c4b0c3e4 Mon Sep 17 00:00:00 2001 From: yixinglu <2520865+yixinglu@users.noreply.github.com> Date: Wed, 13 Oct 2021 16:24:51 +0800 Subject: [PATCH 1/4] Fix graph version bug --- src/clients/meta/MetaClient.cpp | 4 +--- src/version/Version.cpp.in | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/clients/meta/MetaClient.cpp b/src/clients/meta/MetaClient.cpp index a3e46fc9c0d..d4766213d32 100644 --- a/src/clients/meta/MetaClient.cpp +++ b/src/clients/meta/MetaClient.cpp @@ -2335,9 +2335,7 @@ folly::Future> MetaClient::heartbeat() { req.set_host(options_.localHost_); req.set_role(options_.role_); req.set_git_info_sha(options_.gitInfoSHA_); -#if defined(NEBULA_BUILD_VERSION) - req.set_version(versionString(false)); -#endif + req.set_version(getOriginVersion()); if (options_.role_ == cpp2::HostRole::STORAGE) { if (options_.clusterId_.load() == 0) { options_.clusterId_ = FileBasedClusterIdMan::getClusterIdFromFile(FLAGS_cluster_id_path); diff --git a/src/version/Version.cpp.in b/src/version/Version.cpp.in index f8675b605e0..c23cd34fc8e 100644 --- a/src/version/Version.cpp.in +++ b/src/version/Version.cpp.in @@ -15,10 +15,10 @@ namespace nebula { std::string gitInfoSha() { return "@GIT_INFO_SHA@"; } std::string versionString(bool verbose) { - std::string version; -#if defined(NEBULA_BUILD_VERSION) - version = folly::stringPrintf("%s, ", "@NEBULA_BUILD_VERSION@"); -#endif + std::string version = getOriginVersion(); + if (!version.empty()) { + version += ", "; + } if (verbose) { version += folly::sformat("Git: {}, ", gitInfoSha()); } From 8c96554baddc95dc3793e1204e647d49b04751d5 Mon Sep 17 00:00:00 2001 From: yixinglu <2520865+yixinglu@users.noreply.github.com> Date: Wed, 13 Oct 2021 17:46:47 +0800 Subject: [PATCH 2/4] Fix storage version --- src/meta/processors/parts/ListHostsProcessor.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/meta/processors/parts/ListHostsProcessor.cpp b/src/meta/processors/parts/ListHostsProcessor.cpp index ff4c7547468..cea7e8b7d66 100644 --- a/src/meta/processors/parts/ListHostsProcessor.cpp +++ b/src/meta/processors/parts/ListHostsProcessor.cpp @@ -90,7 +90,7 @@ nebula::cpp2::ErrorCode ListHostsProcessor::allMetaHostsStatus() { item.set_role(cpp2::HostRole::META); item.set_git_info_sha(gitInfoSha()); item.set_status(cpp2::HostStatus::ONLINE); - item.set_version(versionString(false)); + item.set_version(getOriginVersion()); hostItems_.emplace_back(item); } return nebula::cpp2::ErrorCode::SUCCEEDED; @@ -111,13 +111,11 @@ nebula::cpp2::ErrorCode ListHostsProcessor::allHostsWithStatus(cpp2::HostRole ro return retCode; } - auto iter = nebula::value(ret).get(); auto now = time::WallClock::fastNowInMilliSec(); std::vector removeHostsKey; - while (iter->valid()) { + for (auto iter = nebula::value(ret).get(); iter->valid(); iter->next()) { HostInfo info = HostInfo::decode(iter->val()); if (info.role_ != role) { - iter->next(); continue; } @@ -143,7 +141,6 @@ nebula::cpp2::ErrorCode ListHostsProcessor::allHostsWithStatus(cpp2::HostRole ro } else { removeHostsKey.emplace_back(iter->key()); } - iter->next(); } removeExpiredHosts(std::move(removeHostsKey)); From 2bd0c7e2347e57b28e020132062528a5ec1186e9 Mon Sep 17 00:00:00 2001 From: yixinglu <2520865+yixinglu@users.noreply.github.com> Date: Wed, 13 Oct 2021 18:02:01 +0800 Subject: [PATCH 3/4] Print cpack config --- cmake/CPackage.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/CPackage.cmake b/cmake/CPackage.cmake index b26eda90e5a..36a9acbc149 100644 --- a/cmake/CPackage.cmake +++ b/cmake/CPackage.cmake @@ -129,10 +129,11 @@ macro(package to_one name home_page scripts_dir) set(HOST_SYSTEM_VER "Unknown") endif() - message(STATUS "HOST_SYSTEM_NAME is ${HOST_SYSTEM_NAME}") - message(STATUS "HOST_SYSTEM_VER is ${HOST_SYSTEM_VER}") - message(STATUS "CPACK_GENERATOR is ${CPACK_GENERATOR}") - message(STATUS "CMAKE_HOST_SYSTEM_PROCESSOR is ${CMAKE_HOST_SYSTEM_PROCESSOR}") + print_config(NEBULA_BUILD_VERSION) + print_config(HOST_SYSTEM_NAME) + print_config(HOST_SYSTEM_VER) + print_config(CPACK_GENERATOR) + print_config(CMAKE_HOST_SYSTEM_PROCESSOR) set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${HOST_SYSTEM_VER}.${CMAKE_HOST_SYSTEM_PROCESSOR}) if (${to_one}) From 67f8c212f98c6f6f1c1a88a4c6dcb960b1fd5185 Mon Sep 17 00:00:00 2001 From: yixinglu <2520865+yixinglu@users.noreply.github.com> Date: Wed, 13 Oct 2021 18:51:19 +0800 Subject: [PATCH 4/4] Decrease ubuntu compile parallelism --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 93edc0147b0..6f76ccba573 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -97,7 +97,7 @@ jobs: -DENABLE_COVERAGE=on \ -B build echo "::set-output name=j::10" - echo "::set-output name=t::10" + echo "::set-output name=t::7" ;; esac ;;