Skip to content
Branch: main
Commits on Jan 23, 2020
  1. A server with the leader attribute sent to true will now send out a b…

    chelseatroy committed Jan 23, 2020
    …roadcast every 5 seconds
    - Also, I did a lot of renaming. I still don't like most of the names, so expect this to happen again and again
Commits on Jan 20, 2020
  1. Remove unnecessary calls...which, wow, is a lot of them

    chelseatroy committed Jan 20, 2020
    This is freaky y'all
Commits on Dec 27, 2019
  1. I don't know how to assign variables, choose appropriate libary metho…

    chelseatroy committed Dec 27, 2019
    …ds, or write exxplanatory print statements. Luckily, I have friends and collaborators who can help me with these things.
    + This commit fixes the fact that log replication became unreliable for more than one follower server (see 'I don't know how to assign variables')
Commits on Dec 21, 2019
  1. Move several responsibilities out of the server so that it contains l…

    chelseatroy committed Dec 21, 2019
    …ittle code besides managing its two sockets
  2. Explain the circumstances for each permutation of the execute method …

    chelseatroy committed Dec 21, 2019
    …in key value store tests
    + Tack on a test for the server_nodes helper method
Commits on Dec 20, 2019
Commits on Dec 19, 2019
  1. Fix the logic that determines when the key value store must account f…

    chelseatroy committed Dec 19, 2019
    …or the term in reads and writes
    + In the last commit, I assumed that the cases where the key value store needs to write to its log and the cases where the term is not present in the command were the same. They are not. If a leader sends a follower server a command to catch up its log, that log has term numbers in it, but the follower server also needs to write those commands to its own log.
    So we really have three DIFFERENT cases:
    1. Terms present, do not write—A server restarts and is catching up its in memory store from its own log
    2. Terms present, DO write-A follower server is getting caught up from a leader server
    3. Terms absent, DO write-A leader server receives requests to write to its logs from a client
  2. Add the idea of a term to each server.

    chelseatroy committed Dec 19, 2019
    + Term currently starts at 0 when a server starts up
    + Term updated after key value store catches up the logs
    + Key value store writes the current term to the logs
    + Key value store can access the latest term from the logs
  3. Server no longer re-writes to the logs as it catches up the logs

    chelseatroy committed Dec 19, 2019
    + Previously the logs were increasing in length exponentially with each server restart because catching up meant re-running the key value store execution code on the existing logs, which wrote each executed call back to the logs.
  4. Cause a KeyboardInterrupt (or other exception) to exit the run loop s…

    chelseatroy committed Dec 19, 2019
    …o it's easy to stop and restart clients without starting over from a whole new terminal window
Commits on Dec 18, 2019
  1. Server ignores messages that do not require a response

    chelseatroy committed Dec 18, 2019
    The base case now works: if a client tells a server that it is the leader, it can catch up the logs of other servers in the network to whom NO commands that access the key value store have been issued.
    + Problem: If a followe server's logs are different from the leader's logs but the lengths are the same, the leader will not update the follower. So if the leader's logs have set a 1 and set b 2 and the follower's logs have get a and get b, those logs are the same length, and the leader thinks that the follower is caught up.
  2. Servers send their name with any message so that recipient servers ca…

    chelseatroy committed Dec 18, 2019
    …n find out where to send a response
  3. Server now listens on one socket and opens another temporary socket t…

    chelseatroy committed Dec 18, 2019
    …o send messages to other servers
Commits on Dec 17, 2019
  1. Server can send and receive messages to ask about log length, tell it…

    chelseatroy committed Dec 17, 2019
    …s peers its log length, compare a peer's log length to its own, and catch up a peer if it has more logs than a peer
  2. Key value store maintains its own local log, rather than writing to a…

    chelseatroy committed Dec 17, 2019
    … log shared by all servers
  3. Allow us to specify the port for a server and client, with a CLI comm…

    chelseatroy committed Dec 17, 2019
    …and to start a server on a specific port
  4. Practice implementing a state machine with a traffic light example

    chelseatroy committed Dec 17, 2019
    + Separate the state from the timing component
    + Use a queue for sending notifications
Commits on Dec 16, 2019
  1. Lock mutations of each type to the data and the log to prevent simult…

    chelseatroy committed Dec 16, 2019
    …aneous commands on different threads from corrupting the data
  2. Add pycache to .gitignore

    chelseatroy committed Dec 16, 2019
  3. Allow space delimited values to be set in the data store

    chelseatroy committed Dec 16, 2019
    + Remove client issue wherein the response had to be longer than the message sent in for the client to prompt for another message. The fix introduces a risk that the client doesn't wait for the entirety of the response to come through from the server. We looked at how to solve this problem more robustly in the message_pass methods, but I have not incorporated these methods into the client or server yet.
  4. Save commands to log to re-execute when server restarts

    chelseatroy committed Dec 16, 2019
    + Separate key value store management and server code into separate concerns
You can’t perform that action at this time.