diff options
author | Alex Auvolat <alex@adnab.me> | 2023-10-20 15:53:46 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-10-20 15:53:46 +0200 |
commit | 9030c1eef8f4c7c3435835f15e6b236497f93323 (patch) | |
tree | ef3a5681879d3402d85bf3291f47892aa5fd46e5 | |
parent | 654775308ed03abd68941b07b2ad367a4de5c57f (diff) | |
download | garage-9030c1eef8f4c7c3435835f15e6b236497f93323.tar.gz garage-9030c1eef8f4c7c3435835f15e6b236497f93323.zip |
jepsen: code path for nemesis final generator
-rw-r--r-- | script/jepsen.garage/src/jepsen/garage.clj | 2 | ||||
-rw-r--r-- | script/jepsen.garage/src/jepsen/garage/nemesis.clj | 44 |
2 files changed, 24 insertions, 22 deletions
diff --git a/script/jepsen.garage/src/jepsen/garage.clj b/script/jepsen.garage/src/jepsen/garage.clj index 65a92a76..ace3e66a 100644 --- a/script/jepsen.garage/src/jepsen/garage.clj +++ b/script/jepsen.garage/src/jepsen/garage.clj @@ -73,7 +73,7 @@ (gen/nemesis (:generator scenario)) (gen/time-limit (:time-limit opts))) (gen/log "Healing cluster") - (gen/nemesis (gen/once {:type :info, :f :partition-stop})) + (gen/nemesis (:final-generator scenario)) (gen/log "Waiting for recovery") (gen/sleep 10) (gen/clients (:final-generator workload))) diff --git a/script/jepsen.garage/src/jepsen/garage/nemesis.clj b/script/jepsen.garage/src/jepsen/garage/nemesis.clj index 7cd9306e..9edfe418 100644 --- a/script/jepsen.garage/src/jepsen/garage/nemesis.clj +++ b/script/jepsen.garage/src/jepsen/garage/nemesis.clj @@ -64,28 +64,30 @@ (defn scenario-cp "Clock scramble + parittion 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}]) - :nemesis (nemesis/compose - {{:partition-start :start - :partition-stop :stop} (nemesis/partition-random-halves) - {:clock-scramble :scramble} (nemesis/clock-scrambler 20.0)})}) + {: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}]) + :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)})}) (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}]) - :nemesis (nemesis/compose - {{:reconfigure-start :start - :reconfigure-stop :stop} (reconfigure-subset 3)})}) + {: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}) + :nemesis (nemesis/compose + {{:reconfigure-start :start + :reconfigure-stop :stop} (reconfigure-subset 3)})}) |