Skip to content

Commit

Permalink
Fix graph/meta/storage version in show hosts (#3054)
Browse files Browse the repository at this point in the history
* Fix graph version bug

* Fix storage version

* Print cpack config

* Decrease ubuntu compile parallelism
  • Loading branch information
yixinglu authored Oct 14, 2021
1 parent 1f78224 commit a460c0e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down
9 changes: 5 additions & 4 deletions cmake/CPackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
4 changes: 1 addition & 3 deletions src/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2335,9 +2335,7 @@ folly::Future<StatusOr<bool>> 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);
Expand Down
7 changes: 2 additions & 5 deletions src/meta/processors/parts/ListHostsProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<std::string> 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;
}

Expand All @@ -143,7 +141,6 @@ nebula::cpp2::ErrorCode ListHostsProcessor::allHostsWithStatus(cpp2::HostRole ro
} else {
removeHostsKey.emplace_back(iter->key());
}
iter->next();
}

removeExpiredHosts(std::move(removeHostsKey));
Expand Down
8 changes: 4 additions & 4 deletions src/version/Version.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit a460c0e

Please sign in to comment.