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

Check if copysets on chunkservers consistent with mds when check copyset health. #184

Merged
merged 1 commit into from
Dec 3, 2020

Conversation

bai-charisu
Copy link
Contributor

@bai-charisu bai-charisu commented Dec 2, 2020

…sets health

Change-Id: I8fdb353323595b583dd2a31f5b6b397b8539bade

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

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

return -1;
}
if (copysetsInMds.empty()) return copysets_[kTotal].empty();
if (copysets_[kTotal].empty()) return copysetsInMds.empty();
Copy link
Contributor

Choose a reason for hiding this comment

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

到这里说明两个的copyset数量相等,一个if就可以了?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

改成求差集后去掉了

copyset.copysetid());
copysetsInMdsGid.insert(gId);
}
if (*(copysetsInMdsGid.begin()) != *(copysets_[kTotal].begin())
Copy link
Contributor

Choose a reason for hiding this comment

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

std::set_difference(v1.begin(), v1.end(), v2.begin(), v2.end(),
std::inserter(diff, diff.begin()));
这个可以比较两者的差异化

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

copysetsInMdsGid.insert(gId);
}
if (*(copysetsInMdsGid.begin()) != *(copysets_[kTotal].begin())
|| *(--copysetsInMdsGid.end()) != *(--copysets_[kTotal].end())) {
Copy link
Member

Choose a reason for hiding this comment

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

这是只比较了头尾两个成员? 中间的不比较?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

改成求差集了

…sets health

Change-Id: I8fdb353323595b583dd2a31f5b6b397b8539bade
@ilixiaocui ilixiaocui merged commit d2945f7 into opencurve:master Dec 3, 2020
ilixiaocui pushed a commit to ilixiaocui/curve that referenced this pull request Feb 6, 2023
* CB Q1 blog link updated
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.

3 participants