We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent112c9ec commit45143b6Copy full SHA for 45143b6
src/raft.c
@@ -800,6 +800,12 @@ static void raft_handle_update(raft_t r, raft_msg_update_t *m) {
800
reply.progress.entries=RAFT_LOG_LAST_INDEX(r)+1;
801
reply.progress.bytes=e->bytes;
802
803
+if (m->previndex>RAFT_LOG_LAST_INDEX(r))
804
+{
805
+debug("got an update with previndex=%d > lastindex=%d\n",m->previndex,RAFT_LOG_LAST_INDEX(r));
806
+gotofinish;
807
+}
808
+
809
if (reply.progress.entries>0) {
810
reply.term=RAFT_LOG(r,reply.progress.entries-1).term;
811
}else {
@@ -875,6 +881,7 @@ static void raft_handle_update(raft_t r, raft_msg_update_t *m) {
875
881
876
882
reply.success= true;
877
883
finish:
884
+assert((reply.progress.entries==m->previndex+1)|| (reply.progress.bytes==0));
878
885
raft_send(r,sender,&reply,sizeof(reply));
879
886
}
880
887