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

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

Open
2 tasks
smklein opened this issue Nov 5, 2024 · 0 comments
Open
2 tasks

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

smklein opened this issue Nov 5, 2024 · 0 comments
Labels
database Related to database access enhancement New feature or request. nexus Related to nexus

Comments

@smklein
Copy link
Collaborator

smklein commented Nov 5, 2024

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
@smklein smklein added database Related to database access enhancement New feature or request. nexus Related to nexus labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Related to database access enhancement New feature or request. nexus Related to nexus
Projects
None yet
Development

No branches or pull requests

1 participant