Skip to content
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

sled agent: remove unused migration-related types #2755

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

gjcolombo
Copy link
Contributor

Tidy up the migration-related types in sled agent's Nexus API. This is just a bit of pre-work to reduce the size of subsequent commits that change this API.

In sled-agent/src/params.rs:

  • Rename migration-related types so that they indicate whether they're used with migration sources or migration targets (without having to look at their fields' names).
  • Remove types and variants that were only used for migration sources.
    • Remove InstanceRuntimeStateRequested and replace it with InstanceStateRequested.
    • Remove the Migrating variant from InstanceStateRequested.

Sled agent does need an API that allows Nexus to set an instance's migration ID, but this doesn't (won't) actually change any Propolis state or user-visible instance state, so subsequent changes will implement this in a separate API.

Clean up the call sites that are affected by this change. For now, just add todo!()s and comment out the Nexus call sites that use migration types that were removed here. These will be replaced in subsequent commits that create sled agent's new migration APIs.

Tidy up the migration-related types in sled agent's Nexus API. This is just a
bit of pre-work to reduce the size of subsequent commits that change this API.

In `sled-agent/src/params.rs`:

- Rename migration-related types so that they indicate whether they're used with
  migration sources or migration targets (without having to look at their
  fields' names).
- Remove types and variants that were only used for migration sources.
  - Remove `InstanceRuntimeStateRequested` and replace it with
    `InstanceStateRequested`.
  - Remove the `Migrating` variant from `InstanceStateRequested`.

Sled agent does need an API that allows Nexus to set an instance's migration ID,
but this doesn't (won't) actually change any Propolis state or user-visible
instance state, so subsequent changes will implement this in a separate API.

Clean up the call sites that are affected by this change. For now, just add
`todo!()`s and comment out the Nexus call sites that use migration types that
were removed here. These will be replaced in subsequent commits that create
sled agent's new migration APIs.
Copy link
Contributor

@luqmana luqmana left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup!

@@ -1297,7 +1292,7 @@ async fn sic_instance_ensure(
&opctx,
&authz_instance,
&db_instance,
runtime_params,
InstanceStateRequested::Running,
Copy link
Contributor

Choose a reason for hiding this comment

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

Love to see the simplification!

@gjcolombo
Copy link
Contributor Author

Thanks for reviewing, @luqmana!

@smklein @jordanhendricks - since this PR is one of the smaller, less impactful ones in this sequence, I'm going to go ahead and merge it to unblock its considerably larger successor. The bits of code that this PR removed will come back in a different form in future PRs, so there should still be plenty of room for us to discuss the final shape of the sled agent/Nexus API.

@gjcolombo gjcolombo merged commit 4e172d0 into main Apr 4, 2023
@gjcolombo gjcolombo deleted the gjcolombo/lets-migrate/2-sled-agent-state-params branch April 4, 2023 19:58
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