Skip to content

Commit aba9596

Browse files
committed
comments
1 parent 900f09c commit aba9596

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

nexus/db-model/src/affinity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// License, v. 2.0. If a copy of the MPL was not distributed with this
33
// file, You can obtain one at https://mozilla.org/MPL/5.0/.
44

5-
// Copyright 2024 Oxide Computer Company
5+
// Copyright 2025 Oxide Computer Company
66

77
//! Database representation of affinity and anti-affinity groups
88

schema/crdb/dbinit.sql

+8-3
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,15 @@ CREATE TABLE IF NOT EXISTS omicron.public.sled_resource (
245245
kind omicron.public.sled_resource_kind NOT NULL,
246246

247247
-- The UUID of an instance, if this resource belongs to an instance.
248+
--
249+
-- This should eventually become NOT NULL for all instances, but is
250+
-- still nullable for backwards compatibility purposes. Specifically,
251+
-- the "instance start" saga can create rows in this table before creating
252+
-- rows for "omicron.public.vmm", which we would use for back-filling.
253+
-- If we tried to backfill + make this column non-nullable while that saga
254+
-- was mid-execution, we would still have some rows in this table with nullable
255+
-- values that would be more complex to fix.
248256
instance_id UUID
249-
250-
-- TODO Add constraint that if kind is instance, instance_id is not NULL?
251-
-- Or will that break backwards compatibility?
252257
);
253258

254259
-- Allow looking up all resources which reside on a sled

0 commit comments

Comments
 (0)