-
Notifications
You must be signed in to change notification settings - Fork 526
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
Check if copysets on chunkservers consistent with mds when check copyset health. #184
Conversation
src/tools/copyset_check_core.cpp
Outdated
return -1; | ||
} | ||
if (copysetsInMds.empty()) return copysets_[kTotal].empty(); | ||
if (copysets_[kTotal].empty()) return copysetsInMds.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
到这里说明两个的copyset数量相等,一个if就可以了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成求差集后去掉了
src/tools/copyset_check_core.cpp
Outdated
copyset.copysetid()); | ||
copysetsInMdsGid.insert(gId); | ||
} | ||
if (*(copysetsInMdsGid.begin()) != *(copysets_[kTotal].begin()) |
There was a problem hiding this comment.
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()));
这个可以比较两者的差异化
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/tools/copyset_check_core.cpp
Outdated
copysetsInMdsGid.insert(gId); | ||
} | ||
if (*(copysetsInMdsGid.begin()) != *(copysets_[kTotal].begin()) | ||
|| *(--copysetsInMdsGid.end()) != *(--copysets_[kTotal].end())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是只比较了头尾两个成员? 中间的不比较?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成求差集了
9803492
to
c1997e2
Compare
…sets health Change-Id: I8fdb353323595b583dd2a31f5b6b397b8539bade
c1997e2
to
02901d2
Compare
* CB Q1 blog link updated
…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