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

Cannot un-delete a disk with the same name #4673

Closed
jmpesp opened this issue Dec 11, 2023 · 0 comments · Fixed by #4681
Closed

Cannot un-delete a disk with the same name #4673

jmpesp opened this issue Dec 11, 2023 · 0 comments · Fixed by #4681
Assignees
Milestone

Comments

@jmpesp
Copy link
Contributor

jmpesp commented Dec 11, 2023

Disks for which their delete saga unwound prior to the fixes in #4547 would be "phantom" disks: they would be soft-deleted but would consume virtual resources and count towards quotas. If the user created a disk with the same name after attempting to delete the original disk, this new disk would prevent the phantom disk from being un-deleted due to the constraint that disk names within a project must be unique:

CREATE UNIQUE INDEX IF NOT EXISTS lookup_disk_by_project ON omicron.public.disk (
    project_id,
    name
) WHERE
    time_deleted IS NULL;

As written today, the background task does not rename the disk, so the un-delete step would fail every time the background task is triggered.

Possible fixes:

  • rename the disk to something unique during un-deletion
  • trigger the disk delete saga instead of un-deleting the disk
@morlandi7 morlandi7 added this to the 5 milestone Dec 12, 2023
jmpesp added a commit to jmpesp/omicron that referenced this issue Dec 12, 2023
When un-deleting phantom disks and setting them to faulted, use a new
name that includes the disk's UUID: this ensures that even if a user
created another disk with the same name in the project, the phantom disk
can still be un-deleted and faulted, and eventually cleaned up.

Fixes oxidecomputer#4673
jmpesp added a commit that referenced this issue Dec 14, 2023
When un-deleting phantom disks and setting them to faulted, use a new
name that includes the disk's UUID: this ensures that even if a user
created another disk with the same name in the project, the phantom disk
can still be un-deleted and faulted, and eventually cleaned up.

Fixes #4673
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants