Skip to content

Instantly share code, notes, and snippets.

@aphyr
Last active December 16, 2015 11:29
Show Gist options
  • Save aphyr/5428061 to your computer and use it in GitHub Desktop.
Save aphyr/5428061 to your computer and use it in GitHub Desktop.
This is a last-write-wins Riak application running across five nodes. Clients are subject to a perfect global write lock: no two clients will ever change a key at the same time. "." means 100 writes, "!" means a single failed write. The string of !!!s in the middle, gradually decreasing in density, is the effect of a network partition followed b…
user=> (run (apps (comp locking-app riak-lww-sloppy-quorum-app)))
.......!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!.!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.........Hit enter when ready to collect results.
#_=>
Writes completed in 178.326 seconds
2000 total
1841 acknowledged
1246 survivors
599 acknowledged writes lost! (╯°□°)╯︵ ┻━┻
505 506 510 511 515 516 ... 1985 1986 1990 1991 1995 1996
4 unacknowledged writes found! ヽ(´ー`)ノ
(242 384 419 604)
0.9205 ack rate
0.32536665 loss rate
0.0021727323 unacknowledged but successful rate
(defn riak-lww-sloppy-quorum-app
[opts]
(riak-app (merge {:read {:r Quora/QUORUM}
:write {:w Quora/QUORUM
:dw Quora/QUORUM}
:bucket-opts {:allow-siblings false
:n-val 3}}
opts)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment