Skip to content

[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

Merged
merged 6 commits into from
May 12, 2025

Conversation

jgallagher
Copy link
Contributor

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 via OmicronSledConfig.

@jgallagher jgallagher requested review from andrewjstone and smklein May 7, 2025 20:44
Base automatically changed from john/sled-agent-config-reconciler-internal-disks to main May 8, 2025 19:07
Comment on lines 307 to 319
// 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,
);
Copy link
Collaborator

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?

Copy link
Collaborator

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)

Copy link
Contributor Author

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

@jgallagher jgallagher merged commit 00d0a38 into main May 12, 2025
17 checks passed
@jgallagher jgallagher deleted the john/sled-agent-config-reconciler-external-disks branch May 12, 2025 20:44
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 this pull request may close these issues.

2 participants