From 99d6e507d8dfa6c2ba0a40798d148bb487f9f7f0 Mon Sep 17 00:00:00 2001 From: Smaug123 Date: Sat, 12 Nov 2022 20:57:39 +0000 Subject: [PATCH] Resolve one TODO --- Raft/Server.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Raft/Server.fs b/Raft/Server.fs index e8400af..b780cdb 100644 --- a/Raft/Server.fs +++ b/Raft/Server.fs @@ -454,8 +454,8 @@ type Server<'a> | None -> // The leader knows what we've committed, so it won't try and give us anything further than // the element immediately past our persisted log. - // TODO - why can't this be -1? - assert (desiredLogInsertionPosition = 1 + persistentState.CurrentLogIndex) + if desiredLogInsertionPosition <> 1 + persistentState.CurrentLogIndex then + failwith "Logic error: the leader has tried to update an entry from our future." // The leader's message is after our log. Append. persistentState.AppendToLog toInsert toInsertTerm