oxidecomputer / oxidecomputer/omicron

Establish conventions for network resource primary keys in Nexus

Open
#3,013 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

In the resources added in #2645, we have defined a switch port settings resource:

CREATE TABLE omicron.public.switch_port_settings (
    id UUID PRIMARY KEY,
    name STRING(63) NOT NULL,
    description STRING(512) NOT NULL,
    time_created TIMESTAMPTZ NOT NULL,
    time_modified TIMESTAMPTZ NOT NULL,
    time_deleted TIMESTAMPTZ
);

The actual settings are in their own tables, with a composite primary key like so:

CREATE TABLE omicron.public.switch_port_settings_bgp_peer_config (
    port_settings_id UUID,
    bgp_announce_set_id UUID NOT NULL,
    bgp_config_id UUID NOT NULL,
    interface_name TEXT,
    addr INET,

    PRIMARY KEY (port_settings_id, interface_name, addr)
);

A question raised during code review was whether or not the settings should also have their own id column (UUID) as the primary key, instead of a composite primary key. This issue was created for discussing this and tracking subsequent work if necessary.

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 by reviewing the switch_port_settings and switch_port_settings_bgp_peer_config schema examples in the issue, then inspect the resources added in #2645. Determine whether network resource settings should use UUID primary keys or composite keys, and document the agreed convention plus any follow-up changes needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.