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

curvefs/tool: fix copyset health check error #1024

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

Cyber-SiKu
Copy link
Contributor

@Cyber-SiKu Cyber-SiKu commented Jan 19, 2022

What problem does this PR solve?

Issue Number: close #1022 #1026

Problem Summary:
when get all coysetinfo (in curvefs_copyset_status) has error,
tools would not to check copyset status,
so get health instaed of unhealthy

What is changed and how it works?

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@Cyber-SiKu
Copy link
Contributor Author

recheck

for (auto const& i : key2Info) {
if (copyset::checkCopysetHelthy(i.second, key2Status[i.first]) !=
copyset::CheckResult::kHealthy) {
isHealth = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unhealthy copysets can be recorded and show the detail if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unhealthy copysets can be recorded and show the detail if needed.

now is show all copyset, will add this feature.

std::vector<curvefs::metaserver::copyset::CopysetStatusResponse>>
key2Status;
copyset::CopysetInfo2CopysetStatus(*response.get(), &key2Status);
copyInfoListTool_->RunCommand();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why drop the return value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why drop the return value?

fix

std::map<uint64_t,
std::vector<curvefs::metaserver::copyset::CopysetStatusResponse>>
key2Status;
copyset::CopysetInfo2CopysetStatus(*response.get(), &key2Status);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto, you didn't handle return value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix


copyset::Response2CopysetInfo(*response.get(), &key2Info);
copyset::Response2CopysetInfo(*response.get(), &key2Info);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

fix

when get all coysetinfo (in curvefs_copyset_status) has error,
tools would not to check copyset status,
so get health instaed of unhealthy
@Cyber-SiKu Cyber-SiKu force-pushed the curvefs-tool/fix-bug-master branch from ddc8e9b to 1c45b4c Compare January 25, 2022 09:47
@Cyber-SiKu
Copy link
Contributor Author

recheck

1 similar comment
@Cyber-SiKu
Copy link
Contributor Author

recheck

@Cyber-SiKu Cyber-SiKu merged commit 3fd753f into opencurve:master Feb 18, 2022
@Cyber-SiKu Cyber-SiKu deleted the curvefs-tool/fix-bug-master branch February 24, 2022 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

curvefs/tool: copyset health check fail
3 participants