oxidecomputer / oxidecomputer/propolis
server: consider delegating migration payload logging to individual components
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 270
- Forks
- 42
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 6
Description
The migration destination runner logs the entire serialized device state payload it got from the source: https://github.com/oxidecomputer/propolis/blob/220a6f367c18f2452dbc4fa9086f3fe73b961739/bin/propolis-server/src/lib/migrate/destination.rs#L483-L495
Depending on exactly what devices are attached and how they're configured, this message may include tens of kilobytes of serialized state, e.g. repeated messages about MSI-X interrupts that are allocated to a particular device but aren't currently in use.
It would be nice to have the migration logic log only top-level information about the component payloads it received--the component name, the kinds/versions of the payloads, and maybe the lengths of those payloads--and delegate the logging of the actual payloads to the components themselves. Then the components can deserialize the data and decide whether and how they'd like to log it.
Note that not all components have ready access to a slog::Logger when they're importing device state, so we'll need to do some plumbing to make sure they have access to one (either by adding a Logger to the relevant component structures or updating the MigrateSingle/MigrateMulti traits to supply one).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in bin/propolis-server/src/lib/migrate/destination.rs around lines 483-495, then inspect the MigrateSingle and MigrateMulti traits and the component import paths. Determine how to log only component names, payload kinds or versions, and lengths at the destination while making a logger available during component deserialization. Done means the runner no longer logs full serialized payloads and components can control their own payload logging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100