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

Drop the service table #5287

Merged
merged 31 commits into from
Apr 16, 2024
Merged

Drop the service table #5287

merged 31 commits into from
Apr 16, 2024

Conversation

jgallagher
Copy link
Contributor

I still need to test this on madrid and I do not want to merge it before we cut the next release, but I believe this is ready for review.

Related changes / fallout also included in this PR:

  • omdb db services ... subcommands are all gone. I believe this functionality is covered by omdb's inspection of blueprints instead.
  • I removed the SledResourceKind::{Dataset,Service,Reserved} variants that were unused. This isn't required, strictly speaking, but SledResourceKind::Service was intended to reference the service table, so I thought it was clearer to drop these for now (we can add them back when we get to the point of using them).

There are two major pieces of functionality that now require systems to have a current target blueprint set:

  • DataStore::nexus_external_addresses() now takes an explicit Blueprint instead of an Option<Blueprint>. Its callers (silo creation and reconfigurator DNS updates) fail if they cannot read the current target blueprint.
  • DataStore::vpc_resolve_to_sleds() now implicitly requires a target blueprint to be set, if and only if the VPC being queried involves control plane services. (In practice today, that means the VPC ID is exactly SERVICES_VPC_ID, although in the future we could have multiple service-related VPCs.) I didn't want to make this method take an explicit blueprint, because I think its most frequent callers are specifying instance VPCs, which do not need to access the blueprint.

These two together mean that deploying this change to a system without a target blueprint will result in (a) the inability to create silos or update external DNS via reconfigurator and (b) services (including Nexus) will not get the OPTE firewall rules they need to allow incoming traffic. All newly-deployed systems have a (disabled) blueprint set as of #5244, but we'll need to perform the necessary support operation to bring already-deployed systems in line.

Closes #4947.

Copy link
Collaborator

@smklein smklein left a comment

Choose a reason for hiding this comment

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

Looks great, happy to see this much code removed

schema/crdb/dbinit.sql Show resolved Hide resolved
schema/crdb/46.0.0/up2.sql Outdated Show resolved Hide resolved
@smklein smklein removed their assignment Mar 19, 2024
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.

requesting changes only for the schema stuff

nexus/db-queries/src/db/datastore/rack.rs Show resolved Hide resolved
nexus/db-queries/src/db/datastore/vpc.rs Outdated Show resolved Hide resolved
schema/crdb/46.0.0/up3.sql Outdated Show resolved Hide resolved
schema/crdb/46.0.0/up5.sql Outdated Show resolved Hide resolved
@sunshowers
Copy link
Contributor

We discussed this in #oxide-update, and we're going to change it so that we'll update the internal DB tracking of schema versions after each individual file gets applied, not just after each directory. So folks in the future won't have to try and reason about idempotency across multiple files. (They will still have to think about idempotency for each individual file, but hopefully that will be much easier to reason about.)

@jgallagher
Copy link
Contributor Author

This is caught up with main which now includes #5293, so I believe it's okay to leave all these migrations in one major version / directory now.

Copy link
Collaborator

@davepacheco davepacheco left a comment

Choose a reason for hiding this comment

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

Great!

In #4947 I wrote:

Given that, I think we can just drop the services table altogether. There is only one thing that uses it as far as I know, and that's DNS propagation.

Boy did that turn out to be wrong. Sorry!

dev-tools/omdb/tests/successes.out Show resolved Hide resolved
@@ -873,20 +873,6 @@ table! {
}
}

table! {
Copy link
Collaborator

Choose a reason for hiding this comment

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

🎉 🎉 🎉

@@ -100,7 +100,14 @@ impl super::Nexus {
.blueprint_target_get_current_full(opctx)
.await
.internal_context("loading target blueprint")?;
let target = target_blueprint.as_ref().map(|(_, blueprint)| blueprint);
let target = target_blueprint
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we want to have blueprint_target_get_current_full() return this 500 itself now that we expect all systems to have a target blueprint.

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 had more knock-on effects than I expected, but I think basically all positive: 78f9429

schema/crdb/drop-service-table/up7.sql Outdated Show resolved Hide resolved
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.

Awesome!

@jgallagher jgallagher merged commit 0c10e06 into main Apr 16, 2024
21 checks passed
@jgallagher jgallagher deleted the john/remove-service-table branch April 16, 2024 17:21
jgallagher added a commit that referenced this pull request Apr 17, 2024
#5287 got rid of `omdb db services ...`, so I've found myself wanting to
see the current target blueprint. omdb can do that, but it required
listing the blueprints, visually finding the target, then calling `nexus
blueprints show <ID>`. With this PR, we can accept the string
`current-target` instead, and I figured that might also be useful in
diffs (e.g., `nexus blueprints diff current-target <SOME_ID>` to see
changes from the current target to some other blueprint).
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.

retire "services" table
4 participants