new-cluster localities=us-east-1,us-east-1,us-east-1,us-central-1,us-central-1,us-central-1,us-west-1,us-west-1,us-west-1,eu-central-1
----

exec-sql idx=0
CREATE DATABASE db PRIMARY REGION "us-east-1" REGIONS  "us-west-1", "us-central-1";
----

exec-sql idx=0
CREATE TABLE db.rbr(k INT PRIMARY KEY, v INT) LOCALITY REGIONAL BY ROW;
----

exec-sql idx=0
INSERT INTO db.rbr (k, v, crdb_region) VALUES (1, 1, 'us-east-1'), (2, 2, 'us-central-1'), (3, 3, 'us-west-1')
----

# We can't constrain non-voters to specific replicas because we have 6
# candidates for non-voters, but only one per region will be allocated
# (2 total).
wait-for-zone-config-changes db-name=db table-name=rbr partition-name=us-east-1 num-voters=3 num-non-voters=2 leaseholder=0 voter=1,2 not-present=9
----

wait-for-zone-config-changes db-name=db table-name=rbr partition-name=us-central-1 num-voters=3 num-non-voters=2 leaseholder=3 voter=4,5 not-present=9
----

wait-for-zone-config-changes db-name=db table-name=rbr partition-name=us-west-1 num-voters=3 num-non-voters=2 leaseholder=6 voter=7,8 not-present=9
----
