Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
Created using spr 1.3.6-beta.1
  • Loading branch information
sunshowers committed Feb 14, 2024
2 parents 4cf812f + 8b4d2e9 commit d650b2b
Show file tree
Hide file tree
Showing 27 changed files with 511 additions and 1,652 deletions.
39 changes: 0 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ members = [
"dev-tools/omdb",
"dev-tools/omicron-dev",
"dev-tools/oxlog",
"dev-tools/thing-flinger",
"dev-tools/xtask",
"dns-server",
"end-to-end-tests",
Expand Down Expand Up @@ -96,7 +95,6 @@ default-members = [
"dev-tools/omdb",
"dev-tools/omicron-dev",
"dev-tools/oxlog",
"dev-tools/thing-flinger",
# Do not include xtask in the list of default members, because this causes
# hakari to not work as well and build times to be longer.
# See omicron#4392.
Expand Down
8 changes: 8 additions & 0 deletions bootstore/src/schemes/v0/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ pub enum NodeRequestError {
},
}

impl From<NodeRequestError> for omicron_common::api::external::Error {
fn from(error: NodeRequestError) -> Self {
omicron_common::api::external::Error::internal_error(&format!(
"{error}"
))
}
}

/// A request sent to the `Node` task from the `NodeHandle`
pub enum NodeApiRequest {
/// Initialize a rack at the behest of RSS running on the same scrimlet as
Expand Down
56 changes: 56 additions & 0 deletions dev-tools/omdb/src/bin/omdb/sled_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ enum SledAgentCommands {
/// print information about zpools
#[clap(subcommand)]
Zpools(ZpoolCommands),

/// print information about the local bootstore node
#[clap(subcommand)]
Bootstore(BootstoreCommands),
}

#[derive(Debug, Subcommand)]
Expand All @@ -45,6 +49,12 @@ enum ZpoolCommands {
List,
}

#[derive(Debug, Subcommand)]
enum BootstoreCommands {
/// Show the internal state of the local bootstore node
Status,
}

impl SledAgentArgs {
/// Run a `omdb sled-agent` subcommand.
pub(crate) async fn run_cmd(
Expand All @@ -70,6 +80,9 @@ impl SledAgentArgs {
SledAgentCommands::Zpools(ZpoolCommands::List) => {
cmd_zpools_list(&client).await
}
SledAgentCommands::Bootstore(BootstoreCommands::Status) => {
cmd_bootstore_status(&client).await
}
}
}
}
Expand Down Expand Up @@ -110,3 +123,46 @@ async fn cmd_zpools_list(

Ok(())
}

/// Runs `omdb sled-agent bootstore status`
async fn cmd_bootstore_status(
client: &sled_agent_client::Client,
) -> Result<(), anyhow::Error> {
let status = client.bootstore_status().await.context("bootstore status")?;
println!("fsm ledger generation: {}", status.fsm_ledger_generation);
println!(
"network config ledger generation: {:?}",
status.network_config_ledger_generation
);
println!("fsm state: {}", status.fsm_state);
println!("peers (found by ddmd):");
if status.peers.is_empty() {
println!(" <none>");
}
for peer in status.peers.iter() {
println!(" {peer}");
}
println!("established connections:");
if status.established_connections.is_empty() {
println!(" <none>");
}
for c in status.established_connections.iter() {
println!(" {:?} : {}", c.baseboard, c.addr);
}
println!("accepted connections:");
if status.accepted_connections.is_empty() {
println!(" <none>");
}
for addr in status.accepted_connections.iter() {
println!(" {addr}");
}
println!("negotiating connections:");
if status.negotiating_connections.is_empty() {
println!(" <none>");
}
for addr in status.negotiating_connections.iter() {
println!(" {addr}");
}

Ok(())
}
12 changes: 6 additions & 6 deletions dev-tools/omdb/tests/env.out
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ task: "dns_propagation_internal"


task: "dns_servers_external"
watches list of external DNS servers stored in CockroachDB
watches list of external DNS servers stored in internal DNS


task: "dns_servers_internal"
watches list of internal DNS servers stored in CockroachDB
watches list of internal DNS servers stored in internal DNS


task: "external_endpoints"
Expand Down Expand Up @@ -147,11 +147,11 @@ task: "dns_propagation_internal"


task: "dns_servers_external"
watches list of external DNS servers stored in CockroachDB
watches list of external DNS servers stored in internal DNS


task: "dns_servers_internal"
watches list of internal DNS servers stored in CockroachDB
watches list of internal DNS servers stored in internal DNS


task: "external_endpoints"
Expand Down Expand Up @@ -224,11 +224,11 @@ task: "dns_propagation_internal"


task: "dns_servers_external"
watches list of external DNS servers stored in CockroachDB
watches list of external DNS servers stored in internal DNS


task: "dns_servers_internal"
watches list of internal DNS servers stored in CockroachDB
watches list of internal DNS servers stored in internal DNS


task: "external_endpoints"
Expand Down
8 changes: 4 additions & 4 deletions dev-tools/omdb/tests/successes.out
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,11 @@ task: "dns_propagation_internal"


task: "dns_servers_external"
watches list of external DNS servers stored in CockroachDB
watches list of external DNS servers stored in internal DNS


task: "dns_servers_internal"
watches list of internal DNS servers stored in CockroachDB
watches list of internal DNS servers stored in internal DNS


task: "external_endpoints"
Expand Down Expand Up @@ -313,7 +313,7 @@ task: "dns_servers_internal"
task: "dns_propagation_internal"
configured period: every 1m
currently executing: no
last completed activation: iter 5, triggered by a dependent task completing
last completed activation: iter 4, triggered by a dependent task completing
started at <REDACTED TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
attempt to propagate generation: 1

Expand Down Expand Up @@ -341,7 +341,7 @@ task: "dns_servers_external"
task: "dns_propagation_external"
configured period: every 1m
currently executing: no
last completed activation: iter 5, triggered by a dependent task completing
last completed activation: iter 4, triggered by a dependent task completing
started at <REDACTED TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
attempt to propagate generation: 2

Expand Down
7 changes: 4 additions & 3 deletions dev-tools/omdb/tests/usage_errors.out
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,10 @@ Debug a specific Sled
Usage: omdb sled-agent [OPTIONS] <COMMAND>

Commands:
zones print information about zones
zpools print information about zpools
help Print this message or the help of the given subcommand(s)
zones print information about zones
zpools print information about zpools
bootstore print information about the local bootstore node
help Print this message or the help of the given subcommand(s)

Options:
--sled-agent-url <SLED_AGENT_URL> URL of the Sled internal API [env: OMDB_SLED_AGENT_URL=]
Expand Down
1 change: 0 additions & 1 deletion dev-tools/thing-flinger/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions dev-tools/thing-flinger/Cargo.toml

This file was deleted.

Loading

0 comments on commit d650b2b

Please sign in to comment.