Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
8
818f19p5
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Keleher
818f19p5
Commits
f9049dff
Commit
f9049dff
authored
5 years ago
by
keleher
Browse files
Options
Downloads
Patches
Plain Diff
auto
parent
980738a3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+11
-5
11 additions, 5 deletions
README.md
go/src/818f19/p5/DIRID/client/transactionalClient.go
+14
-11
14 additions, 11 deletions
go/src/818f19/p5/DIRID/client/transactionalClient.go
with
25 additions
and
16 deletions
README.md
+
11
−
5
View file @
f9049dff
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
go/src/818f19/p5/DIRID/client/transactionalClient.go
+
14
−
11
View file @
f9049dff
...
...
@@ -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
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment