Skip to content

ci: run Ideas Board multi-region IT against a 3-region docker-compose cluster - #8

Open
felipeg48 wants to merge 2 commits into
mainfrom
ci/multiregion-it
Open

felipeg48 wants to merge 2 commits into
mainfrom
ci/multiregion-it

Conversation

@felipeg48

Copy link
Copy Markdown
Contributor

What

Makes the gated RegionalIdeaIT (REGIONAL BY ROW region-homed writes) actually execute in CI against a real multi-region CockroachDB cluster.

  • examples/ideas-board/multiregion-compose.yml — 3-node insecure cluster, one node per region (us-east1, us-west1, us-central1) via --locality, RF=3. One-shot crdb-init runs cockroach init, waits for 3 regions, then SET PRIMARY REGION us-east1 + ADD REGION us-west1/us-central1 on defaultdb. On-disk ephemeral stores + capped caches; every SQL call has a statement_timeout and every loop is bounded (fails instead of hanging).
  • .github/workflows/examples-it-multiregion.yml — new workflow: up -d → timeout 420 docker compose run --rm crdb-init → ./gradlew -p examples/ideas-board test --tests '*RegionalIdeaIT*' with CRDB_MULTIREGION=true and CRDB_URL=postgres://root@localhost:26257/defaultdb?sslmode=disable. down -v always; logs dumped on failure.

Shape copied from the proven go-library examples-it-multiregion.yml / multiregion-compose.yml. examples-it.yml (single-node Testcontainers) is left untouched.

Notes

  • RegionalIdeaIT needs only us-east1 + us-west1 on the DB; the compose adds a 3rd region (us-central1) to stay a near-verbatim copy of the go cluster and give RF=3. Test only asserts on the 2 it uses.
  • Verified locally: ./gradlew -p examples/ideas-board test --tests '*RegionalIdeaIT*' builds, resolves the published 0.1.2 lib, discovers the IT, and SKIPS without CRDB_MULTIREGION (JDK 25). The multi-region run itself only happens in CI (needs the cluster).

…luster

Adds a 3-node one-per-region (us-east1/us-west1/us-central1) docker-compose
cluster and a separate examples-it-multiregion workflow that brings it up,
makes defaultdb multi-region, and runs RegionalIdeaIT with CRDB_MULTIREGION=true
and CRDB_URL pointed at node1. examples-it.yml (single-node Testcontainers) is
untouched.
…es jdbc:postgresql)

The first run failed with IllegalArgumentException at RegionalIdeaIT.java:32
(ds.setUrl): the test feeds CRDB_URL straight to PGSimpleDataSource, which
rejects the libpq-style postgres:// URL copied from the go example. Switch to
jdbc:postgresql://localhost:26257/defaultdb?sslmode=disable&user=root (user=root
needed since the JDBC driver otherwise uses the runner's OS user).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant