Skip to content

[nexus] As a long-term goal, stop using "dataset" CockroachDB table #6998

@smklein

Description

@smklein

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!

  • Stop relying on omicron.public.dataset records to look up Crucible socket addresses
  • Stop relying on omicron.public.dataset records to track Crucible space usage

Metadata

Metadata

Assignees

No one assigned

    Labels

    databaseRelated to database accessenhancementNew feature or request.nexusRelated to nexus
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions