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

merge host info #544

Closed
wants to merge 2 commits into from
Closed

merge host info #544

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 25, 2019

fix issue 532:
#532

merge host infos from kvstore.

@nebula-community-bot
Copy link
Member

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();
Copy link
Contributor

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?

@@ -94,8 +99,11 @@ void ActiveHostsMan::loadHostMap() {
HostInfo info;
info.lastHBTimeInSec_ = time::TimeUtils::nowInSeconds();
if (iter->val() == MetaServiceUtils::hostValOnline()) {
Copy link
Contributor

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 @@

Copy link
Contributor

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?

@ghost ghost requested review from critical27 and dangleptr June 26, 2019 07:41
@ghost ghost closed this Jun 26, 2019
@ghost ghost deleted the merge_host_info branch June 26, 2019 08:06
yixinglu pushed a commit that referenced this pull request Aug 9, 2021
* re-change options for rebuild index batch number

* add sleep options

* 3 us

Co-authored-by: yaphet <[email protected]>
This pull request was closed.
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.

2 participants