Skip to content

Conversation

jgallagher
Copy link
Contributor

This allows us to break the crate dependency sled-agent-zone-images has on sled-agent-config-reconciler, which will allow us to introduce a dependency in the other direction (needed to address #8463 and implement various mupdate-override-related things).

I changed all the IdMaps involved to iddqd::IdOrdMap, which also allowed dropping some extra ID wrapper types that introduced cheaply-cloneable keys, since IdOrdMap allows borrowed keys. ❤️

@jgallagher jgallagher requested a review from sunshowers July 1, 2025 20:07
Comment on lines -260 to +268
/// disk properties (e.g., as created by `Self::fake_static()`). It is also
/// only exposed to this crate; external callers should only operate on the
/// view provided by `InternalDisks`. Internal-to-this-crate callers should
/// take care not to hold the returned reference too long (as this keeps the
/// watch channel locked).
pub(crate) fn borrow_and_update_raw_disks(
/// disk properties (e.g., as created by `Self::fake_static()`).
///
/// This method is very low-level and should only be used by
/// sled-agent-config-reconciler's inner workings. Other sled-agent
/// consumers should not use this method and should prefer operating on the
/// `InternalDisks` returned by `current()`.
///
/// Callers should take care not to hold the returned reference too long (as
/// this keeps the watch channel locked).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only change I don't love; this was pub(crate), and it would've been nice to keep it restricted to only the config reconciler. Not the end of the world, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine -- maybe change the name to have internal in it or something.

Copy link
Contributor

@sunshowers sunshowers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Comment on lines +32 to +34
sled-hardware.workspace = true
sled-hardware-types.workspace = true
sled-storage.workspace = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah crap, this does introduce a libnvme.so.1 dependency to sled-agent-types, sorry...

One option is to move it to sled-storage, next to Disk. Another is to have a separate "sled-agent-storage-types" crate.

@jgallagher
Copy link
Contributor Author

jgallagher commented Jul 2, 2025

You mentioned this in chat:

Oh also ResolverStatus already lives in sled-agent-types though I might be misunderstanding what you meant

and wow I don't know how I missed that. I'm not sure any of this work is necessary; I think from the config-reconciler's point of view, all it wants is a way to ask sled-agent for the current ResolverStatus. Since that type is already available concretely via sled-agent-types, I think I can add a method to the existing SledAgentFacilities trait to return it, and not introduce any new inter-crate deps at all.

Lemme give that a whirl and see if I can close this altogether. If not, yeah moving this to sled-storage seems very reasonable.

@jgallagher
Copy link
Contributor Author

Lemme give that a whirl and see if I can close this altogether. If not, yeah moving this to sled-storage seems very reasonable.

I don't think we need this at all. That might change when we incorporate the mupdate override / config-reconciler, but I think it's unlikely. (#8514 introduces the first integration point without needing any of this.)

@jgallagher jgallagher closed this Jul 2, 2025
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