cockroachdb / docs

CockroachDB user documentation
https://cockroachlabs.com/docs
Creative Commons Attribution 4.0 International
190 stars 460 forks source link

Node attribute usage needs improved documentation #12915

Open smcvey opened 2 years ago

smcvey commented 2 years ago

Shaun McVey (smcvey) commented:

If I set a node attribute on a few nodes in a cluster, eg:

--attrs=ram:64gb

and other nodes like this:

--attrs=ram:16gb

the documents don't say how I can use zone configurations to select between them.

My own naive attempts were like this:

ALTER DATABASE defaultdb CONFIGURE ZONE USING constraints = '[+ram:64gb]';
ERROR: constraint "+ram:64gb" matches no existing nodes within the cluster - did you enter it correctly?
SQLSTATE: 23514

I figured out I could do this, but it would not distinguish between nodes that were 64gb and those which were 16gb:

ALTER DATABASE defaultdb CONFIGURE ZONE USING constraints = '[+ram]';
CONFIGURE ZONE 1

I've since learned that I could create levels of attribute selections using this format:

ALTER DATABASE defaultdb CONFIGURE ZONE USING constraints = '[+ram, +64gb]';
or
ALTER DATABASE defaultdb CONFIGURE ZONE USING constraints = '[+ram, +16gb]';

The docs at https://www.cockroachlabs.com/docs/v21.2/configure-replication-zones need to offer some examples of using multi-level attributes like this, which they currently don't.

Jira Issue: DOC-2482

exalate-issue-sync[bot] commented 2 years ago

Ryan Kuo (taroface) commented: Richard Loveland Does this look like it would fall into your area?

exalate-issue-sync[bot] commented 2 years ago

Richard Loveland (rmloveland) commented: Ryan Kuo yes I think so - snagged it