Skip to content
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

feat(volume/resize): don't allow volume resize for snapshot restore vols #777

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading