Skip to content

Conversation

@zeeshanlakhani
Copy link
Collaborator

@zeeshanlakhani zeeshanlakhani commented Dec 23, 2025

Previously, each silo could only have one default IP pool. This change allows one default pool per (pool_type, ip_version) combination, enabling silos to have separate defaults for:

  • Unicast IPv4
  • Unicast IPv6
  • Multicast IPv4
  • Multicast IPv6

This work previously branched off #9451, but is now off main, NOT involving changes that have to do with the mcast lifecycle work. This supersedes #9452.

Includes:

  • Each default can now be set or unset and demoted independently. Unsetting the unicast IPv4 default does not affect the multicast IPv4 default, for example.
  • Add pool_type and ip_version columns to ip_pool_resource (denormalized from parent ip_pool for unique index)
  • Replace unique index with partial index on (resource_id, pool_type, ip_version) WHERE is_default = true
  • Rename IpPoolResourceLink to IncompleteIpPoolResource to reflect that pool_type/ip_version are actually populated by the linking query
  • Add ip_version field to API params for default pool disambiguation
  • API versioning for backwards compatibility with older clients

@zeeshanlakhani zeeshanlakhani force-pushed the zl/multiple-default-pools branch from 7f3a5b6 to 661d029 Compare December 23, 2025 18:13
Previously, each silo could only have one default IP pool. This change
allows one default pool per (pool_type, ip_version) combination, enabling
silos to have separate defaults for:

  - Unicast IPv4
  - Unicast IPv6
  - Multicast IPv4
  - Multicast IPv6

This work previously branched off #9451, but is now off `main`,
involving changes that have to do with the mcast lifecycle changes.

Includes:

  - Each default can now be set or unset and demoted independently.
    Unsetting the unicast IPv4 default does not affect the multicast IPv4
    default, for example.
  - Add `pool_type` and `ip_version` columns to `ip_pool_resource`
    (denormalized from parent `ip_pool` for unique index)
  - Replace unique index with partial index on (resource_id, pool_type,
    ip_version) WHERE is_default = true
  - Rename `IpPoolResourceLink` to `IncompleteIpPoolResource` to reflect
    that pool_type/ip_version are actually populated by the linking query
  - Add `ip_version` field to API params for default pool disambiguation
  - API versioning for backwards compatibility with older clients
@zeeshanlakhani
Copy link
Collaborator Author

FYI, even without the implicit lifecycle work, this still has mcast changes (as mcast is on main). I'm pinging @rcgoodfellow and @internet-diglett to take a look-see. I'll update #9450 (and its stacked set of PRs) once this is reviewed and merged accordingly, as I know @bnaecker needs this ASAP for the V6 work.

Copy link
Collaborator

@bnaecker bnaecker left a comment

Choose a reason for hiding this comment

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

Thanks for splitting this out! Seems pretty straightforward to me, just a couple of quick questions.

&instance_lookup,
ip_to_create.into_inner().pool,
pool,
ip_version,
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems like somewhere we want to fail if you provide an IP version and a pool, and the version you gave doesn't match the version of the pool. Is that the case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need to add this match check, good point.

-- IPv6, preparing the schema for future multicast support.

-- Drop the old single-default constraint
DROP INDEX IF EXISTS omicron.public.one_default_ip_pool_per_resource;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not certain that it matters, but we have generally had only one statement per SQL update file. I'd probably split these and the contents of up03.sql into two files.

@bnaecker
Copy link
Collaborator

@zeeshanlakhani Let me know if you need anything else here. I'd really like to get this merged so we can move forward on the IPv6 integration work.

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.

3 participants