Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker for read chaos experiments #258

Merged
merged 4 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions go-chaos/cmd/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import (
worker "github.com/zeebe-io/zeebe-chaos/go-chaos/worker"
)

const jobType = "zbchaos"
const jobTypeZbChaos = "zbchaos"
const jobTypeReadExperiments = "readExperiments"

func init() {
rootCmd.AddCommand(workerCommand)
Expand Down Expand Up @@ -54,7 +55,8 @@ func start_worker(cmd *cobra.Command, args []string) {
}

// Allow only one job at a time, otherwise job handling might interfere (e.g. override global vars)
jobWorker := client.NewJobWorker().JobType(jobType).Handler(handleZbChaosJob).MaxJobsActive(1).Open()
jobWorker := client.NewJobWorker().JobType(jobTypeZbChaos).Handler(handleZbChaosJob).MaxJobsActive(1).Open()
client.NewJobWorker().JobType(jobTypeReadExperiments).Handler(handleZbChaosJob).MaxJobsActive(1).Open()
jobWorker.AwaitClose()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"version": "0.1.0",
"title": "Zeebe Leader restart gracefully experiment",
"description": "Zeebe should be fault-tolerant. Zeebe should recover after a partition leader was restarted gracefully.",
"contributions": {
"reliability": "high",
"availability": "high"
},
"steady-state-hypothesis": {
"title": "Zeebe is alive",
"probes": [
{
"name": "All pods should be ready",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-readiness.sh",
"timeout": 900
}
},
{
"name": "Should be able to create process instances on partition 1",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-steady-state.sh",
"arguments": "1",
"timeout": 900
}
}
]
},
"method": [
{
"type": "action",
"name": "Terminate leader of partition 1",
"provider": {
"type": "process",
"path": "shutdown-gracefully-partition.sh",
"arguments": [ "Leader", "1" ]
}
}
],
"rollbacks": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"version": "0.1.0",
"title": "Zeebe Leader restart non-graceful experiment",
"description": "Zeebe should be fault-tolerant. We expect that Zeebe can handle non-graceful leader restarts.",
"contributions": {
"reliability": "high",
"availability": "high"
},
"steady-state-hypothesis": {
"title": "Zeebe is alive",
"probes": [
{
"name": "All pods should be ready",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-readiness.sh",
"timeout": 900
}
},
{
"name": "Should be able to create process instances on partition 1",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-steady-state.sh",
"arguments": "1",
"timeout": 900
}
}
]
},
"method": [
{
"type": "action",
"name": "Terminate leader of partition 1 non-gracefully",
"provider": {
"type": "process",
"path": "terminate-partition.sh",
"arguments": [ "Leader", "1" ]
}
}
],
"rollbacks": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"version": "0.1.0",
"title": "Zeebe message correlation experiment",
"description": "Zeebe message correlation should work even if the leader was restarted on which the message was published.",
"contributions": {
"reliability": "high",
"availability": "high"
},
"steady-state-hypothesis": {
"title": "Zeebe is alive",
"probes": [
{
"name": "All pods should be ready",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-readiness.sh",
"timeout": 900
}
}
]
},
"method": [
{
"type": "action",
"name": "Publish message to partition one",
"tolerance": 0,
"provider": {
"type": "process",
"path": "publish-message.sh",
"timeout": 900
}
},
{
"type": "action",
"name": "Terminate leader of partition 1 non-gracefully",
"provider": {
"type": "process",
"path": "terminate-partition.sh",
"arguments": [ "Leader", "1" ]
}
},
{
"name": "Should be able to create a process and await the message correlation",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "await-message-correlation.sh",
"timeout": 900
}
}
],
"rollbacks": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"version": "0.1.0",
"title": "Zeebe Leader restart multiple times experiment",
"description": "Zeebe should be able to handle multiple leader changes in short period.",
"contributions": {
"reliability": "high",
"availability": "high"
},
"steady-state-hypothesis": {
"title": "Zeebe is alive",
"probes": [
{
"name": "All pods should be ready",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-readiness.sh",
"timeout": 900
}
},
{
"name": "Should be able to create process instances on partition one",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-steady-state.sh",
"arguments": "1",
"timeout": 900
}
}
]
},
"method": [
{
"type": "action",
"name": "Terminate leader of partition one",
"provider": {
"type": "process",
"path": "terminate-partition.sh",
"arguments": ["Leader", "1"],
"status": "0"
}
},
{
"name": "All pods should be ready",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-readiness.sh",
"timeout": 900
}
},
{
"name": "Should be able to create process instances on partition one",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-steady-state.sh",
"arguments": "1",
"timeout": 900
}
},
{
"type": "action",
"name": "Terminate leader of partition one",
"provider": {
"type": "process",
"path": "terminate-partition.sh",
"arguments": ["Leader", "1"],
"status": "0"
}
},
{
"name": "All pods should be ready",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-readiness.sh",
"timeout": 900
}
},
{
"name": "Should be able to create process instances on partition one",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-steady-state.sh",
"arguments": "1",
"timeout": 900
}
},
{
"type": "action",
"name": "Terminate leader of partition one",
"provider": {
"type": "process",
"path": "terminate-partition.sh",
"arguments": ["Leader", "1"],
"status": "0"
}
}
],
"rollbacks": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"version": "0.1.0",
"title": "CPU stress on an Broker",
"description": "The cpu stress on an abritrary node should not cause any failures. We should be able to start and complete instances.",
"contributions": {
"reliability": "high",
"availability": "high"
},
"steady-state-hypothesis": {
"title": "Zeebe is alive",
"probes": [
{
"name": "All pods should be ready",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-readiness.sh",
"timeout": 900
}
},
{
"name": "Should be able to create process instances on partition 1",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-steady-state.sh",
"arguments": "1",
"timeout": 900
}
}
]
},
"method": [
{
"type": "action",
"name": "Stress CPU on Broker",
"provider": {
"type": "process",
"path": "stress-cpu.sh"
}
}
],
"rollbacks": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"version": "0.1.0",
"title": "Zeebe Worker restart experiment",
"description": "Zeebe Workers should be able to reconnect after restart.",
"contributions": {
"reliability": "high",
"availability": "high"
},
"steady-state-hypothesis": {
"title": "Zeebe is alive",
"probes": [
{
"name": "All pods should be ready",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "verify-readiness.sh",
"timeout": 900
}
},
{
"name": "Should be able to create a process and await the result",
"type": "probe",
"tolerance": 0,
"provider": {
"type": "process",
"path": "await-processes-with-result.sh",
"arguments": "1",
"timeout": 900
}
}
]
},
"method": [
{
"type": "action",
"name": "Restart worker pod",
"tolerance": 0,
"provider": {
"type": "process",
"path": "terminate-workers.sh",
"timeout": 900
},
"pauses": {
"after": 5
}
}
],
"rollbacks": []
}
Loading