Skip to content

Commit 33698ff

Browse files
authored
[1/N] omdb db sagas: list running and inject fault (#7732)
Breaking apart #4378 and copying the structure of #7695, add `omdb db saga` as a command and implement the following sub-commands: Usage: omdb db saga [OPTIONS] <COMMAND> Commands: running List running sagas fault Inject an error into a saga's currently running node This addresses part of the minimum amount required during a release deployment: 1. after quiescing (#6804), omdb can query if there are any running sagas. 2. if those running sagas are stuck in a loop and cannot be drained (#7623), and the release contains a change to the DAG that causes Nexus to panic after an upgrade (#7730), then omdb can inject a fault into the database that would cause that saga to unwind when the affected Nexus is restarted Note for 2, unwinding a saga that is stuck in this way may not be valid if there were significant changes between releases.
1 parent 5fd1c35 commit 33698ff

File tree

11 files changed

+608
-36
lines changed

11 files changed

+608
-36
lines changed

Cargo.lock

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev-tools/omdb/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ serde_json.workspace = true
5252
sled-agent-client.workspace = true
5353
slog.workspace = true
5454
slog-error-chain.workspace = true
55+
steno.workspace = true
5556
strum.workspace = true
5657
supports-color.workspace = true
5758
tabled.workspace = true
@@ -67,6 +68,7 @@ multimap.workspace = true
6768
indicatif.workspace = true
6869
petgraph.workspace = true
6970
oxnet.workspace = true
71+
owo-colors.workspace = true
7072

7173
[dev-dependencies]
7274
camino-tempfile.workspace = true

dev-tools/omdb/src/bin/omdb/db.rs

+7
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ use strum::IntoEnumIterator;
159159
use tabled::Tabled;
160160
use uuid::Uuid;
161161

162+
mod saga;
163+
162164
const NO_ACTIVE_PROPOLIS_MSG: &str = "<no active Propolis>";
163165
const NOT_ON_SLED_MSG: &str = "<not on any sled>";
164166

@@ -343,6 +345,8 @@ enum DbCommands {
343345
/// Query for information about region snapshot replacements, optionally
344346
/// manually triggering one.
345347
RegionSnapshotReplacement(RegionSnapshotReplacementArgs),
348+
/// Commands for querying and interacting with sagas
349+
Saga(saga::SagaArgs),
346350
/// Print information about sleds
347351
Sleds(SledsArgs),
348352
/// Print information about customer instances.
@@ -1064,6 +1068,9 @@ impl DbArgs {
10641068
)
10651069
.await
10661070
}
1071+
DbCommands::Saga(args) => {
1072+
args.exec(&omdb, &opctx, &datastore).await
1073+
}
10671074
DbCommands::Sleds(args) => {
10681075
cmd_db_sleds(&opctx, &datastore, &fetch_opts, args).await
10691076
}

0 commit comments

Comments
 (0)