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

auto

parent a4d03d7e
No related branches found
No related tags found
No related merge requests found
...@@ -112,8 +112,9 @@ log abstraction in `replica.go` ...@@ -112,8 +112,9 @@ log abstraction in `replica.go`
## Use of the `transactionalClient` ## Use of the `transactionalClient`
`transactionalClient.go` differs from `client.go` in that it reads commands `transactionalClient.go` differs from `client.go` in that it reads commands
interactively. Once started, it reads commands (arbitrary strings) from STDIN interactively. Once started, it reads commands (arbitrary strings) from STDIN
and sends them to replica 0. The sole exception is: and sends them to replica 0. The sole exceptions are:
- `pause <n>` is interpreted as a command to pause for `n` seconds. - `pause <n>` is interpreted as a command to pause for `n` seconds.
- an empty string (just carriage return) is ignored.
All other strings are sent to the replica. All other strings are sent to the replica.
At end-of-text (CTRL-D), `transactionalClient` prints the contents of the K/V At end-of-text (CTRL-D), `transactionalClient` prints the contents of the K/V
...@@ -129,51 +130,59 @@ two things: ...@@ -129,51 +130,59 @@ two things:
### Strict Serializability ### Strict Serializability
One example. Time is going downwards. Note that transaction *1* of client *1* is different 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. from transaction *1* of client *2*. You can type these in interactively.
```
1,1,w,A,0
1,1,w,B,0
1,1,commit
1,2,r,A
1,2,w,B,nice
2,1,r,A
2,1,w,B,foo
2,2,w,A,bar
2,2,r,B
2,2,commit
2,1,commit
1,2,commit
```
R1 R2
1,1,w,A,0
1,1,w,B,0
1,1,commit
1,2,r,A
1,2,w,B,nice
2,1,r,A
2,1,w,B,foo
2,2,w,A,bar
2,2,r,B
2,2,commit
2,1,commit
1,2,commit
If one of the clients was invoked with option `-p`, it should print: If one of the clients was invoked with option `-p`, it should print:
``` ```
trans 1.1 commit trans 1.1 commit
trans 2.2 commit trans 2.2 commit
trans 2.1 abort trans 2.1 abort
trans 1.2 abort trans 1.2 abort
A='bar' A="bar"
B='0' B="0"
``` ```
--- ---
And another: And another:
```
1,1,w,A,0
1,1,w,B,0
1,1,commit
1,2,w,A,1
1,2,r,B
2,1,w,B,1
2,1,r,A
2,1,commit
1,2,commit
```
R1 R2
1,1,w,A,0
1,1,w,B,0
1,1,commit
1,2,w,A,1
1,1,r,B
2,1,w,B,1
2,1,r,A
2,1,commit
1,2,commit
Your client w/ `-p` should print: Your client w/ `-p` should print:
``` ```
trans 1.1 commit trans 1.1 commit
trans 2.1 commit trans 2.1 commit
trans 1.2 abort trans 1.2 abort
A='0' A="0"
B='1' B="1"
``` ```
...@@ -185,16 +194,16 @@ trans 1.1 commit ...@@ -185,16 +194,16 @@ trans 1.1 commit
trans 2.2 commit trans 2.2 commit
trans 2.1 commit trans 2.1 commit
trans 1.2 abort trans 1.2 abort
A='bar' A="bar"
B='foo' B="foo"
``` ```
and and
``` ```
trans 1.1 commit trans 1.1 commit
trans 2.1 commit trans 2.1 commit
trans 1.2 abort trans 1.2 abort
A='1' A="1"
B='1' B="1"
``` ```
## Submitting ## Submitting
......
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