Open leftwo opened 2 months ago
Perhaps a new struct, replace RegionInfo
with VolumeInfo
For a Volume, We could store
<Vec<RegionInfo>>
for each sub_volume
<Option<RegionInfo>>
for read_only_parent
With a geust, it would just be:
A vec, with just one RegionInfo
None
for read_only_parent
Something like this that mimics the way we do volumes:
struct VolumeInfo {
// Block size for the volume,
block_size: u64,
// Total blocks in the volume
total_blocks: u64,
// SubVolumes that make up this volume.
sub_volume: Vec<SubVolumeInfo>
read_only_parent: Option<SubVolumeInfo>
// write log for the volume
write_log: WriteLog,
}
With
struct SubVolumeInfo{
// Number blocks per extent
extent_size: Block,
// Total extents in this sub volume
extent_count: u64,
// Total size in bytes for this sub volume
total_size: u64,
// Range this sub volume covers.
range: Range,
}
I'm not even sure if we need to (at first) support read only parents in crutest, but we can if we want.
The current way crutest works for many tests is to build a
RegionInfo
struct which looks as follows:This allows it to figure out where the extents end and from that how to create tests that catch edge conditions for us without having to first inspect the region then manually create a specific test for it.
In the volume centric world, where we can have multiple
SubVolumes
, this single structure is no longer contains the information we need, and can't actually represent what we want.