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

link fec is now an optional setting #6992

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

link fec is now an optional setting #6992

wants to merge 1 commit into from

Conversation

Nieuwejaar
Copy link
Contributor

We no longer require that FEC be specified when creating a new link, instead letting dendrite choose a default value based on the transceiver type. This PR adapts to that change in the dendrite API and allows a NULL FEC value to be persisted to the database.

port_settings_id UUID,
link_name TEXT,
mtu INT4,
port_settings_id UUID NOT NULL,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes aren't strictly related to the FEC part of this PR. These fields should always have been NOT NULL, and that oversight came to light when I realized that the fec field was already nullable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to split this into two PRs? Marking the "rust side" of things as Nullable is an easy change to approve, but altering these columns to be non-NULL is a more involved change

Comment on lines +1 to +3
ALTER TABLE omicron.public.switch_port_settings_link_config ALTER COLUMN speed SET NOT NULL;
ALTER TABLE omicron.public.switch_port_settings_link_config ALTER COLUMN mtu SET NOT NULL;
ALTER TABLE omicron.public.switch_port_settings_link_config ALTER COLUMN port_settings_id SET NOT NULL;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks a lot like https://github.com/oxidecomputer/omicron/tree/main/schema/crdb#211-adding-a-new-column-without-a-default-value -- if there are any databases which exist, where any of these values are NULL, then we'd fail to apply the schema upgrade and the rack would be stuck.

  1. Are we confident that these are non-NULL across all deployments? Why?
  2. Could we use a default value here, in the case that there are NULL values?

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