-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
merge host info from kvstore #550
Conversation
src/meta/test/ActiveHostsManTest.cpp
Outdated
@@ -37,6 +37,56 @@ TEST(ActiveHostsManTest, NormalTest) { | |||
} | |||
} | |||
|
|||
TEST(ActiveHostsManTest, NormalTest2) { |
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.
Should give it more meaningful test name like MergeHostTest
? WDYT?
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.
+1
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.
fixed
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.
The PR looks good now. Please fix the inline comments
src/meta/ActiveHostsMan.cpp
Outdated
bool notFound = hostsMap_.find({host.ip, host.port}) == hostsMap_.end(); | ||
if (notFound) { | ||
data.emplace_back(MetaServiceUtils::hostKey(host.ip, host.port), | ||
MetaServiceUtils::hostValOffline()); |
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.
Alignment
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.
fixed
src/meta/test/ActiveHostsManTest.cpp
Outdated
std::vector<kvstore::KV> data; | ||
for (auto i = 0; i < 3; i++) { | ||
data.emplace_back(MetaServiceUtils::hostKey(0, i), | ||
MetaServiceUtils::hostValOnline()); |
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.
Alignment
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.
fixed
src/meta/test/ActiveHostsManTest.cpp
Outdated
@@ -37,6 +37,56 @@ TEST(ActiveHostsManTest, NormalTest) { | |||
} | |||
} | |||
|
|||
TEST(ActiveHostsManTest, NormalTest2) { |
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.
+1
src/meta/test/ActiveHostsManTest.cpp
Outdated
ASSERT_EQ(0, offlineNum); | ||
|
||
ActiveHostsMan ahMan(1, 1, kv.get()); | ||
sleep(3); |
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.
sleep(intervalSeconds + 1)
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.
fixed
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.
Well done!
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.
LGTM
Unit testing passed. |
1 similar comment
Unit testing passed. |
* merge host info from kvstore * add read lock * found to notFound * align fix
* merge host info from kvstore * add read lock * found to notFound * align fix
* get meta version in hb * cherry-pick vesoft-inc#549 vesoft-inc#550 vesoft-inc#551 * damn timeout * fix rebuild index bug introduced in vesoft-inc#2557 Co-authored-by: Doodle <[email protected]>
<!-- Thanks for your contribution! In order to review PR more efficiently, please add information according to the template. --> #### What type of PR is this? - [x] bug - [ ] feature - [ ] enhancement #### What problem(s) does this PR solve? Issue(s) number: Description: Add workflow to check standalone compile and ut. PYTEST and TCK comes later. #### How do you solve it? #### Special notes for your reviewer, ex. impact of this fix, design document, etc: #### Checklist: Tests: - [ ] Unit test(positive and negative cases) - [ ] Function test - [ ] Performance test - [ ] N/A Affects: - [ ] Documentation affected (Please add the label if documentation needs to be modified.) - [ ] Incompatibility (If it breaks the compatibility, please describe it and add the label.) - [ ] If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).) - [ ] Performance impacted: Consumes more CPU/Memory #### Release notes: Please confirm whether to be reflected in release notes and how to describe: > ex. Fixed the bug ..... Migrated from vesoft-inc#3637 Co-authored-by: Alex Xing <[email protected]>
fix bug:
#532