oxidecomputer / oxidecomputer/omicron

destroy_virtual_hardware.sh does not notice when it fails to delete zpools

Open
#3,711 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

development
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

+ for ZPOOL in "${ZPOOLS[@]}"
+ VDEV_FILE=/home/dap/omicron/oxi_b462a7f7-b628-40fe-80ff-4e4189e2d62b.vdev
+ zfs destroy -r oxi_b462a7f7-b628-40fe-80ff-4e4189e2d62b
+ zfs unmount oxi_b462a7f7-b628-40fe-80ff-4e4189e2d62b
cannot unmount 'oxi_b462a7f7-b628-40fe-80ff-4e4189e2d62b': not currently mounted
+ warn 'Failed to remove ZFS pool and vdev: oxi_b462a7f7-b628-40fe-80ff-4e4189e2d62b'
+ set +x
Failed to remove ZFS pool and vdev: oxi_b462a7f7-b628-40fe-80ff-4e4189e2d62b
+ success 'Verified ZFS pool and vdev oxi_b462a7f7-b628-40fe-80ff-4e4189e2d62b does not exist'
+ set +x
Verified ZFS pool and vdev oxi_b462a7f7-b628-40fe-80ff-4e4189e2d62b does not exist

In this case, it failed to remove the zpool (it wasn't mounted, probably because I'd rebooted the system?), but proceeded anyway. I believe the exit code was 0.

Here's the code:
https://github.com/oxidecomputer/omicron/blob/ebd3db27f6bbd08af3194cae84b0efc6b6e7248d/tools/destroy_virtual_hardware.sh#L110-L114

I guess it's maybe intentional that this was only a warning? I think it's misleading though. It took a few setup laps before I noticed the zpools weren't getting recreated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open tools/destroy_virtual_hardware.sh at lines 110-114 and trace the zpool deletion and verification path shown in the report. Reproduce the unmount or deletion failure case, then confirm the script returns a failure rather than reporting success when cleanup was not completed.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.