oxidecomputer / oxidecomputer/omicron

Deletion of switch port settings is incomplete and leaves Nexus confused

Open
#9,988 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

While doing an unrelated test on dublin, I created a dummy link and switch port settings for switch 1, qsfp 3 via the CLI:

% oxide system networking link add --rack c88542d0-b11f-44a7-939c-9444db5d8dd5 --switch switch1 --port qsfp3 --speed 100g
% oxide system hardware switch-port apply-settings --rack-id c88542d0-b11f-44a7-939c-9444db5d8dd5 --switch-location switch1 --port qsfp3 --port-settings switch1-qsfp3
% oxide system networking switch-port-settings list
[
  {
    "description": "initial uplink configuration",
    "id": "64ca3018-19a8-4425-a189-06e80708c58e",
    "name": "default-uplink0",
    "time_created": "2026-03-06T13:58:12.541313Z",
    "time_modified": "2026-03-06T13:58:12.541313Z"
  }, {
    "description": "initial uplink configuration",
    "id": "4e947e91-4a65-4036-bfdb-3a6523923487",
    "name": "default-uplink1",
    "time_created": "2026-03-06T13:58:12.811138Z",
    "time_modified": "2026-03-06T13:58:12.811138Z"
  }, {
    "description": "",
    "id": "d4a022b9-7760-482c-9501-746942e0183a",
    "name": "switch1-qsfp3",
    "time_created": "2026-03-06T16:02:04.498730Z",
    "time_modified": "2026-03-06T16:02:04.498730Z"
  }
]

Then I tried to delete the new settings, which appeared to work:

% oxide system networking switch-port-settings delete --port-settings d4a022b9-7760-482c-9501-746942e0183a
% oxide system networking switch-port-settings list
[
  {
    "description": "initial uplink configuration",
    "id": "64ca3018-19a8-4425-a189-06e80708c58e",
    "name": "default-uplink0",
    "time_created": "2026-03-06T13:58:12.541313Z",
    "time_modified": "2026-03-06T13:58:12.541313Z"
  }, {
    "description": "initial uplink configuration",
    "id": "4e947e91-4a65-4036-bfdb-3a6523923487",
    "name": "default-uplink1",
    "time_created": "2026-03-06T13:58:12.811138Z",
    "time_modified": "2026-03-06T13:58:12.811138Z"
  }
]

However, a new RackNetworkConfig was not pushed to sled-agent as a result of this operation. Looking at the Nexus logs, the sync_switch_configuration bg task was emitting this warning:

16:26:25.373Z ERRO e89b2e91-5645-45c2-b76d-4eaa4ce8b364 (ServerContext): failed to get switch port settings
    background_task = switch_port_config_manager
    error = Object (of type ById(d4a022b9-7760-482c-9501-746942e0183a)) not found: switch-port-settings
    file = nexus/src/app/background/tasks/sync_switch_configuration.rs:216
    rack_id = c88542d0-b11f-44a7-939c-9444db5d8dd5
    switch_port_settings_id = d4a022b9-7760-482c-9501-746942e0183a
16:26:25.373Z ERRO e89b2e91-5645-45c2-b76d-4eaa4ce8b364 (ServerContext): failed to generate changeset for switchport settings
    background_task = switch_port_config_manager
    error = {"error":"failed to get switch port settings: Object (of type ById(d4a022b9-7760-482c-9501-746942e0183a)) not found: switch-port-settings"}
    file = nexus/src/app/background/tasks/sync_switch_configuration.rs:426
    rack_id = c88542d0-b11f-44a7-939c-9444db5d8dd5

It looks like it's trying to look up the settings we deleted. I think that's because the switch_port table still refers to it:

root@[fd0d:afdc:bd0e:103::3]:32221/omicron> select * from switch_port where switch_location = 'switch1' and port_name = 'qsfp3';
                   id                  |               rack_id                | switch_location | port_name |           port_settings_id
---------------------------------------+--------------------------------------+-----------------+-----------+---------------------------------------
  9bf5c56b-4fcc-48ef-81b2-78fe852860e1 | c88542d0-b11f-44a7-939c-9444db5d8dd5 | switch1         | qsfp3     | d4a022b9-7760-482c-9501-746942e0183a
(1 row)

even though it's not present in switch_port_settings:

root@[fd0d:afdc:bd0e:103::3]:32221/omicron> select * from switch_port_settings;
                   id                  |      name       |         description          |         time_created          |         time_modified         | time_deleted
---------------------------------------+-----------------+------------------------------+-------------------------------+-------------------------------+---------------
  4e947e91-4a65-4036-bfdb-3a6523923487 | default-uplink1 | initial uplink configuration | 2026-03-06 13:58:12.811138+00 | 2026-03-06 13:58:12.811138+00 | NULL
  64ca3018-19a8-4425-a189-06e80708c58e | default-uplink0 | initial uplink configuration | 2026-03-06 13:58:12.541313+00 | 2026-03-06 13:58:12.541313+00 | NULL
(2 rows)

(Is it surprising it was hard deleted from switch_port_settings when we have a time_deleted column? The latter implies we'd soft delete.)

At a surface level, I think deleting a switch_port_settings row also needs to clear the fake-foreign-key in switch_port. But happy to defer to others with more expertise - there's a lot going on here that for which I don't have context.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with nexus/src/app/background/tasks/sync_switch_configuration.rs, especially the reported lines around 216 and 426, then trace deletion of switch-port settings and the switch_port reference. Reproduce the CLI sequence and verify that deleting settings no longer leaves a missing reference; done means a new RackNetworkConfig is pushed to sled-agent without the Nexus warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.