From the Replica Zone Format docs
replicas:
- attrs: [comma-separated attribute list]
- attrs: [comma-separated attribute list]
- attrs: [comma-separated attribute list]
It’s normal and sufficient to define the number of replicas by listing attrs without any specific attributes (i.e., - attrs: []). But if you do set specific attributes for a replica (i.e., - attrs: [us-east-1a, ssd]), the replica will be placed on the nodes/stores with the matching attributes.
However, @petermattis recently discovered that we only take into account the first attrs field when deciding how to add/remove replicas. This should probably be updated in the documentation or (fixed as part of the new ZoneConfig format #7660).
https://github.com/cockroachdb/cockroach/blob/master/storage/replicate_queue.go#L144
From the Replica Zone Format docs
However, @petermattis recently discovered that we only take into account the first
attrsfield when deciding how to add/remove replicas. This should probably be updated in the documentation or (fixed as part of the new ZoneConfig format #7660).https://github.com/cockroachdb/cockroach/blob/master/storage/replicate_queue.go#L144