10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc5f0f3 commit cdc1720Copy full SHA for cdc1720
contrib/raftable/raft/src/raft.c
@@ -814,8 +814,8 @@ static void raft_handle_update(raft_t r, raft_msg_update_t *m) {
814
815
if (!m->empty && !m->snapshot && !raft_appendable(r, m->previndex, m->prevterm)) goto finish;
816
817
- if (reply.progress.entries > 0) {
818
- reply.term = RAFT_LOG(r, reply.progress.entries - 1).term;
+ if (RAFT_LOG_LAST_INDEX(r) >= 0) {
+ reply.term = RAFT_LOG(r, RAFT_LOG_LAST_INDEX(r)).term;
819
} else {
820
reply.term = -1;
821
}
0 commit comments