Implement the two-phase commit protocol around a replicated key-value store in Go.
To get started:
- Install Go v1 http://golang.org/doc/install
- Install Bazaar http://wiki.bazaar.canonical.com/Download (needed for
gocheck
) git clone git://github.com/ianobermiller/gotwopc.git
cd gotwopc
go get
to install dependenciesgo test
Some notes:
- Persistent storage uses the filesystem, with the keys just being filenames
- Each replica has a directory under
data
with two dirs,temp
for uncommitted data, andcommitted
for committed data - Each replica and the master have a log file under
logs
- Logs are CSVs, with each entry having the format
TransactionId,STATE,OPERATION,Key
(some entries don't use all the fields, so they get default values to keep things simple)
TODO:
- Trim the log