-
Notifications
You must be signed in to change notification settings - Fork 42
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
More omdb improvements #7805
base: main
Are you sure you want to change the base?
More omdb improvements #7805
Conversation
Three improvements to omdb: - for the `replacements-to-do` command, show if there's an existing replacement request: display the id, request time, and state - add a sub-command to show if any volumes are cooked, aka unable to activate due to a region set containing all expunged targets - add a sub-command to show what volumes reference an ip, netmask, read-only region, or region snapshot
Some sample output:
|
cooked output:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor things. This will be a useful tool improvement.
dev-tools/omdb/src/bin/omdb/db.rs
Outdated
@@ -847,6 +852,10 @@ enum VolumeCommands { | |||
List, | |||
/// What is holding the lock? | |||
LockHolder(VolumeLockHolderArgs), | |||
/// What volumes are cooked (read: cannot activate)? | |||
Cooked, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While Iove the cooked name, I think we might want a better one that describes what this command will returned. Invalid? illegal? And, also, the comment should not be a question :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question part is for the help commands listing:
Commands:
info Get info for a specific volume
list Summarize current volumes
lock-holder What is holding the lock?
cooked What volumes are cooked (read: cannot activate)?
reference What volumes reference a thing?
help Print this message or the help of the given subcommand(s)
I've changed this to CannotActivate
in 21d9658
#[clap(group( | ||
ArgGroup::new("volume-reference-group") | ||
.required(true) | ||
.args(&["ip", "net", "read_only_region", "region_snapshot"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a question users are going to have is "what is the difference between a region_snapshot and just a snapshot". I don't know how to tell them. I also don't know what if anything we do different here.
dev-tools/omdb/src/bin/omdb/db.rs
Outdated
VolumeCookedResult::TargetNotFound { target } => { | ||
println!( | ||
"target {target} not found (was probably \ | ||
deleted concurrently when `volume_cooked` was called)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not print the probably ...
message here, as transient things like this can happen all over omdb and we make no guarantee that things remain static.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, done in 4d16c73
fetch_opts: &DbFetchOptions, | ||
args: &VolumeReferenceArgs, | ||
) -> Result<(), anyhow::Error> { | ||
let volume_ids: Vec<Uuid> = if let Some(ip) = args.ip { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are working on the "clap should not .." path through here already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, 996da6e validates that three UUIDs are supplied
dev-tools/omdb/src/bin/omdb/db.rs
Outdated
#[clap(long, conflicts_with_all = ["ip", "net", "region_snapshot"])] | ||
read_only_region: Option<Uuid>, | ||
|
||
/// Provide dataset, region, and snapshot ID in a string, delimited by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This help comment here is what I need to see.
From the help output:
--region-snapshot <REGION_SNAPSHOT>
That makes it seem like I only need a single item. Is this part done by clap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah. with 996da6e this now looks like --region_snapshot <REGION_SNAPSHOT> <REGION_SNAPSHOT> <REGION_SNAPSHOT>
and I don't know how to fix it 👎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in dea7c69
Three improvements to omdb:
for the
replacements-to-do
command, show if there's an existing replacement request: display the id, request time, and stateadd a sub-command to show if any volumes are cooked, aka unable to activate due to a region set containing all expunged targets
add a sub-command to show what volumes reference an ip, netmask, read-only region, or region snapshot