Skip to content

feat(relay): declare US cells c32 and c33 at the 3,000-host shape - #24444

Merged
Jinwoo-H merged 3 commits into
mainfrom
feat/relay-us-cells-c32-c33
Oct 1, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
feat/relay-us-cells-c32-c33

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​509 $\color{#cf222e}{\Huge{\mathbf{−}}}$​36 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​473
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​223 $\color{#cf222e}{\Huge{\mathbf{−}}}$​67 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​156

ELI5

The US relay fleet is full. Each US relay cell takes about 1,000 hosts, runs at roughly 800 in practice, and has no spare room. This PR adds two new US cells, C32 and C33, each built to hold 3,000 hosts, the same size as the Asia cells. They are declared only: nothing is created until an operator runs the existing rollout workflows, and the cells take no ordinary traffic until each one passes its own five-minute trial.

What Changed

Before: every US cell is capped at 1,000 hosts and runs at about 800 usable with zero headroom. Draining a US cell strands hosts, because there is nowhere for them to go. That also blocks the 17 US cells still on an image from before the crash fix: rolling one drains it, and a drain needs free room elsewhere.

After: two new cells are declared in us-central1 at the 3,000-host shape. Each adds about 2,840 usable hosts once promoted, which is enough room to drain and roll the older US cells.

Setting C32 / C33 Asia C27-C31 US C7-C26
Zone us-central1-a / us-central1-b asia-east2 a/b/c us-central1 a/b/c
Connection hard cap 3,000 3,000 1,000
Request units 6,000 6,000 4,000
Database pool 10 16 10
Machine e2-standard-4 e2-standard-4 e2-standard-4

The zones are the two least loaded among live US cells. Zone a had 6 live cells and zones b and c had 7 each. Both cells use image sha256:f30b5cb1…e269, the newest image, which C28, C29 and C31 already run.

The pool stays at the US default of 10. Asia uses 16 only because Asia cells sit about 176 ms from the database in us-central1. A US cell sits next to it.

Mechanism. The two Asia workflows were not region-neutral, so this PR generalizes them in place instead of adding a parallel US workflow:

  • Topology. The region was hard-coded to asia-east2. The workflow and validator now read each wave's region from the cell's reviewed zone. A us-central1 wave plans no Asia network, and the validator expects the template a US cell actually gets: no region label or line, and no pool line at the default of 10.
  • Admission. Registration and the runtime check expected asia-east2. They now expect the cell's own region.
  • Promotion order. Promotion required the Asia launch cells (C27-C29) to be general. That rule now applies only to Asia cells.
  • Canary. The canary aims its single test connection at the cell's own region, reads that cell's own metrics, and requires at least one selection in its region.
  • Director configuration. This step now accepts a us-central1 cell at pool 10.
  • Asia waves. They are unchanged. Their target list, region, pool, gates and evidence fields are byte-identical, and tests pin both regions.

The two cells were also added to every static list C31 touched:

  • the same-cap shape table, as 3,000 / us-central1 / default pool;
  • the same-cap migration-only list, until each canary promotes the cell;
  • the rehome source list and the trust-probe allowlist;
  • the topology and admission wave lists;
  • the canary table;
  • the docs.

The fleet pool list for the shadow gate is unchanged until promotion, the same as C31.

Database connections:

Before After
Relay cell connections 280 300
Configured maximum 365 385
Operating maximum (usable ceiling 490) 435 455
Unallocated 55 35

Two cells at pool 10 use 20 connections, which leaves 35 unallocated.

Why

US-targeted fallbacks are not gated for a US canary. The C31 trial measured about 130 of them every five minutes, because hosts that want the US land elsewhere when the US is full. A US cell's canary would fail on that baseline. A baseline comparison was already rejected in #24320 because the count moves for unrelated reasons. Asia-targeted fallbacks are not something a US cell can cause. Both counts are still recorded in the evidence.

Every other gate still applies:

  • the test connection must land on the new cell;
  • the cell must carry its own control and splice;
  • the cell must have no SQL failures and no pool waits;
  • no region may be unavailable;
  • the database must stay below its connection limit.

Alternatives considered:

  • A separate US workflow. It would duplicate both hardened workflows and their validators, which would then drift apart.
  • Copying Asia's pool of 16. It spends 12 connections for no latency reason.
  • A separate topology wave per cell. The topology workflow's live-image step refuses any declared cell that has no instance template yet and is not in the wave. With both cells declared, a C32-only plan fails on C33, and every other topology plan fails too. The two cells therefore share one topology wave, as C27-C29 did. Registration, director configuration and promotion still go one cell at a time, so each cell is proven by its own canary before the next.

Linked Issue

Fixes #N/A. This is an internal capacity change for the relay fleet.

Visual Proof

N/A. This changes Terraform variables, deploy workflows and their scripts. There is no UI.

Testing

  • Ran every node --test file that pnpm test runs in cloud/, plus relay-live-cell-image-overlay: 858 passed, 0 failed.

  • terraform fmt -check -recursive and terraform validate pass. These ran with init -backend=false, which needs no credentials.

  • terraform console on a local-backend copy evaluated the new cells against the variable validations: region us-central1, pool 10, cap 3,000.

  • The Asia topology waves are checked by running the workflow's own shell blocks. They still produce the same region and the same target list, including the asia-east2 network targets. The C32+C33 wave produces us-central1, the URL map and the six cell resources. A lone C32 or C33 topology wave is rejected.

  • The admission workflow's promotion block is also run directly. It routes C30 and C31 to an asia-east2 canary and C32 and C33 to a us-central1 canary, and it rejects C34 and a two-cell US wave.

  • The validator, input preparer, director-cells script, admission script and evidence script each have new tests for the US shape. Those tests reject an Asia region label or line, a pool of 16, an Asia subnet, and Asia runtime metrics on a US cell. The existing Asia tests pass unchanged.

  • The trust-probe allowlist is now pinned to the committed rehome source list for c1-c40.

  • oxlint and pnpm run check:code-quality:changed both skip cloud/**, so they report nothing for this PR.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No production change until an operator runs the ladder.

  1. Topology plan, then apply, once for production-gce-c32,production-gce-c33.
  2. For C32, then for C33, run the admission steps inspect, register, configure and promote. Promotion runs the cell's own five-minute canary and needs no evidence run.

Before running it, confirm that the director still serves sha256:f30b5cb1…e269. Promotion requires the director's image to equal the cell image. If the director has rolled since this PR, re-pin both cells first. Do not promote while a same-cap restore has just returned an empty general US cell. Placement breaks a load-ratio tie by cell ID, so the canary control would land on that cell and the canary would fail closed.

A failed canary returns the cell to migration-only. A follow-up PR then moves the promoted cell to the same-cap general list, as was done for C31. Whether it also joins the shadow gate's fleet pool list is decided then. That list tracks the 16-connection Asia pools.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Declares two us-central1 cells at the Asia shape (cap 3000, 6000 request
units, e2-standard-4) with the US default pool of 10, and generalises the
Asia topology and admission ladder to derive each wave's region from its
reviewed zone, leaving every Asia wave's behaviour unchanged.

Claude-Session: ced32ebb-7155-4413-adad-1eccd14c2010
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Critical risk] Declares new production relay cells and updates infrastructure automation.

The PR appears safe to merge; the previously blocked topology rollout now has a combined wave.

Summary

The PR declares two 3,000-host US relay cells and extends the existing topology, admission, canary, and same-cap tooling to handle them.

  • C32 and C33 now share one topology wave, while registration and promotion remain per-cell.
  • The US shape retains the default database pool and uses region-specific validation and canary metrics.

Reviews (3) · Last reviewed commit: "fix(relay): plan C32 and C33 as one topo..."

…st to promotion

Claude-Session: ced32ebb-7155-4413-adad-1eccd14c2010

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Declaring both US cells in one commit breaks the topology workflow's live-images step. overlayRelayLiveCellImages refuses any declared non-target cell that has no instance template in state, so the C32 plan fails on C33 — and because the committed plan variables contain the whole tfvars map, every topology plan (Asia included) fails until both cells exist. The cells cannot be scaffolded by the ladder this PR documents.

Reviewed changes

  • Declares production-gce-c32/c33. Both added to production.tfvars at the Asia 3,000-connection shape (us-central1-a/-b, pool 10, newest image) and to relay_region_rehome_source_cell_ids.
  • Topology region generalization. The topology workflow/validator/input take each wave's region from its reviewed zone: a us-central1 wave plans no additional-region network, and its template carries no region label/line and no pool line at the default.
  • Admission region generalization. cellRegion() maps c32/c33 to us-central1; registration and the runtime check expect the cell's own region; the Asia launch-order promotion gates are gated by asiaWave so US cells skip them; the canary region is threaded through canary_region/CANARY_REGION.
  • US canary evidence. The canary filters cell metrics by its own region, adds and gates usSelections, and records but does not gate either region's fallbacks.
  • Static lists. C32/C33 added to the same-cap migration-only list, the rehome trust-probe allowlist, the SQL connection budget expectations, the director-cells pool table, and the load-profile preferred regions; docs updated.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1e06032b-7eec-427a-89a3-a60fd57c7865

📥 Commits

Reviewing files that changed from the base of the PR and between 0c5cb6b and f0154c9.

📒 Files selected for processing (9)
  • .github/workflows/cloud-deploy-relay-asia-topology.yml
  • cloud/dev/scripts/prepare-relay-asia-topology-input.mjs
  • cloud/dev/scripts/prepare-relay-asia-topology-input.test.mjs
  • cloud/dev/scripts/relay-asia-topology-workflow.test.mjs
  • cloud/dev/scripts/validate-relay-asia-topology-plan.mjs
  • cloud/dev/scripts/validate-relay-asia-topology-plan.test.mjs
  • cloud/docs/relay-workflows.md
  • cloud/infra/terraform/README.md
  • cloud/infra/terraform/environments/production.tfvars
🚧 Files skipped from review as they are similar to previous changes (1)
  • cloud/infra/terraform/environments/production.tfvars

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

Production configuration adds Relay cells C32 and C33 in us-central1, each with its own rollout wave. Topology generation, validation, and deployment workflows now select region-specific settings and targets. Admission and canary tooling use each cell’s region, while migration classifications and production connection-budget expectations include both cells.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to f0154

This change declares two disabled US relay cells and generalizes the rollout tooling to handle their region. No concrete merge-blocking issue was found, and the cells stay migration-only until they are promoted separately.

Security Architecture Review

Security architecture risk: 🔵 Low · up to f0154

The new cells use the existing fleet’s credential boundary and controlled rollout paths. Region-specific validation and recovery checks limit the identified risk, and no introduced exploitable security condition was demonstrated. The canary runs after general admission, not before all ordinary traffic. Deployed permissions and complete interruption recovery remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The incremental deployment surface is two workers and shared routing/admission updates, but a worker compromise would not necessarily be contained to one cell: the inherited runtime identity can access shared Relay database and signing secrets. This shared credential boundary predates the PR; no exploit establishing such a compromise was identified.

Trust Boundaries and Controls

  • observed — The topology workload identity constrains repository claims, main branch, selected environment and workflow-dispatch context. Its mutation role lists Compute permissions, not IAM-policy mutation or secret access, and service-account attachment is granted for the Relay runtime account. Admission validates operation inputs before authentication and obtains an audience-bound director administration token.

Resilience and Maintainability Implications

  • observed — Admission recovery uses expected generations, persisted attempt identity and exact selector membership to reject stale recovery. Production topology and admission workflows share a non-cancelling concurrency group. These controls support failure containment, but automatic rollback is an attempted workflow action rather than a guarantee after forced runner termination.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.93% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 20 files. (4 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the primary change: declaring US relay cells C32 and C33 at the 3,000-host shape.
Description check ✅ Passed The description follows the required template and provides a clear ELI5 summary, scope, rationale, testing details, visual-proof explanation, review notes, and checklist. It identifies the linked issu…
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.93% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 20 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: dad9eea5-a0c6-4bc5-929b-1acfaf575135

📥 Commits

Reviewing files that changed from the base of the PR and between 197ea3a and 0c5cb6b.

📒 Files selected for processing (26)
  • .github/workflows/cloud-deploy-relay-asia-topology.yml
  • .github/workflows/cloud-deploy-relay-production-same-cap-job.yml
  • .github/workflows/cloud-operate-relay-asia-admission.yml
  • cloud/dev/scripts/operate-relay-asia-admission.mjs
  • cloud/dev/scripts/operate-relay-asia-admission.test.mjs
  • cloud/dev/scripts/prepare-relay-asia-director-cells.mjs
  • cloud/dev/scripts/prepare-relay-asia-director-cells.test.mjs
  • cloud/dev/scripts/prepare-relay-asia-topology-input.mjs
  • cloud/dev/scripts/prepare-relay-asia-topology-input.test.mjs
  • cloud/dev/scripts/prepare-relay-production-capacity-canary.test.mjs
  • cloud/dev/scripts/probe-relay-rehome-trust.mjs
  • cloud/dev/scripts/probe-relay-rehome-trust.test.mjs
  • cloud/dev/scripts/relay-asia-rollout-evidence.mjs
  • cloud/dev/scripts/relay-asia-rollout-evidence.test.mjs
  • cloud/dev/scripts/relay-asia-topology-workflow.test.mjs
  • cloud/dev/scripts/relay-cloud-sql-connection-budget.test.mjs
  • cloud/dev/scripts/relay-load-profile.mjs
  • cloud/dev/scripts/relay-load-profile.test.mjs
  • cloud/dev/scripts/relay-production-same-cap-wave.mjs
  • cloud/dev/scripts/relay-production-same-cap-wave.test.mjs
  • cloud/dev/scripts/relay-same-cap-script-census.test.mjs
  • cloud/dev/scripts/validate-relay-asia-topology-plan.mjs
  • cloud/dev/scripts/validate-relay-asia-topology-plan.test.mjs
  • cloud/docs/relay-workflows.md
  • cloud/infra/terraform/README.md
  • cloud/infra/terraform/environments/production.tfvars

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Comment on lines +424 to +452
# US cells at the Asia 3,000-host shape, each its own additive wave: a was lightest, b ties c.
"production-gce-c32" = {
hostname = "c32"
region = "us-central1"
zone = "us-central1-a"
machine_type = "e2-standard-4"
boot_disk_gb = 30
boot_image = "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/images/cos-stable-121-18867-528-21"
capacity_requests = 6000
database_pool_max = 10 # The US default; 16 exists only for the asia-east2 round trip.
image = "us-central1-docker.pkg.dev/onorca-cloud/orca-cloud/relay@sha256:f30b5cb1ec52b6b6145efecfa1b8be9e3d309403beffd8abcc64197a2087e269"
initially_enabled = false
connection_hard_cap = 3000
connection_unobserved_bound = 60
}
"production-gce-c33" = {
hostname = "c33"
region = "us-central1"
zone = "us-central1-b"
machine_type = "e2-standard-4"
boot_disk_gb = 30
boot_image = "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/images/cos-stable-121-18867-528-21"
capacity_requests = 6000
database_pool_max = 10 # The US default; 16 exists only for the asia-east2 round trip.
image = "us-central1-docker.pkg.dev/onorca-cloud/orca-cloud/relay@sha256:f30b5cb1ec52b6b6145efecfa1b8be9e3d309403beffd8abcc64197a2087e269"
initially_enabled = false
connection_hard_cap = 3000
connection_unobserved_bound = 60
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Declaring C33 before it exists can block the C32 topology plan.

The live-images step passes the full relay_gce_cells map to relay-live-cell-image-overlay.mjs. That script throws when a declared non-target cell has no live template. During the C32 wave, C33 is declared but not created, so the overlay can fail with production-gce-c33 is not a target and has no live template. A previous review raised this same problem. Use one of these fixes:

  • Plan C32 and C33 as one topology wave.
  • Declare C33 in a follow-up PR after C32 exists.
  • Make the overlay skip declared cells that have no state template.

The live-image overlay refuses a declared non-target cell with no template,
so a lone C32 plan would fail on C33. Registration and promotion stay
one cell at a time.

Claude-Session: ced32ebb-7155-4413-adad-1eccd14c2010

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

The prior review's caution — declaring both US cells deadlocked the topology workflow's live-images step — is resolved in f0154c9, which plans production-gce-c32 and production-gce-c33 as a single topology wave.

  • Grouped the two US cells into one topology wave. prepare-relay-asia-topology-input.mjs and validate-relay-asia-topology-plan.mjs now list ['production-gce-c32', 'production-gce-c33'] as one wave, so both are targets and overlayRelayLiveCellImages no longer throws on C33's missing template.
  • Tightened the workflow's reviewed request. The case admits only production:production-gce-c32,production-gce-c33 at us-central1; a lone C32 or C33 plan is now rejected.
  • Kept registration, director configuration and promotion one cell at a time. The admission waves in operate-relay-asia-admission.mjs remain per-cell; only the topology wave is shared, matching the documented ladder.
  • Updated tests, docs and the tfvars comment. usWavePlan builds the two-cell plan (changes: 7) and mutates both cells; a new test pins the workflow's single wave; relay-workflows.md, the Terraform README and the production.tfvars comment describe the shared wave.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 051ca4d into main Oct 1, 2026
26 checks passed
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