1. 27 Dec, 2022 1 commit
  2. 31 Oct, 2022 1 commit
  3. 25 Oct, 2022 1 commit
    • Ozan Tezcan's avatar
      Refactor higher term handling (#149) · 2ce5363f
      Ozan Tezcan authored
      This PR refactors code regarding `term` handling inside 
      `raft_recv_appendentries()` and `raft_recv_snapshot()` without 
      introducing any logic changes. 
      
      - Deleted `raft_receive_term()` function:
          This function sets the node as follower in certain cases. Although,
          it misses the pre-candidate state.
           
          We already set the node as follower inside `raft_accept_leader()`.
          (With the correct check that also handles pre-candidate state). 
      
      - Moved `raft_reset_transfer_leader()` into `raft_accept_leader()`. 
          Leader transfer is completed when we accept a leader. So, it makes
          sense to move it into `raft_accept_leader()`.
          
      - Added some tests to verify node becomes follower even on a
           pre-candidate state when a request is received with same or
           higher term.
      2ce5363f
  4. 03 Oct, 2022 1 commit
  5. 20 Sep, 2022 1 commit
  6. 19 Sep, 2022 2 commits
  7. 12 Sep, 2022 2 commits
  8. 30 Aug, 2022 1 commit
    • Ozan Tezcan's avatar
      Refactor debug logging (#127) · e79d3b6a
      Ozan Tezcan authored
      Refactor debug logging and change log callback
      
      e.g:
      19 --> 13, sent snapshot_resp id:27712, t:24, s:1, o:4096, lc:0
      14 --> 17, sent requestvote_req pv:1, t:25, ci:14, lli:6848, llt:23
      14 <-- 17, recv requestvote_resp pv:1, t:25, rt:24, vg:0
      
      Breaking changes: 
      
      raft_log_f() callback will not pass node_id_t anymore.
      Sender and receiver will be part of the log line as you can see above.
      e79d3b6a
  9. 29 Aug, 2022 3 commits
    • Ozan Tezcan's avatar
      Simplify entry removal (#130) · c0270e61
      Ozan Tezcan authored
      Simplied pop callback.
      
      Previously, libraft was passing a callback(raft_entry_notify_f) to the pop callback.
      The application was supposed to call that callback for each removed entry.
      
      Libraft can loop over the entries and call the required functions itself.
      So, we can delete raft_entry_notify_f from the pop callback just to
      simplify API.
      
      In addition to that, this PR removes raft_pop_entry() function which doesn't have
      a use-case, as far as I can see.
      We can use raft_delete_entry_from_idx(me, raft_get_current_idx()) instead if required.
      c0270e61
    • Ozan Tezcan's avatar
      Add raft_get_last_applied_term() (#131) · 2279a960
      Ozan Tezcan authored
      Add raft_get_last_applied_term()
      2279a960
    • Ozan Tezcan's avatar
      Fix style (#128) · 21844ec6
      Ozan Tezcan authored
      Fix style issues in raft_log.c raft_node.c and raft_server_properties.c
      21844ec6
  10. 28 Aug, 2022 1 commit
  11. 25 Aug, 2022 1 commit
    • Ozan Tezcan's avatar
      Add support to rebuild configuration after a restart (#125) · 9c09a6cc
      Ozan Tezcan authored
      Configuration changes are special in Raft. They take effect 
      whenever the related log entries are appended. On a restart, 
      we should go over the log entries and rebuild the configuration.
      
      Adding raft_restore_log() function for this purpose.
      
      Overall, on a restart, application should do:
      
      Load the snapshot and call raft_restore_snapshot()
      Load the log entries and call raft_restore_log()
      Read the metadata file and call raft_restore_metadata().
      9c09a6cc
  12. 23 Aug, 2022 2 commits
  13. 22 Aug, 2022 2 commits
    • Ozan Tezcan's avatar
      Fix return types (#122) · e8791a27
      Ozan Tezcan authored
      Use typedef instead of the actual type
      e8791a27
    • 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
  14. 18 Aug, 2022 1 commit
  15. 16 Aug, 2022 1 commit
  16. 08 Aug, 2022 1 commit
  17. 07 Jul, 2022 1 commit
  18. 30 Jun, 2022 1 commit
  19. 19 Jun, 2022 1 commit
  20. 19 May, 2022 1 commit
  21. 02 May, 2022 1 commit
  22. 26 Apr, 2022 1 commit
  23. 06 Apr, 2022 1 commit
  24. 30 Mar, 2022 2 commits
  25. 24 Mar, 2022 1 commit
  26. 21 Mar, 2022 1 commit
  27. 13 Mar, 2022 3 commits
  28. 06 Mar, 2022 1 commit
  29. 07 Feb, 2022 1 commit
  30. 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
  31. 15 Nov, 2021 1 commit