Skip to content
Snippets Groups Projects
Commit f9049dff authored by keleher's avatar keleher
Browse files

auto

parent 980738a3
No related branches found
No related tags found
No related merge requests found
......@@ -121,13 +121,19 @@ At end-of-text (CTRL-D), `transactionalClient` prints the contents of the K/V
store and committed transactions.
## Testing
Your `transactionalClient.go` should take a `-p` option, which will tell your code to do
two things:
- write a commit/abort notification for each transaction as it's fate is decided
- at end-of-text write out the contents of your KV store, ordered lexicographically by key value. Only
written values need be printed.
Your `transactionalClient.go` takes several arguments (see code), but the two important ones
are:
- `-p` - tells your code to do two things:
- write a commit/abort notification for each transaction as it's fate is decided
- at end-of-text write out the contents of your KV store, ordered lexicographically by key value. Only
written values need be printed.
- `-s` use snapshot isolation instead serializable isolation
### Strict Serializability
I will run the replica set as `run.rb 3`, and the client as `go run transactionalClient.go
-p` or `go run transactionalClient.go -p -s`.
One example. Time is going downwards. Note that transaction *1* of client *1* is different
from transaction *1* of client *2*. You can type these in interactively. Note that the
commands could be written by different instantiations of `transactionalClient.go`, but
......
......@@ -32,16 +32,17 @@ type ConfigFile struct {
}
var (
N = 3
configFile = "../config.json"
debug = false
repID = 0
hostname string
identity string
servers []pb.KVClient
log = []pb.CommandString{}
store = make(map[string]string)
doPrint = false
N = 3
configFile = "../config.json"
debug = false
repID = 0
hostname string
identity string
servers []pb.KVClient
log = []pb.CommandString{}
store = make(map[string]string)
doPrint = false
snapshotIsolation = false
)
//=====================================================================
......@@ -55,7 +56,7 @@ func main() {
store["bar"] = "4 2"
for {
if c := Getopt("c:dN:pr:"); c == EOF {
if c := Getopt("c:dN:pr:s"); c == EOF {
break
} else {
switch c {
......@@ -75,6 +76,8 @@ func main() {
case 'r':
repID, _ = strconv.Atoi(OptArg)
case 's':
snapshotIsolation = true
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment