Skip to content

Commit

Permalink
Make metadata allocation eager and leave data allocation lazy
Browse files Browse the repository at this point in the history
This commit builds on the previous thin provisioning rework. The
simplified, eager metadata allocation allows us to decrease
fragmentation introduced into the previous change and the lazy data
allocation allows us to provide users with the same flexibility around
changing requirements that we previously provided.
  • Loading branch information
jbaublitz committed Oct 3, 2022
1 parent d0e1f7c commit 2b828ec
Show file tree
Hide file tree
Showing 2 changed files with 235 additions and 430 deletions.
5 changes: 3 additions & 2 deletions src/engine/strat_engine/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl StratPool {

let thinpool = ThinPool::new(
pool_uuid,
match ThinPoolSizeParams::new(backstore.available_in_backstore()) {
match ThinPoolSizeParams::new(backstore.datatier_usable_size()) {
Ok(ref params) => params,
Err(e) => {
let _ = backstore.destroy();
Expand Down Expand Up @@ -406,7 +406,7 @@ impl StratPool {
.map(|(_, _, fs)| fs.thindev_size())
.sum::<Sectors>()
+ increase
> self.thin_pool.min_datadev_size(&self.backstore)?
> self.thin_pool.total_fs_limit(&self.backstore)
{
Err(StratisError::Msg(format!(
"Overprovisioning is disabled on this pool and increasing total filesystems size by {} would result in overprovisioning",
Expand Down Expand Up @@ -1237,6 +1237,7 @@ mod tests {
.unwrap()
.pop()
.unwrap();
udev_settle().unwrap();
assert!(pool
.set_overprov_mode(&Name::new(pool_name.to_string()), false)
.is_err());
Expand Down
Loading

0 comments on commit 2b828ec

Please sign in to comment.