Skip to content

bootstore needs a type versioning story #9801

Closed

Description

@jgallagher

This originally came up in the last few days before cutting R18 on #9570 (comment), where we needed to make changes to types stored in the bootstore and got extremely lucky that the changes we needed to make were all wire-compatible with the old types (specifically: changing Ipv4Addr-like types to IpAddr-like types, and changing required fields to Options). But this highlighted that we need a coherent story about how to make non-backwards-compatible changes. We discussed this during the update watercooler on Feb 3, and came up with this tentative plan:

  • Pull the bootstore types out of omicron-common and into their own RFD 619-style crate. The exact organization here is TBD, because these types are pretty varied: some - like RackNetworkConfig - are only used in the bootstore and the lockstep-as-of-ipv6 e2e integration #9570 bootstrap-agent-api, but contain types that are used in the sled-agent API or the Nexus external API or both. (This is why they've been in omicron-common this whole time.)
  • Change the deserialization of EarlyNetworkConfig to be two-pass, where the first pass reads the schema_version and the second pass reads the body as the appropriate version of EarlyNetworkConfigBody (based on schema_version).
  • Add tests that ensure if a new version is made to the bootstore types crate, we update the parsing of EarlyNetworkConfig. (We do something similar for the on-disk-serialized OmicronSledConfigs inside sled-agent-config-reconciler, although there we don't have the schema_version envelope and really should.) This relies on the existing dropshot / OpenAPI tooling keeping us honest w.r.t. only making changes to the bootstore types by adding new versions; this may require creating a "dummy" server API to cover any types that aren't covered by existing versioned APIs.

The urgency on this is pretty high; as noted above we got quite lucky that we didn't need to do this work for R18, and we really want to have all of this in place before we need to make any more changes to any of the types kept in the bootstore.

Activity

  1. jgallagher commented on Feb 23, 2026

    @jgallagher
    ContributorAuthor

    Starting to look around to get the lay of the land of these types; just putting some notes here. The serialized blob kept in the bootstore contains the top-level container types EarlyNetworkConfig and EarlyNetworkConfigBody. Both of these live in the sled-agent types crate and only used in one OpenAPI spec (sled-agent). Transitively, though, they contain most of the types that currently live under common::api::internal::shared::rack_init:

    • BfdPeerConfig
    • BgpConfig
    • BgpPeerConfig
    • LldpAdminStatus
    • LldpPortConfig
    • MaxPathConfig
    • RackNetworkConfig
    • PortConfig
    • PortFec
    • PortSpeed
    • RouteConfig
    • RouterLifetimeConfig
    • SwitchLocation
    • TxEqConfig
    • UplinkAddressConfig

    and a couple types defined in common::api::external:

    • BfdMode
    • ImportExportPolicy

    There are 23 types currently under common::api::internal::shared::rack_init. Of the 15 listed above, here are the OpenAPI uses of them:

    Used by bootstrap lockstep, nexus lockstep, sled-agent:

    • PortConfig (there is also a PortConfig in the gateway API, but it's
      a different kind of port config)
    • RouterLifetimeConfig

    Used by bootstrap lockstep, nexus lockstep, sled-agent, wicketd lockstep:

    • RackNetworkConfig

    Used by bootstrap lockstep, nexus lockstep, bootstrap (not latest), sled-agent:

    • BfdPeerConfig

    Used by bootstrap lockstep, nexus lockstep, wicketd lockstep, bootstrap (not latest), sled-agent:

    • LldpAdminStatus
    • LldpPortConfig
    • PortFec
    • PortSpeed
    • UplinkAddressConfig

    Used by bootstrap lockstep, nexus lockstep, nexus external, bootstrap (not latest), sled-agent:

    • BgpPeerConfig
    • SwitchLocation

    Used by bootstrap lockstep, nexus lockstep, nexus external, wicketd lockstep, sled-agent:

    • MaxPathConfig

    Used by bootstrap lockstep, nexus lockstep, nexus external, wicketd lockstep, bootstrap (not latest), sled-agent:

    • BgpConfig
    • RouteConfig
    • TxEqConfig

    The remaining 8 types under common::api::internal::shared::rack_init that are not stored in the bootstore are:

    Used by only nexus lockstep:

    • ExternalPortDiscovery

    Used by only sled-agent:

    • HostPortConfig
    • SwitchPorts

    Not used in any openapi specs (only impls):

    • MaxPathConfigError
    • ParseLldpAdminStatusError
    • ParseSwitchLocationError
    • RouterLifetimeConfigError
    • UplinkAddressConfigError

    The two types stored in the bootstore but living in common::api::external are also used by multiple APIs:

    Used by bootstrap lockstep, nexus lockstep, nexus external, bootstrap (not latest), sled-agent:

    • BfdMode
    • ImportExportPolicy
  2. jgallagher commented on Feb 23, 2026

    @jgallagher
    ContributorAuthor

    Used by only nexus lockstep:

    • ExternalPortDiscovery

    Used by only sled-agent:

    • HostPortConfig
    • SwitchPorts

    Moving these out to their respective types crates might be some very low hanging fruit. Will look at this shortly.

  3. self-assigned this
    on Feb 23, 2026
  4. jgallagher commented on Feb 23, 2026

    @jgallagher
    ContributorAuthor

    @sunshowers and I chatted about this at today's update watercooler. Tentative plan:

    • Continue the previous comment - move the types that are already used in only one API to a more specific location.
    • For types used in the external API, define duplicate types that are specific to the external API. (Fine to implement From conversions in both directions, but allows them to diverge over time if needed. @internet-diglett also suggested this while we were in the midst of landing ipv6 e2e integration #9570.)
    • Move most of the remaining types out of common and into sled_agent_types::early_networking: this is consistent with EarlyNetworkingConfig, the top-level container for the bootstore, and the other OpenAPI servers that use all of these types either already depend on sled-agent-types (Nexus, bootstrap-agent) or it's fine to add it (wicketd).

    After that's done, we should be able to fix up the way we version, test, and deserialize EarlyNetworkingConfig all within the sled-agent family of crates.

  5. added a commit that references this issue on Mar 7, 2026
    78f8995
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions