Closed rcgoodfellow closed 11 months ago
Now that these settings are stored in the bootstore, adding fields may be a little tricky - we'll probably have to chat with @andrewjstone about the best way to do that in a backwards-compatible way.
Now that these settings are stored in the bootstore, adding fields may be a little tricky - we'll probably have to chat with @andrewjstone about the best way to do that in a backwards-compatible way.
TLDR: Check the generation number of bootstore::NetworkConfig
and deserialize appropriately.
It shouldn't be bad at all. The bootstore transfers opaque blobs attached to generation numbers and chooses the higher of the two it sees. The main issue is that you need to check the generation number before you deserialize and ensure that all versions of sled-agent are updated before you add update the bootstore with the new field (at a new generation).
You'll probably have two different versions of EarlyNetworkConfig
and then a deserialize method that returns the right version based on the generation. This may also be wrapped in an enum. Alternatively, you could have one new version of EarlyNetworkConfig
with an optional new field, and then default that for the old generation.
This is really just a general upgrade issue and not related to bootstore specifically.
Fixed in #4564
https://github.com/oxidecomputer/omicron/blob/ed70f1c8c6a83fed0d6b5fed2ba6c033bdc18c5b/common/src/api/internal/shared.rs#L84-L100