-
Notifications
You must be signed in to change notification settings - Fork 45
[sled-agent-config-reconciler] Flesh out ExternalDisks
type
#8111
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
[sled-agent-config-reconciler] Flesh out ExternalDisks
type
#8111
Conversation
733eddb
to
4a56c9c
Compare
sled-agent/config-reconciler/src/reconciler_task/external_disks.rs
Outdated
Show resolved
Hide resolved
// Take ownership of our current disk state (if we have one), then | ||
// immediately put back the new state. | ||
let maybe_current = self.disks.remove(&config.id); | ||
self.disks.insert( | ||
self.try_ensure_disk_managed( | ||
maybe_current, | ||
config, | ||
raw_disk, | ||
disk_adopter, | ||
log, | ||
) | ||
.await, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that "disk adoption" might involve creating partitions on the underlying disks, it seems like it might be nice to do this operation concurrently?
This appears to currently be:
- Take out the Option for the disk
- Call "try_ensure_disk_managed" to transform that state (or create it, if it was None)
- Put that state back into
self.disks
Each operation seems to be acting on independent parts of self.disks
, and I don't think the disk_adopter
actually needs mutability. WDYT about doing this concurrently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I care less about this in the removal path, because that's significantly cheaper)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, straightforward enough! Good call, done in d4e915d
Staged on top of #8103, and is pretty similar to it. The biggest difference is that #8103 adds a tokio task responsible for adopting internal disks automatically, and this adds an
ExternalDisks
type that will be used by the reconciler task to adopt external disks only when asked to viaOmicronSledConfig
.