1. 22 Aug, 2022 1 commit
    • Ozan Tezcan's avatar
      Improve snapshot support (#121) · 7d66a156
      Ozan Tezcan authored
      - raft_load_snapshot_f(): Changed order of arguments term and index
      to be inline with raft_begin_load_snapshot().
      
      - Refactored raft_begin_load_snapshot(). Now, inside this function, 
      current server's node flags are cleared. Previously, application had to
      take care of it. e.g Application had to clear inactive flag on a snapshot.
      
      - Added raft_restore_snapshot() to let libraft know that application has
      loaded a snapshot.
      7d66a156
  2. 19 Jun, 2022 1 commit
  3. 19 May, 2022 1 commit
  4. 26 Apr, 2022 1 commit
  5. 03 Apr, 2022 1 commit
  6. 30 Mar, 2022 1 commit
  7. 24 Mar, 2022 1 commit
  8. 07 Feb, 2022 1 commit
  9. 15 Nov, 2021 1 commit
  10. 11 Nov, 2021 1 commit
  11. 23 Sep, 2021 1 commit
  12. 22 Sep, 2021 1 commit
    • Shaya Potter's avatar
      fix read queue test to be more accurate (#59) · 36efee07
      Shaya Potter authored
      * fix read queue test to be more accurate
      
      1) each server's set of nodes, keeps the max msg_id its seen from that node when that node has been later
      1a) because of this get_max_seen now operates on a server's nodes, not on the server itself b
      
      2) virtraft encodes the leader id into the "arg" (with a user redefinable multiplier) it sends as part of the callback, so when we get the callback, we can know what leader its for and check its voters for correctness.
      36efee07
  13. 14 Sep, 2021 1 commit
  14. 12 Sep, 2021 1 commit
    • Shaya Potter's avatar
      add a read_queue test to virtraft (#41) · bdd0797f
      Shaya Potter authored
      * add a read_queue test to virtraft
      
      every iteration we push a read_queue request and the handler and an we pass to it set a variable on calling.  we can use this to make sure that the read_queue doesn't get too far from the iteration.  i.e. we pass the leader's msg_id and can check to ensure that leader's msg_id doesn't get too far from the msg_id (variable) we see in read_queue test
      
      this is analog to the current log applying deadlock test.
      
      * implements msg_id checking in virtraft for verification of read_queue requests
      
      When we pop an entry off the read_queue with the can_read flag, we verify across all nodes that the majority of nodes have accepted from the leader a msg_id past what this read_queue entry needs.
      
      the problem with this is, that until now, msg_id was private to each server instance and has no relevance to the followre nodes except to include it back in response. 
      
      we change that to have the followers store the max msg_id they've seen from their current leader
      
      using that, in the read_queue_handler we can verify that the leader's voting nodes have a quorum past the msg_id variable that the handler will return to ensure that this read_queue handler call is correct.
      bdd0797f
  15. 09 Sep, 2021 1 commit
  16. 22 Aug, 2021 1 commit
    • Shaya Potter's avatar
      add duplex partition to virtraft (#42) · 95764a87
      Shaya Potter authored
      before, purposefully, virtraft had simplex partitions (i.e. traffic was only blocked from flowing one way).
      
      however, for read_queue tests and for correctness of them, we have to ensure that its duplex (i.e. neither side can talk to each other).
      
      otherwise, we can end up in a situation, where leader heartbeated every node, the majority of the nodes got the ping, but the majority couldn't reply back.  If there's a bug in libraft's calculation, by simply looking at the other nodes, we would think everything is fine, as they got the heartbeat
      95764a87
  17. 18 Aug, 2021 1 commit
  18. 30 Jul, 2021 1 commit
    • Shaya Potter's avatar
      remove REMOVE_NODE log type and include its semantics in DEMOTE (#25) · d4d15e04
      Shaya Potter authored
      this commit changes libraft's from using the DEMOTE_NODE log entry which would then initiate a REMOVE_NODE log entry on the DEMOTE's commit, to only using a REMOVE.  
      
      * add the removal of the active node flag on append of REMOVE and (add back if reverted)
      * modify is_voting to check for active state as well
      
      this enables simplifying appending and reverting nodes, as we shouldn't be touching voting state, (as a removing node might not be voting yet), only its active state.  and as the is_voting check also now checks for active state, simplifies a lot of code that manually tested both.
      
      * add a test for reversion of a non voting node removal
      
      previously, the code could not handle demoting/removing a non voting node, as demote would want to unset the voting flag (which a non voting node obviously doesn't have), and would therefore fail an assertion.
      
      with the new code, we no longer unset the voting flag in removal, and this test make sure both the is_voting and is_active return as expected through a process of add/removal/revert
      d4d15e04
  19. 28 Jul, 2021 1 commit
    • Shaya Potter's avatar
      Multiple Virtraft changes (#8) · 0d2189c8
      Shaya Potter authored
      
      
      * fix virtraft bug in _check_log_matching
      
      didn't validate against snapshoted node correctly.  the previous code just didn't do what it was expected to do
      
      * improve virtraft logging
      
      * fix entry_pop in virtraft
      
      previously, entry_pop never ran during our virtraft tests, probably because without removing leader, we never have a situation where this is neccessary
      
      i.e. the only case virtraft can pop entries, is when we have a leader lose leadership and we have an entry pending and not committed.  so when another node becomes leader, old leader's entries get popped.
      
      however, that has nothing to do with the "id" of the node that its effecting so trying to contorl it through that, makes no sense.
      
      * extra comment for fix reminder
      
      * ensure that we start with a term of 1 in virtraft, not 0.
      
      snapshot code fails if we have a snapshot term of 0 (explicitly returns an error if the term stored in snapshot is 0).
      Co-authored-by: default avatarYossi Gottlieb <yossigo@gmail.com>
      0d2189c8
  20. 12 Mar, 2020 2 commits
    • Yossi Gottlieb's avatar
      Add RAFT_LOGTYPE_NO_OP. · 5d7915f3
      Yossi Gottlieb authored
      The no-op entry gets committed as soon as a new leader is elected, in
      order to establish the commit index and prevent stale reads.
      5d7915f3
    • Yossi Gottlieb's avatar
      Fix virtraft membership tests. · c3064082
      Yossi Gottlieb authored
      This fixes an issue with virtraft2 which was not able to perform
      REMOVE_NODE when DEMOTE_NODE was applied. The previous fix of directly
      removing nodes was not aligned with how virtraft2 manages nodes.
      c3064082
  21. 10 Mar, 2020 1 commit
    • Yossi Gottlieb's avatar
      Fix: multiple REMOVE_NODE permitted. · da936a95
      Yossi Gottlieb authored
      The limit for enforcing a single uncommitted voting change must apply to
      remove node as well. It seems like it was left out considering only the
      case where it follows DEMOTE_NODE, but that's not really required.
      da936a95
  22. 19 Dec, 2018 1 commit
    • Yossi Gottlieb's avatar
      Read request handling support. · 84362fa7
      Yossi Gottlieb authored
      This makes it possible to request a consistent read without having to
      commit it as a log operation.
      
      For every read request an AE heartbeat is delivered and a quorum
      response is expected.
      84362fa7
  23. 09 Dec, 2018 1 commit
  24. 06 Dec, 2018 1 commit
  25. 15 Aug, 2018 1 commit
  26. 14 Aug, 2018 2 commits
  27. 20 Jun, 2018 1 commit
  28. 11 Jun, 2018 1 commit