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

Possible issues #102

Open
clicx opened this issue Jun 14, 2019 · 1 comment
Open

Possible issues #102

clicx opened this issue Jun 14, 2019 · 1 comment

Comments

@clicx
Copy link

clicx commented Jun 14, 2019

I have done the following testing:

  1. I applied one log item to three nodes, and persisted.
  2. delete persist data from one node (not leader) and start raft (other nodes keep alive).
  3. raft log will not be applied for this node, there is some log on this node:
    raft: AE no log at prev_idx 1
    send: {"myid": 1, "message_type": "append_entries_response", "term": 1, "success": 0, "current_idx": 0, "first_idx": 2}

Then it will be loopback forever.

@clicx
Copy link
Author

clicx commented Jun 18, 2019

Is here problem? Because current node has no entry, ety always null therefor cause endless loop

/* Not the first appendentries we've received /
/
NOTE: the log starts at 1 /
if (0 < ae->prev_log_idx)
{
raft_entry_t
ety = raft_get_entry_from_idx(me_, ae->prev_log_idx);

    /* 2. Reply false if log doesn't contain an entry at prevLogIndex
       whose term matches prevLogTerm (§5.3) */
    if (!ety)
    {
        __log(me_, node, "AE no log at prev_idx %d", ae->prev_log_idx);
        goto out;
    }

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

1 participant