Skip to content

remove listen_addr requirement for rpw startup - #117

Merged
internet-diglett merged 8 commits into
mainfrom
relax-rpw-startup-requirements
Oct 4, 2025
Merged

internet-diglett merged 8 commits into
mainfrom
relax-rpw-startup-requirements

Conversation

@internet-diglett

@internet-diglett internet-diglett commented Sep 4, 2025 •

Copy link
Copy Markdown
Contributor

Required for oxidecomputer/omicron#8914

We were requiring non-localhost listen_addrs for NAT RPW startup, and there isn't really a good reason to do so (this may have just been a copy-paste thing). Requiring non-localhost listen addrs means that the RPW will never run in the omicron test suite, since the test suite exclusively uses localhost listen addrs.

We also allow the optional injection of mgs_addr so that we can get dendrite working properly in the test suite. Normally we can just listen on localhost:[MGS_PORT] but once again, the omicron test suite relies on randomized ports so it can run multiple tests in parallel, so we can't exclusively rely on that pattern if we want dendrite to work properly in the omicron test environment.

@internet-diglett
internet-diglett marked this pull request as ready for review September 30, 2025 17:18
@rcgoodfellow

Copy link
Copy Markdown
Collaborator

Initially I was a bit concerned about how this would interact with early networking. As this will result in the RPW starting up sooner. But it looks like we assign a non-localhost address in boot_switch_zone in sled agent, so we're already getting past this point by the time early networking config is being set up by sled agent. Is that your read @internet-diglett? I feel like we should take a racklette run with an omicron branch that pulls this commit in.

@internet-diglett

internet-diglett commented Oct 2, 2025 •

Copy link
Copy Markdown
Contributor Author

Initially I was a bit concerned about how this would interact with early networking. As this will result in the RPW starting up sooner. But it looks like we assign a non-localhost address in boot_switch_zone in sled agent, so we're already getting past this point by the time early networking config is being set up by sled agent. Is that your read @internet-diglett? I feel like we should take a racklette run with an omicron branch that pulls this commit in.

That sounds correct to me. If the RPW starts up before nexus is available, that should not be a big deal since it will sleep and retry again later.

At a high(er) level, I came to the conclusion that the RPW startup logic should not concern itself at all with the listen addresses for dendrite's API, since we have separate logic in place managing the listen addresses and SMF updates there, and the only information the RPW really requires to get started is the address to reach nexus on, which is provided upon startup or via DNS.

Overall, a racklette run sounds like a great confidence booster as well.

@internet-diglett

Copy link
Copy Markdown
Contributor Author

Sanity check on madrid:

root@BRM42220081:~# grep "workflow" /pool/ext/1310b4a6-576f-48b3-abaa-2bbc63fef7e1/crypt/debug/oxz_switch/oxide-dendrite:default.log.1759540735 | looker
00:02:14.238Z INFO dpd: starting workflow server
    unit = workflow_server
00:02:14.238Z DEBG dpd: no dns server found
    unit = workflow_server
00:02:14.238Z INFO dpd: waiting for smf update
    unit = workflow_server
00:02:17.551Z DEBG dpd: no dns server found
    unit = workflow_server
00:02:17.551Z INFO dpd: waiting for smf update
    unit = workflow_server
00:04:52.750Z INFO dpd: new DNS resolver
    addresses = [[fd00:1122:3344:1::1]:53, [fd00:1122:3344:2::1]:53, [fd00:1122:3344:3::1]:53]
    unit = workflow_server
00:04:52.789Z DEBG dpd: starting ipv4 nat reconciliation loop
    task = ipv4_nat
    unit = workflow_server
00:04:52.789Z DEBG dpd: starting ipv4 nat reconciliation
    task = ipv4_nat
    unit = workflow_server
00:04:52.789Z DEBG dpd: we are currently at ipv4 nat generation: 0
    task = ipv4_nat
    unit = workflow_server
00:04:52.789Z DEBG dpd: checking Nexus for updates
    task = ipv4_nat
    unit = workflow_server
00:04:52.789Z DEBG dpd (NexusClient): client request
    body = None
    method = GET
    unit = workflow_server
    uri = http://_nexus._tcp.control-plane.oxide.internal:12221/nat/ipv4/changeset/0?limit=100
00:04:52.789Z DEBG dpd: lookup_sockets_v6_raw srv
    dns_name = _nexus._tcp.control-plane.oxide.internal
    unit = workflow_server
00:05:07.793Z DEBG dpd (NexusClient): client response
    result = Err(reqwest::Error { kind: Request, url: "http://_nexus._tcp.control-plane.oxide.internal:12221/nat/ipv4/changeset/0?limit=100", source: hyper_util::clie
nt::legacy::Error(Connect, ConnectError("dns error", Resolve(ResolveError { kind: Proto(ProtoError { kind: Timeout }) }))) })
    unit = workflow_server

...

00:06:44.837Z DEBG dpd: starting ipv4 nat reconciliation
    task = ipv4_nat
    unit = workflow_server
00:06:44.837Z DEBG dpd: we are currently at ipv4 nat generation: 0
    task = ipv4_nat
    unit = workflow_server
00:06:44.837Z DEBG dpd: checking Nexus for updates
    task = ipv4_nat
    unit = workflow_server
00:06:44.837Z DEBG dpd (NexusClient): client request
    body = None
    method = GET
    unit = workflow_server
    uri = http://_nexus._tcp.control-plane.oxide.internal:12221/nat/ipv4/changeset/0?limit=100
00:06:44.837Z DEBG dpd: lookup_sockets_v6_raw srv
    dns_name = _nexus._tcp.control-plane.oxide.internal
    unit = workflow_server
01:16:09.005Z DEBG dpd (NexusClient): client response
    result = Ok(Response { url: "http://_nexus._tcp.control-plane.oxide.internal:12221/nat/ipv4/changeset/0?limit=100", status: 200, headers: {"content-type": "applic
ation/json", "x-request-id": "2fe89d0f-a757-476e-9b74-60ad46d4dea3", "content-length": "2", "date": "Sat, 04 Oct 2025 01:16:09 GMT"} })
    unit = workflow_server
01:16:09.005Z DEBG dpd: request successful
    response = []
    task = ipv4_nat
    unit = workflow_server
01:16:09.005Z DEBG dpd: no further updates found
    task = ipv4_nat
    unit = workflow_server

We can see that the rpw in dendrite waits until it gets an SMF update to build the nexus client, then when it tries to reach nexus before exus is up it gets a communication error and retries later, eventually running successfully once nexus is available.

@internet-diglett
internet-diglett merged commit 19e744e into main Oct 4, 2025
@internet-diglett
internet-diglett deleted the relax-rpw-startup-requirements branch October 4, 2025 01:46
internet-diglett added a commit to oxidecomputer/omicron that referenced this pull request Oct 8, 2025
…e is unresponsive (#8914)

This PR addresses two issues that impacts users in circumstances where a
switch zone is unavailable:

1. When resolving which switch slot is managed by which switch zone, we
would continuously retry whenever there was a communication error. This
causes RPWs to stop running / Sagas to get stuck whenever a switch zone
becomes unavailable but still has entries in DNS.

2. In the `dpd_ensure` node of the `instance_start` saga, we were
bailing out if we encountered any errors while notifying dpd of nat
changes. This means that in the event of one of our switch zones being
unavailable we would no longer allow users to start instances, which is
probably a bit too strict.

This PR makes the following adjustments to the switch slot resolution
behavior:

* Log an error instead of a warning whenever a DNS entry exists for a
switch zone service but communication fails
* Return the mappings of the Slot -> Address for the switch zones that
we were successfully able to resolve
* Let the caller decide whether or not they should retry or proceed.
After checking all of the current call sites, it appears that the logic
already accommodates scenarios where switch zone mappings are missing.

This PR makes the following changes to the behavior to the NAT
configuration steps for instance related sagas:
* Do not bail if we fail to notify a dendrite service of NAT changes.
Log a warning and rely on the NAT RPW to catch us back up whenever the
switch zone becomes available again. Still return a `Result` from the
`notify` function so that callers can decide if they want to make a
subsequent decision based on the error.

This PR makes the following changes to the behavior of NAT garbage
collection:
* Pause GC (exit early) if we detect that both switches cannot be
reached

Before now, due to a configuration issue, the instant start saga tests
weren't actually driving ensuring that NAT configurations were
eventually landing on the dendrite instances. It also turns out that
Nexus in the `TestContext` could not actually communicate with dendrite
because the port values were hard coded and our resolution logic relied
on comparing the different addresses for MGS (and all mgs instances
listen on localhost in testing). This PR introduces the following
changes:

* Use an updated version of Dendrite that allows us to provide a MGS
`SocketAddr` on startup so it can use a simulated MGS to learn switch
slot information
* Adjust the `TestContext` Builder logic to provide MGS information to
dendrite
* Have Nexus ask dendrite for its switch slot information instead of
having Nexus attempt to resolve it via MGS
* Change the test configuration to create a NIC for the instance so we
actually exercise the NAT creation logic in the `dpd_ensure` saga node
* Introduce a test that ensures we still land configurations on the
remaining switch even when one of our switches are unavailable

Related
---
#8206
#6896
#8999

Depends On
---
oxidecomputer/dendrite#117

---------

Co-authored-by: David Pacheco <[email protected]>
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