From 099077460e2456b363024b085e8899351e561369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Thu, 2 Jul 2026 14:57:43 +0200 Subject: [PATCH 1/3] [local deployment/crdb] Ensure that each USS has at least a replica of the tables --- build/dev/docker-compose.yaml | 5 +++-- build/dev/run_locally.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/dev/docker-compose.yaml b/build/dev/docker-compose.yaml index 8771f0ae00..4e7f7d1c73 100644 --- a/build/dev/docker-compose.yaml +++ b/build/dev/docker-compose.yaml @@ -6,7 +6,7 @@ services: image: cockroachdb/cockroach:v24.1.3 entrypoint: /db-entrypoint.sh # 128MB limits allow larger numbers of nodes on a single machine - command: /cockroach/cockroach.sh start --insecure --join=db1.uss1.localutm --cache=128MiB --max-sql-memory=128MiB + command: /cockroach/cockroach.sh start --insecure --join=db1.uss1.localutm --cache=128MiB --max-sql-memory=128MiB --locality=uss=${USS_IDX:?},node=${USS_IDX:?}-${USS_NODE_IDX:?} volumes: - $PWD/startup/db-entrypoint.sh:/db-entrypoint.sh:ro profiles: [crdb] @@ -66,11 +66,12 @@ services: image: cockroachdb/cockroach:v24.1.3 profiles: [bootstrap-crdb] depends_on: [crdb] - entrypoint: > + entrypoint: > # note that this sets the CRDB zones to have as many replicas as there are USSs (for all tables), combined with the fact that CRDB will try to distribute replicas uniformly over zones (which are defined by locality), this ensures that each USS has at least a replica sh -c " out=$$(/cockroach/cockroach.sh init --insecure --host=db1.uss1.localutm 2>&1); if [ $$? -eq 0 ]; then echo "$$out"; + /cockroach/cockroach.sh sql --insecure --host=db1.uss1.localutm -e 'ALTER RANGE default CONFIGURE ZONE USING num_replicas = ${NUM_USS:?};'; exit 0; fi; echo "$$out"; diff --git a/build/dev/run_locally.sh b/build/dev/run_locally.sh index 383cbb75c1..8f5e0a1149 100755 --- a/build/dev/run_locally.sh +++ b/build/dev/run_locally.sh @@ -20,7 +20,7 @@ fi cd "${BASEDIR}" || exit 1 -NUM_USS=${NUM_USS:-2} +export NUM_USS=${NUM_USS:-2} NUM_NODES=${NUM_NODES:-1} DB_TYPE=${DB_TYPE:-crdb} From 0989e45cd6988ab21d694019b11cd294abcbd925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Thu, 9 Jul 2026 15:16:31 +0200 Subject: [PATCH 2/3] Apply suggestion from @mickmis --- build/dev/docker-compose.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/dev/docker-compose.yaml b/build/dev/docker-compose.yaml index 4e7f7d1c73..d1220f9b14 100644 --- a/build/dev/docker-compose.yaml +++ b/build/dev/docker-compose.yaml @@ -66,7 +66,9 @@ services: image: cockroachdb/cockroach:v24.1.3 profiles: [bootstrap-crdb] depends_on: [crdb] - entrypoint: > # note that this sets the CRDB zones to have as many replicas as there are USSs (for all tables), combined with the fact that CRDB will try to distribute replicas uniformly over zones (which are defined by locality), this ensures that each USS has at least a replica + # The entrypoint below sets the CRDB zones to have as many replicas as there are USSs (for all tables), combined with the fact that CRDB will try to distribute replicas uniformly over zones (which are defined by locality), this ensures that each USS has at least a replica. + # On a real production deployment such a configuration would be made to meet the survivability objectives (https://interuss.github.io/dss/latest/architecture/#survivability), either manually or automatically (https://github.com/interuss/dss/issues/482). + entrypoint: > sh -c " out=$$(/cockroach/cockroach.sh init --insecure --host=db1.uss1.localutm 2>&1); if [ $$? -eq 0 ]; then From c327f348fed63b292d428d57c026a60726c978a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Wed, 5 Aug 2026 15:47:44 +0200 Subject: [PATCH 3/3] update comment to link to future dss doc --- build/dev/docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dev/docker-compose.yaml b/build/dev/docker-compose.yaml index d1220f9b14..85b2741c82 100644 --- a/build/dev/docker-compose.yaml +++ b/build/dev/docker-compose.yaml @@ -67,8 +67,8 @@ services: profiles: [bootstrap-crdb] depends_on: [crdb] # The entrypoint below sets the CRDB zones to have as many replicas as there are USSs (for all tables), combined with the fact that CRDB will try to distribute replicas uniformly over zones (which are defined by locality), this ensures that each USS has at least a replica. - # On a real production deployment such a configuration would be made to meet the survivability objectives (https://interuss.github.io/dss/latest/architecture/#survivability), either manually or automatically (https://github.com/interuss/dss/issues/482). - entrypoint: > + # On a real production deployment such a configuration would be made to meet the survivability objectives (https://interuss.github.io/dss/latest/operations/survivability-crdb). + entrypoint: > sh -c " out=$$(/cockroach/cockroach.sh init --insecure --host=db1.uss1.localutm 2>&1); if [ $$? -eq 0 ]; then