Skip to content

Commit

Permalink
chore(bors): merge pull request openebs#744
Browse files Browse the repository at this point in the history
744: feat(volume/resize): don't allow volume resize in presence of snapshots r=dsharma-dc a=dsharma-dc

If a volume is expanded after taking a snapshot, then the IOs to the new io-units(block ranges) fails because the lba range falls out of bound for replica's parent device(snapshot). Till the issue is fixed, this check ensures we don't try to expand a volume if there is snapshot present. SPDK issue #3108.

Co-authored-by: Diwakar Sharma <[email protected]>
  • Loading branch information
mayastor-bors and dsharma-dc committed Feb 16, 2024
2 parents b5eb259 + 1c5492f commit 79ecb1b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions control-plane/agents/src/bin/core/volume/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ impl ResourceResize for OperationGuardArc<VolumeSpec> {
let spec = self.as_ref().clone();
let state = registry.volume_state(&request.uuid).await?;

// Pre-check - Don't allow resize if the volume has snapshots.
// NOTE: This is temporary till the fix for handling this in spdk is done.
if !registry.specs().snapshots_by_vol(self.uuid()).is_empty() {
return Err(SvcError::Internal {
details: "Volume can't be resized while it has snapshots".into(),
});
}
// Pre-checks - volume state eligible for resize.
vol_status_ok_for_resize(&spec)?;
// Pre-check - Ensure pools that host replicas have enough space to resize the replicas,
Expand Down

0 comments on commit 79ecb1b

Please sign in to comment.