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

Don't clear 'remotes' field from 'info' command during updating slot map #108

Merged
merged 1 commit into from
Feb 27, 2017

Conversation

doyoubi
Copy link
Contributor

@doyoubi doyoubi commented Feb 14, 2017

When the node list of corvus config file is wrong, once rebooted corvus can't retrieve the node list anymore. We need to find out this kind of corvus by checking whether the remotes field from info command is empty.
However, when corvus try updating its slot map, it will clear the its inner node list first, which will also result in empty remotes field before successfully retrieving the node list. So we can not tell whether there's something wrong with the node list of corvus even though there's empty remotes.
This PR changed this behavior. Now we only clear the node list after fail to update slot.

src/slot.c Outdated
@@ -47,13 +47,19 @@ static inline void node_list_init()
conf_node_dec_ref(node);
}

static inline void node_list_add(struct node_info *node)
static inline void node_list_add(struct address *dst, size_t *len, struct node_info *node)
Copy link
Contributor

Choose a reason for hiding this comment

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

node_list_* are targeted at the global node_list, I guess we should keep the consistency somehow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I will change its name.

@doyoubi doyoubi force-pushed the feature/AmendRemotes branch from 6164134 to 36b5302 Compare February 24, 2017 09:34
@doyoubi doyoubi force-pushed the feature/AmendRemotes branch from 36b5302 to 79fa2ce Compare February 24, 2017 11:06
@doyoubi doyoubi changed the title [WIP] Don't clear 'remotes' field from 'info' command during updating slot map Don't clear 'remotes' field from 'info' command during updating slot map Feb 27, 2017
@doyoubi doyoubi merged commit 2129df8 into eleme:master Feb 27, 2017
if (num > 0) {
memcpy(tmp_nodes + tmp_nodes_len, n->nodes, num * sizeof(struct address));
tmp_nodes_len += num;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be great to wrap these into a function, it's an append operation after all.

@doyoubi doyoubi mentioned this pull request May 9, 2017
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