It would be nice if we could rely on inventory for "datasets we observe", and the blueprint for "datasets we want to have".
There exists a dataset table that's kinda redundant with the blueprint information, but exists for historical reasons:
|
/* |
|
* A dataset of allocated space within a zpool. |
|
*/ |
|
CREATE TABLE IF NOT EXISTS omicron.public.dataset ( |
|
/* Identity metadata (asset) */ |
|
id UUID PRIMARY KEY, |
|
time_created TIMESTAMPTZ NOT NULL, |
|
time_modified TIMESTAMPTZ NOT NULL, |
|
time_deleted TIMESTAMPTZ, |
|
rcgen INT NOT NULL, |
|
|
|
/* FK into the Pool table */ |
|
pool_id UUID NOT NULL, |
|
|
|
/* Contact information for the dataset */ |
|
ip INET, |
|
port INT4 CHECK (port BETWEEN 0 AND 65535), |
|
|
|
kind omicron.public.dataset_kind NOT NULL, |
|
|
|
/* An upper bound on the amount of space that might be in-use */ |
|
size_used INT, |
|
|
|
/* Only valid if kind = zone -- the name of this zone */ |
|
zone_name TEXT, |
|
|
|
quota INT8, |
|
reservation INT8, |
|
compression TEXT, |
|
|
|
/* Crucible must make use of 'size_used'; other datasets manage their own storage */ |
|
CONSTRAINT size_used_column_set_for_crucible CHECK ( |
|
(kind != 'crucible') OR |
|
(kind = 'crucible' AND size_used IS NOT NULL) |
|
), |
|
|
|
CONSTRAINT ip_and_port_set_for_crucible CHECK ( |
|
(kind != 'crucible') OR |
|
(kind = 'crucible' AND ip IS NOT NULL and port IS NOT NULL) |
|
), |
|
|
|
CONSTRAINT zone_name_for_zone_kind CHECK ( |
|
(kind != 'zone') OR |
|
(kind = 'zone' AND zone_name IS NOT NULL) |
|
) |
|
); |
We used to have a similar table for services, but got rid of it in favor of blueprints.
It would be nice if we could do the same for datasets!
It would be nice if we could rely on inventory for "datasets we observe", and the blueprint for "datasets we want to have".
There exists a dataset table that's kinda redundant with the blueprint information, but exists for historical reasons:
omicron/schema/crdb/dbinit.sql
Lines 559 to 604 in 15b4c45
We used to have a similar table for services, but got rid of it in favor of blueprints.
It would be nice if we could do the same for datasets!
omicron.public.datasetrecords to look up Crucible socket addressesomicron.public.datasetrecords to track Crucible space usage