Following-up on @plotnick 's comment here, I think there may be some deeper issues with disk attaching / detaching.
Background
The following steps attempt to roughly map out the disk attach process:
Issues
- Between (2) and (3), other disks may be concurrently attached, bypassing the check. This is a TOCTTOU.
- Between (4) and (6a-1), the disk state may be modified before the sled agent request is made. This could result in the sled agent attaching a disk that has been deleted or attached to a different instance.
- Between (5) and (6), the instance state may be modified. The instance has a "state_generation" value for optimistic concurrency control, but it is not being checked / modified here.
Following-up on @plotnick 's comment here, I think there may be some deeper issues with disk attaching / detaching.
Background
The following steps attempt to roughly map out the disk attach process:
app/instance.rs- is invoked.Issues