-
Notifications
You must be signed in to change notification settings - Fork 19
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
Make crutest know extent info for each sub volume. #1474
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
34c4960
Make crutest know extent info for each sub volume.
leftwo 231d563
Remove file I did not want to add
leftwo 71a0254
Undo debug comment to make things go faster
leftwo 0ba09e4
more comment cleanup
leftwo 6901b9e
Fix target generation for hand crafted volumes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -38,6 +38,41 @@ pub enum VolumeConstructionRequest { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
impl VolumeConstructionRequest { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/// Return all the targets that are part of this VCR. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pub fn targets(&self) -> Vec<SocketAddr> { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let mut targets = Vec::new(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
match self { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
VolumeConstructionRequest::Volume { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id: _, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
block_size: _, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sub_volumes, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
read_only_parent: _, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for subreq in sub_volumes { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let new_targets = subreq.targets(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for nt in new_targets { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
targets.push(nt); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
VolumeConstructionRequest::Region { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
block_size: _, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
blocks_per_extent: _, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
extent_count: _, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
opts, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
gen: _, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for nt in &opts.target { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
targets.push(*nt); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
_ => {} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
targets | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+43
to
+74
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to manually accumulate into the
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#[allow(clippy::derive_partial_eq_without_eq)] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#[derive( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Debug, Clone, Default, Serialize, Deserialize, JsonSchema, PartialEq, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,8 @@ enum CliCommand { | |
#[clap(long, action)] | ||
skip_verify: bool, | ||
}, | ||
/// Run the sparse fill workload, no verify | ||
FillSparse, | ||
/// Flush | ||
Flush, | ||
/// Run Generic workload | ||
|
@@ -499,6 +501,9 @@ async fn cmd_to_msg( | |
CliCommand::Fill { skip_verify } => { | ||
fw.send(CliMessage::Fill(skip_verify)).await?; | ||
} | ||
CliCommand::FillSparse => { | ||
fw.send(CliMessage::FillSparse).await?; | ||
} | ||
CliCommand::Flush => { | ||
fw.send(CliMessage::Flush).await?; | ||
} | ||
|
@@ -571,8 +576,8 @@ async fn cmd_to_msg( | |
Some(CliMessage::MyUuid(uuid)) => { | ||
println!("uuid: {}", uuid); | ||
} | ||
Some(CliMessage::Info(es, bs, bl)) => { | ||
println!("Got info: {} {} {}", es, bs, bl); | ||
Some(CliMessage::Info(ri)) => { | ||
println!("Got info: {:?}", ri); | ||
} | ||
Some(CliMessage::DoneOk) => { | ||
println!("Ok"); | ||
|
@@ -871,6 +876,23 @@ async fn process_cli_command<T: BlockIO + Send + Sync + 'static>( | |
} | ||
} | ||
} | ||
CliMessage::FillSparse => { | ||
if ri.write_log.is_empty() { | ||
fw.send(CliMessage::Error(CrucibleError::GenericError( | ||
"Info not initialized".to_string(), | ||
))) | ||
.await | ||
} else { | ||
match fill_sparse_workload(block_io.as_ref(), ri).await { | ||
Ok(_) => fw.send(CliMessage::DoneOk).await, | ||
Err(e) => { | ||
let msg = format!("FillSparse failed with {}", e); | ||
let e = CrucibleError::GenericError(msg); | ||
fw.send(CliMessage::Error(e)).await | ||
} | ||
} | ||
} | ||
} | ||
CliMessage::Flush => { | ||
println!("Flush"); | ||
match block_io.flush(None).await { | ||
|
@@ -883,13 +905,10 @@ async fn process_cli_command<T: BlockIO + Send + Sync + 'static>( | |
Err(e) => fw.send(CliMessage::Error(e)).await, | ||
}, | ||
CliMessage::InfoPlease => { | ||
let new_ri = get_region_info(block_io).await; | ||
let new_ri = get_region_info(block_io, false).await; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we know |
||
match new_ri { | ||
Ok(new_ri) => { | ||
let bs = new_ri.block_size; | ||
let es = new_ri.extent_size.value; | ||
let ts = new_ri.total_size; | ||
*ri = new_ri; | ||
*ri = new_ri.clone(); | ||
/* | ||
* We may only want to read input from the file once. | ||
* Maybe make a command to specifically do it, but it | ||
|
@@ -902,7 +921,7 @@ async fn process_cli_command<T: BlockIO + Send + Sync + 'static>( | |
*wc_filled = true; | ||
} | ||
} | ||
fw.send(CliMessage::Info(bs, es, ts)).await | ||
fw.send(CliMessage::Info(new_ri)).await | ||
} | ||
Err(e) => fw.send(CliMessage::Error(e)).await, | ||
} | ||
|
@@ -1074,7 +1093,7 @@ pub async fn start_cli_server<T: BlockIO + Send + Sync + 'static>( | |
*/ | ||
let mut ri: RegionInfo = RegionInfo { | ||
block_size: 0, | ||
extent_size: Block::new_512(0), | ||
sub_volume_info: Vec::new(), | ||
total_size: 0, | ||
total_blocks: 0, | ||
write_log: WriteLog::new(0), | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 data structure gives me bad vibes for a few reasons.
Block
, because itsvalue
field is ambiguous and used in different waysVec<ExtentInfo>
, in which all of theextent_size.value
must be identical (we don't support volumes with mixed block sizes). However, this isn't prevented by the data structure!crucible_client_types::RegionExtentInfo
, which contains the same data as thisstruct
If we want an unambiguous data structure, we could do something like the following:
Using this data structure, we're promising that we've checked and all of the block sizes are the same; we would need to add that check to
Volume::query_extent_info
. Volumes without any subvolumes could still return the top-levelVolumeInfo
with a single value involumes
(equivalen to return a single-itemVec<ExtentInfo>
).