Commit 274ff74d authored by Yossi Gottlieb's avatar Yossi Gottlieb
Browse files

Fix off-by-one in apply_log idx.

parent 296c7e0b
...@@ -805,7 +805,7 @@ int raft_apply_entry(raft_server_t* me_) ...@@ -805,7 +805,7 @@ int raft_apply_entry(raft_server_t* me_)
me->last_applied_idx++; me->last_applied_idx++;
if (me->cb.applylog) if (me->cb.applylog)
{ {
int e = me->cb.applylog(me_, me->udata, ety, me->last_applied_idx - 1); int e = me->cb.applylog(me_, me->udata, ety, me->last_applied_idx);
if (RAFT_ERR_SHUTDOWN == e) if (RAFT_ERR_SHUTDOWN == e)
return RAFT_ERR_SHUTDOWN; return RAFT_ERR_SHUTDOWN;
} }
......
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