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

IncompleteNetworkInterface: allow user-specified explicit slot #5065

Merged
merged 6 commits into from
Feb 15, 2024

Conversation

jgallagher
Copy link
Contributor

This makes a several minor changes to plumb slots through:

  • IncompleteNetworkInterface now stores an optional slot, just like it stores an optional IP/MAC address
  • In network_interfaces::InsertQuery, if the incoming slot is set, we use it directly instead of running the NextItem-based subquery
  • Adds a partial index to ensure uniqueness of a slot within a single parent_id (I believe this is correct, but would love confirmation from someone more familiar!)
  • IncompleteNetworkInterface::new_service() now takes a non-optional IP, MAC address, and slot. This matches how it was called in all non-test code.
  • Tweaked the Nexus internal API used for RSS handoff to include the slot in the description of NICs.

This is a partial fix for #5056, and should produce correct behavior on new systems that run through RSS, even without a fix for #5055 (because we bypass NextItem altogether with this change). In particular, I think this should unblock testing of #5045 on madrid / testbeds. It does not address the already-recorded-NICs-with-incorrect-slots on systems like dogfood; I'll take care of that in a subsequent PR.

Adds a (currently failing) test that this slot is respected for service
NIC insertions.
Also adds a partial index to ensure the same slot number is not reused
within a service or instance
@jgallagher jgallagher requested a review from bnaecker February 14, 2024 16:13
Copy link
Collaborator

@bnaecker bnaecker left a comment

Choose a reason for hiding this comment

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

Looks good, the tests are excellent!

nexus/db-model/src/network_interface.rs Outdated Show resolved Hide resolved
nexus/db-model/src/network_interface.rs Outdated Show resolved Hide resolved
nexus/db-queries/src/db/queries/network_interface.rs Outdated Show resolved Hide resolved
schema/crdb/34.0.0/up.sql Show resolved Hide resolved
@jgallagher jgallagher enabled auto-merge (squash) February 15, 2024 01:05
@jgallagher jgallagher merged commit 5176bb3 into main Feb 15, 2024
21 checks passed
@jgallagher jgallagher deleted the john/db-service-nic-explicit-slot branch February 15, 2024 19:12
jgallagher added a commit that referenced this pull request Feb 15, 2024
This is the second half of the fix for #5056. #5065 (already merged)
fixed _how_ we were getting service NICs with nonzero slot values, and
this PR adds a schema migration to apply a one-time fix to any existing
service NICs with nonzero slot values. This matters to the
Reconfigurator, because currently the NICs sled-agent thinks it has
don't match the NICs recorded in CRDB (differing only by slot number).

Closes #5056.
jgallagher added a commit that referenced this pull request Feb 15, 2024
This is the second half of the fix for #5056. #5065 (already merged)
fixed _how_ we were getting service NICs with nonzero slot values, and
this PR adds a schema migration to apply a one-time fix to any existing
service NICs with nonzero slot values. This matters to the
Reconfigurator, because currently the NICs sled-agent thinks it has
don't match the NICs recorded in CRDB (differing only by slot number).

Closes #5056.
jgallagher added a commit that referenced this pull request Feb 16, 2024
This is the second half of the fix for #5056. #5065 (already merged)
fixed _how_ we were getting service NICs with nonzero slot values, and
this PR adds a schema migration to apply a one-time fix to any existing
service NICs with nonzero slot values. This matters to the
Reconfigurator, because currently the NICs sled-agent thinks it has
don't match the NICs recorded in CRDB (differing only by slot number).

Closes #5056.
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