Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix graph/meta/storage version in show hosts #3054

Merged
merged 6 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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