CSE 452 ― Discussion Section 3: �git and Other Things
Lab 1 Recap
Lab 2
Questions?
Weak Consistency/Disconnected Operation
Motivation
How can we support disconnected or weakly connected operation?
Applications
Answer in One Paper
Terry et al. “Managing Update Conflicts in Bayou, a Weakly Connected Replicated Storage System.”
Think of it as a generalization of all the examples from the previous slide.
Consistency
Serializability/Linearizability/Sequential Consistency:�very “strong” consistency guarantees; essentially, the system appears to the clients as a single, correct process
Eventual Consistency:�much weaker guarantee; if all updates stop, then eventually all processes will converge to the same state��“Eventual consistency is no consistency”
Dealing With Eventually
We can often do better than “eventual” consistency, but if you ever want to allow disconnected operation, there are a certain set of problems that always come up.��What happens when a disconnected client updates some data, and another disconnected client updates the same data in a conflicting way, and they both come back online?��Hmm……. That problem sounds familiar.
Source Code Control
CVS (1990)
CVS Workflow
CVS Workflow
CVS Workflow
CVS Workflow
CVS Limitations
Apache SVN (2000)
“CVS done right”
Improvements:
Still active; all of Facebook’s source code was in a single SVN repo until 2014
git (2005)
Content-Addressable Filesystem
./git/objects/pack:
Logs (Commit Histories)
An Example
$ git init
$ echo “version 1” > test.txt
$ git add test.txt
$ git commit -m “first commit”
$ echo “version 2” > test.txt
$ echo “new file” > new.txt
$ git add ./
$ git commit -m “second commit”
$ mkdir bak
$ echo “version 1” > bak/test.txt
$ git add bak/
$ git commit -m “third commit”
Commit “abc”
Commit “def”
Commit “ghi”
Commit �“jkl”
S <0, 0>
S <1, 0>
S <0, 1>
S <1, 1>
Reconciling Conflicts
Want More git Goodness?
Git Internals: https://git-scm.com/book/en/v1/Git-Internals