1. 09 May, 2023 1 commit
  2. 19 Sep, 2022 1 commit
    • Ozan Tezcan's avatar
      Handle unnecessary snapshots better (#143) · 85ae16e0
      Ozan Tezcan authored
      If a node receives a snapshot with snapshot_last_idx, it checks if 
      it already has the snapshot and informs leader accordingly.
      
      The problem is the receiver node may not have a snapshot but log 
      entries more than snapshot_last_idx:
      
      e.g
      Leader: snapshot_last_idx : 50
      Follower: snapshot_last_idx:0, last log entry index: 100
      
      If the leader tries to send snapshot to the follower 
      (with snapshot last index:50), currently, follower accepts 
      the snapshot. As follower already has entries upto index 100, snapshot
      is unnecessary. After delivery is complete, to load the snapshot, 
      follower will call raft_begin_load_snapshot(). This function realizes
      the snapshot was unnecessary and it fails. It is harmless but snapshot
      delivery was unnecessary.
      
      This PR prevents this issue earlier by checking last log index instead
       of snapshot last index.
      
      Also, added more virtraft tests with auto-flush on. 
      (This is a different pattern, it might help with detecting these issues)
      85ae16e0
  3. 13 Mar, 2022 1 commit
  4. 07 Feb, 2022 1 commit
  5. 16 Nov, 2021 1 commit
    • Yossi Gottlieb's avatar
      Properly get coverage from all tests. (#70) · ada3d6a0
      Yossi Gottlieb authored
      * Add COVERAGE=1 Makefile option to build libraft with coverage.
      * Refactor CFFI module to use the existing shared object in an
        out-of-line configuration, so there's no need to build and re-build
        it.
      * Makefile adjustments to build the module CFFI as needed.
      * Remove raft_get_snapshot_entry_idx, a prototype for an undefined
        function that breaks CFFI.
      * Add a gcov Makefile target to fetch both unit tests and integration
        test coverage in one shot.
      ada3d6a0
  6. 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
  7. 30 Aug, 2021 1 commit
  8. 01 Aug, 2021 1 commit
  9. 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
  10. 27 Jul, 2021 1 commit
    • Shaya Potter's avatar
      match up raft_get_last_log_term() to should_grant_vote() (#14) · fab583d6
      Shaya Potter authored
      raft_get_last_log_term() is used for filling in vote requests, except it didn't match 100% with the logic in should_grant_vote
      
      * update test to prove that change works as needed
      
      previous test tested when we don't snapshot everything, but code was broken when we did.
      modified test tested only when we snapshot everything, now we do both in sequence.
      
      * use raft_get_last_log_term in __should_grant_vote()
      
      also modify __should_grant_vote to take a raft_server_t instead of raft_server_privat_t so its not constantly casting it to void.
      fab583d6
  11. 06 Dec, 2018 1 commit
  12. 14 Aug, 2018 1 commit
    • Willem Thiart's avatar
      Virtraft improvements · 9d2d4560
      Willem Thiart authored
      Less false positive deadlocks
      Logging to file
      Quiet mode
      Less strict partitions
      Include latest partitions in diagnostics
      9d2d4560
  13. 30 Jul, 2018 1 commit
  14. 22 Jul, 2018 1 commit
  15. 11 Jun, 2018 1 commit
  16. 23 May, 2018 1 commit
  17. 16 May, 2018 1 commit
  18. 06 May, 2018 1 commit
  19. 08 Jan, 2018 1 commit
  20. 29 Dec, 2017 1 commit
    • Willem Thiart's avatar
      Fix: log edge cases · b912ff5a
      Willem Thiart authored
      The raft_log API is now being fuzzed tested. This change fixes all of
      the bugs detected by the fuzzer so far.
      b912ff5a
  21. 21 Nov, 2017 1 commit
  22. 20 Nov, 2017 1 commit
  23. 05 Mar, 2016 1 commit
  24. 11 Feb, 2016 2 commits
  25. 25 Jul, 2015 1 commit
  26. 01 Feb, 2015 1 commit
  27. 25 Jun, 2014 1 commit
    • Matt Amos's avatar
      Changes to compile on Linux. · f2f8b9a5
      Matt Amos authored
      GNU make wanted `VPATH` set so that it could find the source
      files. GNU ld complained about missing `-fPIC` for the object
      files being linked into a shared library, so added that too.
      f2f8b9a5
  28. 28 May, 2014 1 commit
  29. 26 Feb, 2014 3 commits
  30. 14 Feb, 2014 3 commits
  31. 16 Jan, 2014 1 commit
  32. 14 Jan, 2014 1 commit
  33. 13 Jan, 2014 3 commits