aboutsummaryrefslogtreecommitdiff
path: root/script/jepsen.garage/src/jepsen
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-10-24 15:44:05 +0200
committerAlex Auvolat <alex@adnab.me>2023-10-24 15:44:05 +0200
commitd13bde5e26098313e789dd3793368a635cf1cc16 (patch)
treef82094e98a310992c62790f9e0c935fa9455c33b /script/jepsen.garage/src/jepsen
parentd2c365767b0a4cb70dcbb1d20b75f41e0f9c20c8 (diff)
downloadgarage-d13bde5e26098313e789dd3793368a635cf1cc16.tar.gz
garage-d13bde5e26098313e789dd3793368a635cf1cc16.zip
jepsen: set1 and set2 don't fail anymore ??
Diffstat (limited to 'script/jepsen.garage/src/jepsen')
-rw-r--r--script/jepsen.garage/src/jepsen/garage.clj3
-rw-r--r--script/jepsen.garage/src/jepsen/garage/nemesis.clj64
2 files changed, 38 insertions, 29 deletions
diff --git a/script/jepsen.garage/src/jepsen/garage.clj b/script/jepsen.garage/src/jepsen/garage.clj
index 6d64a1b8..a67399e0 100644
--- a/script/jepsen.garage/src/jepsen/garage.clj
+++ b/script/jepsen.garage/src/jepsen/garage.clj
@@ -26,7 +26,8 @@
{"c" grgNemesis/scenario-c
"cp" grgNemesis/scenario-cp
"r" grgNemesis/scenario-r
- "pr" grgNemesis/scenario-pr})
+ "pr" grgNemesis/scenario-pr
+ "cpr" grgNemesis/scenario-cpr})
(def patches
"A map of patch names to Garage builds"
diff --git a/script/jepsen.garage/src/jepsen/garage/nemesis.clj b/script/jepsen.garage/src/jepsen/garage/nemesis.clj
index e64bcaf1..07083038 100644
--- a/script/jepsen.garage/src/jepsen/garage/nemesis.clj
+++ b/script/jepsen.garage/src/jepsen/garage/nemesis.clj
@@ -76,30 +76,24 @@
(defn scenario-cp
"Clock scramble + partition scenario"
[opts]
- {:generator (cycle [(gen/sleep 5)
- {:type :info, :f :partition-start}
- (gen/sleep 5)
- {:type :info, :f :clock-scramble}
- (gen/sleep 5)
- {:type :info, :f :partition-stop}
- (gen/sleep 5)
- {:type :info, :f :clock-scramble}])
+ {:generator (->>
+ (gen/mix [{:type :info, :f :clock-scramble}
+ {:type :info, :f :partition-stop}
+ {:type :info, :f :partition-start}])
+ (gen/stagger 3))
:final-generator (gen/once {:type :info, :f :partition-stop})
:nemesis (nemesis/compose
- {{:partition-start :start
- :partition-stop :stop} (nemesis/partition-random-halves)
- {:clock-scramble :scramble} (nemesis/clock-scrambler 20.0)})})
+ {{:clock-scramble :scramble} (nemesis/clock-scrambler 20.0)
+ {:partition-start :start
+ :partition-stop :stop} (nemesis/partition-random-halves)})})
(defn scenario-r
"Cluster reconfiguration scenario"
[opts]
- {:generator (cycle [(gen/sleep 5)
- {:type :info, :f :reconfigure-start}
- (gen/sleep 5)
- {:type :info, :f :reconfigure-start}
- (gen/sleep 5)
- {:type :info, :f :reconfigure-stop}])
- :final-generator (gen/once {:type :info, :f :reconfigure-stop})
+ {:generator (->>
+ (gen/mix [{:type :info, :f :reconfigure-start}
+ {:type :info, :f :reconfigure-stop}])
+ (gen/stagger 3))
:nemesis (nemesis/compose
{{:reconfigure-start :start
:reconfigure-stop :stop} (reconfigure-subset 3)})})
@@ -107,19 +101,33 @@
(defn scenario-pr
"Partition + cluster reconfiguration scenario"
[opts]
- {:generator (cycle [(gen/sleep 3)
- {:type :info, :f :reconfigure-start}
- (gen/sleep 3)
- {:type :info, :f :partition-start}
- (gen/sleep 3)
- {:type :info, :f :reconfigure-start}
- (gen/sleep 3)
- {:type :info, :f :partition-stop}
- (gen/sleep 3)
- {:type :info, :f :reconfigure-stop}])
+ {:generator (->>
+ (gen/mix [{:type :info, :f :partition-start}
+ {:type :info, :f :partition-stop}
+ {:type :info, :f :reconfigure-start}
+ {:type :info, :f :reconfigure-stop}])
+ (gen/stagger 3))
:final-generator (gen/once {:type :info, :f :partition-stop})
:nemesis (nemesis/compose
{{:partition-start :start
:partition-stop :stop} (nemesis/partition-random-halves)
{:reconfigure-start :start
:reconfigure-stop :stop} (reconfigure-subset 3)})})
+
+(defn scenario-cpr
+ "Clock scramble + partition + cluster reconfiguration scenario"
+ [opts]
+ {:generator (->>
+ (gen/mix [{:type :info, :f :clock-scramble}
+ {:type :info, :f :partition-start}
+ {:type :info, :f :partition-stop}
+ {:type :info, :f :reconfigure-start}
+ {:type :info, :f :reconfigure-stop}])
+ (gen/stagger 3))
+ :final-generator (gen/once {:type :info, :f :partition-stop})
+ :nemesis (nemesis/compose
+ {{:clock-scramble :scramble} (nemesis/clock-scrambler 20.0)
+ {:partition-start :start
+ :partition-stop :stop} (nemesis/partition-random-halves)
+ {:reconfigure-start :start
+ :reconfigure-stop :stop} (reconfigure-subset 3)})})