Commit 5bad59c1 authored by Li Wei's avatar Li Wei Committed by Willem Thiart
Browse files

DAOS-333 server: Remove unnecessary index check for AE requests



raft_recv_appendentries() doesn't need to check prev_log_idx against
currentIndex, as this is already done implicitly by getting the entry at
prev_log_idx.
Signed-off-by: default avatarLi Wei <wei.g.li@intel.com>
parent 8b444aa1
......@@ -359,17 +359,14 @@ int raft_recv_appendentries(
{
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 fail_with_current_idx;
}
/* 2. Reply false if log doesn't contain an entry at prevLogIndex
whose term matches prevLogTerm (§5.3) */
if (raft_get_current_idx(me_) < ae->prev_log_idx)
goto fail_with_current_idx;
if (ety->term != ae->prev_log_term)
{
__log(me_, node, "AE term doesn't match prev_term (ie. %d vs %d) ci:%d pli:%d",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment