-
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 #544
merge host info #544
Conversation
Can one of the admins verify this patch? |
@@ -94,8 +99,11 @@ void ActiveHostsMan::loadHostMap() { | |||
HostInfo info; | |||
info.lastHBTimeInSec_ = time::TimeUtils::nowInSeconds(); | |||
if (iter->val() == MetaServiceUtils::hostValOnline()) { | |||
LOG(INFO) << "load host " << host.ip << ":" << host.port; | |||
updateHostInfo({host.ip, host.port}, info); | |||
bool found = hostsMap_.find({host.ip, host.port}) != hostsMap_.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.
Maybe you need to add a lock here?
src/meta/ActiveHostsMan.cpp
Outdated
@@ -94,8 +99,11 @@ void ActiveHostsMan::loadHostMap() { | |||
HostInfo info; | |||
info.lastHBTimeInSec_ = time::TimeUtils::nowInSeconds(); | |||
if (iter->val() == 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.
I think we need to set status of hosts "which is online in kvstore but not in memory" to offline? Because the info in memory is more updated. After leader really receive heartbeat, it will set info to online.
@@ -0,0 +1,54 @@ | |||
|
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.
Maybe just put the ut in ActiveHostsManTest?
* re-change options for rebuild index batch number * add sleep options * 3 us Co-authored-by: yaphet <[email protected]>
fix issue 532:
#532
merge host infos from kvstore.