Skip to content

Commit

Permalink
chore(bors): merge pull request #777
Browse files Browse the repository at this point in the history
777: feat(volume/resize): don't allow volume resize for snapshot restore vols r=dsharma-dc a=dsharma-dc

If a volume is expanded after taking a snapshot or a restore created from that snapshot is expanded, 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 <diwakar.sharma@datacore.com>
  • Loading branch information
mayastor-bors and dsharma-dc committed Mar 8, 2024
2 parents 3f8ba43 + 9308b80 commit dd02e20
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions control-plane/agents/src/bin/core/volume/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,16 @@ 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.
// Pre-check - Don't allow resize if the volume has snapshots, or the volume is
// a snapshot restore volume.
// NOTE: This is temporary till the fix for handling this in spdk is done.
if !registry.specs().snapshots_by_vol(self.uuid()).is_empty() {
if !registry.specs().snapshots_by_vol(self.uuid()).is_empty()
|| spec.content_source.is_some()
{
return Err(SvcError::Internal {
details: "Volume can't be resized while it has snapshots".into(),
details:
"Volume can't be resized while it has snapshots, or it's a snapshot restore"
.into(),
});
}
// If the volume is published, then we need to resize nexus also along with replicas.
Expand Down

0 comments on commit dd02e20

Please sign in to comment.