-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nexus] Avoid racing with sled expungement when inserting new physica…
…l disks (#5597) # Summary - Prevents control-plane physical disks from being creates on sleds that are expunged - Additionally cleans up retryable transaction errors from Diesel in `physical_disk_and_zpool_insert`. # Background As of #5506 , Nexus is responsible for adding new "control plane physical disks" to the system. It performs this action currently via a background task (see: https://github.com/oxidecomputer/omicron/blob/main/nexus/src/app/background/physical_disk_adoption.rs), though this may become a more explicit operation in the future, requiring explicit operator intervention. Either way, this implementation calls `physical_disk_and_zpool_insert` to create the control-plane object. As we have been discussing solutions to #5594 , we have discussed "verifying that for expunged sleds, all zones are expunged, and all physical disks are expunged". This is a property we'd like to uphold. Prior to this PR, it was technically possible to insert a physical disk at the moment sled expungement was also occurring. In this situation, we could have an expunged sled, with a non-expunged physical disk, which would be an invalid state. # Implementation This PR adds a check to the `physical_disk_and_zpool_insert` transaction that the sled-under-modification is not currently expunged. Additionally, it adds a test for this behavior. There are some semi-related changes to Diesel error propagation in this PR -- this needed cleanup anyway, but the gist of it is that we ensure this transaction can correctly push retryable diesel errors all the way up to the transaction handler that knows how to parse them.
- Loading branch information
Showing
6 changed files
with
144 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters