oxidecomputer / oxidecomputer/omicron

VPC router routes can have duplicate destinations

Open
#10,352 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I don't know if this is actually a problem — I have an ancient todo list item saying to create an issue about it, presumably from when we implemented the relevant page in the console.


A user can create two custom routes in the same VPC router with the same destination but different targets, as long as the names differ. The DB only enforces uniqueness on (vpc_router_id, name):

https://github.com/oxidecomputer/omicron/blob/f960aad7dc49079424eed99094e5621b093801bd/schema/crdb/dbinit.sql#L2137-L2173

router_create_route_on_connection doesn't check for an existing route with the same destination:

https://github.com/oxidecomputer/omicron/blob/f960aad7dc49079424eed99094e5621b093801bd/nexus/db-queries/src/db/datastore/vpc.rs#L1862-L1889

Downstream, routes get pushed to OPTE as a HashSet<ResolvedVpcRoute> where ResolvedVpcRoute is { dest, target }:

https://github.com/oxidecomputer/omicron/blob/f960aad7dc49079424eed99094e5621b093801bd/common/src/api/internal/shared/mod.rs#L123-L130

https://github.com/oxidecomputer/omicron/blob/f960aad7dc49079424eed99094e5621b093801bd/nexus/src/app/background/tasks/vpc_routes.rs#L326-L337

Two routes with identical (dest, target) get deduped, but two routes with the same dest and different target both end up in the set.

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 schema/crdb/dbinit.sql, router_create_route_on_connection in nexus/db-queries/src/db/datastore/vpc.rs, and the ResolvedVpcRoute and VPC route task code linked in the issue. Trace how duplicate destinations reach OPTE and identify the expected handling for different targets. Done means the behavior is defined and consistently enforced or handled, with coverage for duplicate destinations.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.