Skip to content

Commit

Permalink
Expand strong-session-SI and strong-SI anomalies
Browse files Browse the repository at this point in the history
Our definitions of strong session SI and strong SI were limited
specifically to G-nonadjacent-(process|realtime), respectively. We now
consider internal and G1-(process|realtime) anomalies as well.
  • Loading branch information
aphyr committed Oct 26, 2023
1 parent 55866a7 commit bd0f26c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 7 deletions.
Binary file modified images/anomalies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions src/elle/consistency_model.clj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@
:G1a [:G1]
:G1b [:G1]
:G1c [:G1]
:G1c-process [:G1c-realtime]
; Since processes are singlethreaded
:G1c-process [:G1c-realtime :G1-process]
:G1c-realtime [:G1-realtime]
:G1-process [:G1-realtime]

; G-single is a special case of G-nonadjacent
:G-single [:G-nonadjacent
Expand Down Expand Up @@ -400,9 +403,11 @@
; (G-single-realtime), and since we actually formalize this in SI as
; G-nonadjacent rather than just G-single, I'm going to include
; G-nonadjacent's realtime and process variants here too.
:strong-session-snapshot-isolation [:G-nonadjacent-process]
:strong-snapshot-isolation [:G-nonadjacent-realtime]
:strong-session-serializable [:G1c-process ; Daudjee
:strong-session-snapshot-isolation [:G1-process
:G-nonadjacent-process]
:strong-snapshot-isolation [:G1-realtime
:G-nonadjacent-realtime]
:strong-session-serializable [:G1-process ; Daudjee
:G2-process] ; Daudjee
:update-serializable [:G1 :G-update] ; Adya

Expand Down
40 changes: 37 additions & 3 deletions test/elle/list_append_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1027,9 +1027,39 @@
(is (= {:valid? true}
(c {} h))))))

; Example of checking a file, for later
;(deftest dirty-update-1-test
; (cf {} "histories/dirty-update-1.edn")))
(deftest wr-process-test
; An anomaly reported in https://github.com/jepsen-io/elle/issues/21. Elle
; detected this as a violation of strong serializability, but did not
; originally consider it a violation of strong session SI
(let [[t0 t0' t1 t1' t2 t2' :as h]
(h/history
[{:process 1, :type :invoke, :f :txn, :value [[:r :x] [:append :y 1]], :index 0}
{:process 1, :type :ok, :f :txn, :value [[:r :x [1]] [:append :y 1]], :index 1}
{:process 2, :type :invoke, :f :txn, :value [[:r :y]], :index 2}
{:process 2, :type :ok, :f :txn, :value [[:r :y [1]]], :index 3}
{:process 2, :type :invoke, :f :txn, :value [[:append :x 1]], :index 4}
{:process 2, :type :ok, :f :txn, :value [[:append :x 1]], :index 5}])]
(is (= {:valid? false
:anomaly-types [:G1c-process],
:anomalies
{:G1c-process
[{:cycle [t0' t1' t2' t0']
:steps
[{:type :wr,
:key :y,
:value 1,
:a-mop-index 1,
:b-mop-index 0}
{:type :process, :process 2}
{:type :wr,
:key :x,
:value 1,
:a-mop-index 0,
:b-mop-index 0}],
:type :G1c-process}]},
:not #{:strong-session-snapshot-isolation
:strong-session-serializable}}
(c {:consistency-models [:strong-session-snapshot-isolation]} h)))))

(deftest ^:perf scc-search-perf-test
; A case where even small SCCs caused the cycle search to time out
Expand Down Expand Up @@ -1087,3 +1117,7 @@
n run-time (/ n run-time)
check-time (/ n check-time)))))

; Example of checking a file, for later
;(deftest dirty-update-1-test
; (cf {} "histories/dirty-update-1.edn")))

0 comments on commit bd0f26c

Please sign in to comment.