Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix persistence and add automatic journal flushing #98

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Commits on Nov 8, 2018

  1. Configuration menu
    Copy the full SHA
    1983a29 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2018

  1. Configuration menu
    Copy the full SHA
    28171f2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0776b3c View commit details
    Browse the repository at this point in the history
  3. Fix "IndexError: mmap slice assignment is wrong size" in ResizableFil…

    …e when writing large data
    
    ResizableFile only extended once even when the data to be written to it was larger than that. For example, if the file is currently 1024 B and we're trying to write 1.5 KiB to it, it would get resized to 2048 B and the write would fail (because 2.5 KiB would be required).
    JustAnotherArchivist committed Nov 15, 2018
    Configuration menu
    Copy the full SHA
    38d6adf View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2018

  1. Add currentTerm and votedForNodeId to the journal

    The FileJournal only stores the hash of the votedForNodeId because the size of the stored value has to be constant.
    Therefore, FileJournal.votedForNodeId does not return the actual node ID but a proxy object which can be compared against the node ID.
    JustAnotherArchivist committed Nov 16, 2018
    Configuration menu
    Copy the full SHA
    568b03f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a251652 View commit details
    Browse the repository at this point in the history
  3. Block votes for 1.1 times the maximum timeout when flushing is disabl…

    …ed or no file journal is used
    JustAnotherArchivist committed Nov 16, 2018
    Configuration menu
    Copy the full SHA
    5af5f9a View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2018

  1. Fix test failures in test_sync_noflush_novote

    - The test was very sensitive to small timing differences.
      This updated version is still sensitive, but it should be much better now. I was unable to trigger any failures even under high load.
    - o1 should be a follower after o2's first vote request due to the higher term in o2's message and its timeout not having been triggered again.
    - Python 2's math.ceil returns a float instead of an int for whatever reason.
    JustAnotherArchivist committed Nov 17, 2018
    Configuration menu
    Copy the full SHA
    ac263d0 View commit details
    Browse the repository at this point in the history
  2. Fix test failures in test_sync_noflush_novote, take 2

    The doTicks approach did not work well because it isn't very accurate and doesn't take into account the time spent outside of the actual ticking.
    So this replaces it with a direct loop which compares against the current time to ensure that exactly the right amount of time has elapsed since the creation of the SyncObj.
    
    This test may break again if the time spent inside SyncObj increases greatly; for example, if __init__ takes very long, the start time would not match the corresponding values inside the objects. Each individual tick may also not take too long.
    JustAnotherArchivist committed Nov 17, 2018
    Configuration menu
    Copy the full SHA
    1bc7246 View commit details
    Browse the repository at this point in the history