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

raft_send_appendentries_all logic #79

Open
q96456 opened this issue Jun 22, 2018 · 1 comment
Open

raft_send_appendentries_all logic #79

q96456 opened this issue Jun 22, 2018 · 1 comment

Comments

@q96456
Copy link

q96456 commented Jun 22, 2018

version 0.7.0
The code below,when "raft_send_appendentries" return not 0,the cycle will return. So if raft_node A is offline, B need send appendentries to A and C ,send A callback return -1,here return, C will not receive heatbeat?C will request vote?

int raft_send_appendentries_all(raft_server_t* me_)
{
raft_server_private_t* me = (raft_server_private_t*)me_;
int i, e;

__log(me_, NULL, "%s:%d num node=%d",__FILE__, __LINE__, me->num_nodes);
me->timeout_elapsed = 0;
for (i = 0; i < me->num_nodes; i++)
{
    if (me->node == me->nodes[i] || !raft_node_is_active(me->nodes[i]))
        continue;

    e = raft_send_appendentries(me_, me->nodes[i]);
    if (0 != e)
        return e;
}

return 0;

}

@freeekanayaka
Copy link
Contributor

This seems a valid point. Does upstream have an opinion?

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

No branches or pull requests

2 participants