Repository navigation
feat(relay): declare Asia spare cell c34 as migration-only - #25336
Conversation
There was a problem hiding this comment.
ℹ️ No critical issues — one sequencing note and a stale doc reference. The C34 declaration is consistent everywhere I could trace, and the deliberate omissions (fleet pool list, canary registry, promotion wave) are justified.
Reviewed changes
This PR declares a sixth Asia relay cell, production-gce-c34, as a migration-only spare at the C31 shape in asia-east2-c.
- Terraform cell map — adds
production-gce-c34(e2-standard-4, 30 GB, 6,000 requests, pool 16, hard cap 3,000, C31 imagef30b5cb1…e269) and lists it inrelay_region_rehome_source_cell_ids. - Topology workflow + validators — accept C34 as its own single-cell wave in
asia-east2-c(zones become 2/2/2, pool 16);prepare-relay-asia-topology-inputandvalidate-relay-asia-topology-plangain the zone/pool entry. - Admission script — C34 enters
allCellsand a lone registration wave, with no promotion wave, sopromote/recover-promotionreject it at the parser. - Same-cap roll — C34 joins
SAME_CAP_MIGRATION_ONLY_CELLS, so a routine image roll returns it isolated (entry admission migration-only, selector delta 0). - Rehome trust probe — allowlist regex and comment now include 34 / “six”.
- Connection budget — Asia cells 5→6: cells 300→316, configured max 385→401, unallocated 35→19, still
withinBudget. - Tests/docs — new coverage for registration, rehome trust, topology plan, and budget; workflow guide and Terraform README name the spare.
ℹ️ Whole-region rollback now requires C34 to be registered first
SHAPES.production.allCells is the target set for both the whole-region inspect and the whole-region rollback, and this PR adds C34 to it. inspect resolves an unregistered cell to 'absent' via inspectedMembershipStates, but rollback calls selectorCellState, which throws selector does not contain production-gce-c34. Between this merge and C34’s registration, a whole-region rollback is accepted by the parser/workflow and then fails at runtime. It fails safe (the validation loop throws before any apply), and it mirrors how C32/C33 were introduced, but C34 is a dormant spare that may stay unregistered for a while — worth confirming this is intended, or making rollback tolerate a declared-but-absent cell the way inspect does.
Technical details
# Whole-region rollback vs. an unregistered C34
## Affected sites
- `cloud/dev/scripts/operate-relay-asia-admission.mjs:24` — C34 added to `allCells`.
- `cloud/dev/scripts/operate-relay-asia-admission.mjs:353-358` — `rollback` branches on `selectorCellState`, which throws for a cell absent from the selector.
- `cloud/dev/scripts/operate-relay-asia-admission.mjs:176-186` — `inspectedMembershipStates` (used by `inspect`) maps an absent cell to `'absent'` instead.
- `cloud/dev/scripts/operate-relay-asia-admission.test.mjs:556` — whole-region rollback accepted with C34; `:562` whole-region inspect accepted with C34.
## Required outcome
- Decide whether whole-region rollback should keep rejecting an unregistered declared cell (current behavior, fails fast) or tolerate it like inspect.
## Open questions for the human
- Is whole-region rollback expected to be usable before every declared cell is registered? If yes, it should not hard-fail on a declared-but-unregistered spare.ℹ️ Nitpicks
cloud/docs/relay-workflows.md:169still says “The production Asia set is C27-C31” and line 170 “the five cells spread 2/2/1”, which now contradicts the C34 paragraph added below it (“the six Asia cells spread 2/2/2”).
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe change adds production cell C34 in asia-east2-c, with a 3,000-connection hard cap and a database pool maximum of 16. Topology and deployment tooling recognize it as a separate wave. Admission tooling registers it as a migration-only spare and does not allow promotion. Rehome checks and connection-budget tests include C34, and the workflow documentation describes its placement and restrictions. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to C34 can be moved out of its reserved migration-only role through production lifecycle commands, including a canary activation that makes it eligible for general placement. Add guards before merging to preserve the spare’s restricted role. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The normal deployment and admission workflows keep C34 out of ordinary placement. However, an existing privileged capacity tool newly accepts C34 and can activate it as a general cell, contrary to the spare-cell policy. This requires authorized administrative credentials; no unauthenticated promotion or new privilege escalation was established. Actual production deployment and access settings remain unverified. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 14 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
Adds a sixth asia-east2 cell at the C31 shape (cap 3000, 6000 request units, pool 16, e2-standard-4) in asia-east2-c, pinned to the f30b5cb1 cell image. It gets its own topology and registration wave but no promotion wave, so the admission script and workflow refuse to promote it; it stays a migration-only landing zone and out of the fleet pool list. Claude-Session: 1145a80d-dec4-4a9b-9373-bbbb876b9041
fd9b1ad to
83b7f08
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the delta since the prior pullfrog review (fd9b1ad → 83b7f08). The branch was rebased onto main after #25367 promoted US C32/C33 to general, and the same-cap migration-only list, its tests, and the workflow doc were reconciled. The net effect versus main is unchanged — only C34 is declared.
- Dropped C32/C33 from
SAME_CAP_MIGRATION_ONLY_CELLS, leaving C17, C18, and the C34 spare migration-only. - Updated the same-cap wave test to assert C34 beside C17/C18 and C30-C33 as general.
- Adjusted the script-census assertion to exclude C34 from the migration-only side, since C34 is a declared rehome source.
- Recorded C32/C33's promotion to general in
relay-workflows.md.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8fe2cf43-3c04-4f0d-8c6f-c6162aa4e316
📒 Files selected for processing (4)
cloud/dev/scripts/relay-production-same-cap-wave.mjscloud/dev/scripts/relay-production-same-cap-wave.test.mjscloud/dev/scripts/relay-same-cap-script-census.test.mjscloud/docs/relay-workflows.md
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
| // C34 is an Asia spare that stays migration-only by policy. | ||
| export const SAME_CAP_MIGRATION_ONLY_CELLS = [ | ||
| 'production-gce-c17', 'production-gce-c18', 'production-gce-c34' | ||
| ] |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
git diff --unified=8 aac1c8f9c202700e3b6887806323be38af1be4b1 83b7f086754009e8e7c787b911462366eadc9167 -- cloud/dev/scripts/relay-production-same-cap-wave.mjs cloud/dev/scripts/prepare-relay-production-capacity-canary.mjs cloud/dev/scripts/prepare-relay-production-capacity-canary.test.mjs
rg -n 'SAME_CAP_CELLS|SAME_CAP_MIGRATION_ONLY_CELLS|approved-cells|prepareProductionCapacityCell|mode.*activate' cloud/dev/scripts/relay-production-same-cap-wave.mjs cloud/dev/scripts/prepare-relay-production-capacity-canary.mjs cloud/dev/scripts/prepare-relay-production-capacity-canary.test.mjsRepository: stablyai/orca
Length of output: 7713
🏁 Script executed:
nl -ba cloud/dev/scripts/prepare-relay-production-capacity-canary.mjs | sed -n '1,175p'
printf '\n--- focused tests ---\n'
nl -ba cloud/dev/scripts/prepare-relay-production-capacity-canary.test.mjs | sed -n '130,215p'Repository: stablyai/orca
Length of output: 11619
Reject activation for migration-only cells.
SAME_CAP_CELLS must continue to allow C34 for isolate and drain, but --mode activate must reject migration-only cells. The current branch maps every non-isolate mode to general, so activation can commit C34 as general and enable general placement.
Suggested fix
-import { SAME_CAP_CELLS } from './relay-production-same-cap-wave.mjs'
+import {
+ SAME_CAP_CELLS,
+ SAME_CAP_MIGRATION_ONLY_CELLS
+} from './relay-production-same-cap-wave.mjs'
...
if (config.mode === 'drain') {
...
return { changed: false, drained: true, paceWindowMs: 0 }
}
+ if (
+ config.mode === 'activate' &&
+ SAME_CAP_MIGRATION_ONLY_CELLS.includes(config.cellId)
+ ) {
+ throw new Error('migration-only production capacity target cannot be activated')
+ }
const before = await inspectAdmissionSelector(post)| Do not name it in the multi-target `promote-general-cell` or `retire-migration-cell` modes, which | ||
| accept any migration-only cell. It is a declared rehome source, sits in the same-cap migration-only |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
rg -n -C 8 'promote-general-cell|retire-migration-cell|migration-only|production-gce-c34' \
cloud/dev/scripts/operate-relay-asia-admission.mjs \
cloud/dev/scripts/operate-relay-asia-admission.test.mjsRepository: stablyai/orca
Length of output: 39218
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- admission relevant declarations/branches ---'
rg -n 'function parseRelayAsiaAdmissionArguments|const parseRelayAsiaAdmissionArguments|mode.*promote|mode.*retire|promotionWaves|PRODUCTION_CANARY_CELL|C34' cloud/dev/scripts/operate-relay-asia-admission.mjs cloud/dev/scripts/operate-relay-asia-admission.test.mjs
printf '%s\n' '--- argument parser and operation ---'
sed -n '100,220p' cloud/dev/scripts/operate-relay-asia-admission.mjs
sed -n '300,490p' cloud/dev/scripts/operate-relay-asia-admission.mjs
printf '%s\n' '--- rejected-argument tests ---'
sed -n '530,615p' cloud/dev/scripts/operate-relay-asia-admission.test.mjs
printf '%s\n' '--- locate retirement mode implementation ---'
rg -n -i -C 4 'retire-migration-cell|promote-general-cell' cloud/dev cloud/docs
printf '%s\n' '--- documentation diff against exact merge base ---'
git diff --unified=12 aac1c8f9c202700e3b6887806323be38af1be4b1 83b7f086754009e8e7c787b911462366eadc9167 -- cloud/docs/relay-workflows.mdRepository: stablyai/orca
Length of output: 41302
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- generic lifecycle mode implementation ---'
sed -n '2780,2905p' cloud/dev/scripts/deploy-relay-gce-multi-target.mjs
printf '%s\n' '--- generic lifecycle tests ---'
sed -n '1600,1760p' cloud/dev/scripts/deploy-relay-gce-multi-target.test.mjs
printf '%s\n' '--- generic target argument validation ---'
sed -n '55,120p' cloud/dev/scripts/operate-relay-asia-admission.mjs
sed -n '135,220p' cloud/dev/scripts/deploy-relay-gce-multi-target.mjs
printf '%s\n' '--- topology policy references ---'
rg -n -C 3 'production-gce-c34|migrationOnly|rehome|existing-only|migration-only' cloud --glob '*topology*' --glob '*.json' --glob '*.mjs' | head -200Repository: stablyai/orca
Length of output: 37149
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- helper definitions ---'
rg -n 'function inspectGeneralPromotionTarget|const inspectGeneralPromotionTarget|function selectMultiTargetDeployments|function targetIds|function verifySelectorCompatibleDirector|function verifyActiveSelectorDirector' cloud/dev/scripts/deploy-relay-gce-multi-target.mjs
sed -n '2380,2525p' cloud/dev/scripts/deploy-relay-gce-multi-target.mjs
printf '%s\n' '--- target selection and topology fixture ---'
rg -n -C 5 'target-cell-ids|target1|target2|production-gce-c34' cloud/dev/scripts/deploy-relay-gce-multi-target.mjs cloud/dev/scripts/deploy-relay-gce-multi-target.test.mjs cloud/dev --glob '*topology*' | head -240Repository: stablyai/orca
Length of output: 26179
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- selection logic ---'
sed -n '330,390p' cloud/dev/scripts/deploy-relay-gce-multi-target.mjs
printf '%s\n' '--- selector director and promotion target checks ---'
sed -n '390,520p' cloud/dev/scripts/deploy-relay-gce-multi-target.mjs
sed -n '1035,1115p' cloud/dev/scripts/deploy-relay-gce-multi-target.mjs
printf '%s\n' '--- topology and target binding during execution ---'
rg -n 'loadTopology|readFile.*topology|selectMultiTargetDeployments\\(|targetCellIds.map|targets = ' cloud/dev/scripts/deploy-relay-gce-multi-target.mjs | tail -60Repository: stablyai/orca
Length of output: 9315
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- production C34 topology declarations ---'
rg -n -F -- 'production-gce-c34' cloud --glob '!**/node_modules/**' --glob '!**/dist/**' | head -100
printf '%s\n' '--- generic topology-to-target execution flow ---'
rg -n 'selectMultiTargetDeployments|function runMultiTargetDeployment|export async function runMultiTargetDeployment|readFileSync|readFile\\(' cloud/dev/scripts/deploy-relay-gce-multi-target.mjsRepository: stablyai/orca
Length of output: 5416
🏁 Script executed:
#!/bin/bash
set -e
file=cloud/dev/scripts/deploy-relay-gce-multi-target.mjs
printf '%s\n' '--- generic topology and target call sites ---'
rg -n -F 'selectMultiTargetDeployments(' "$file" || test "$?" -eq 1
rg -n -F 'topologyFile' "$file" || test "$?" -eq 1
rg -n -F 'topology-file' "$file" || test "$?" -eq 1
rg -n -F 'readFile' "$file" || test "$?" -eq 1
printf '%s\n' '--- production C34 topology entry ---'
sed -n '440,510p' cloud/infra/terraform/environments/production.tfvarsRepository: stablyai/orca
Length of output: 3871
Reject C34 in both generic lifecycle modes.
Each mode accepts one target. When the supplied topology includes C34 and its selector state is migration-only, promote-general-cell can move it to general, and retire-migration-cell can move it to existing-only. Add a C34 guard to both handlers and tests for both rejections.
Suggested guards
if (config.mode === 'promote-general-cell') {
if (!selectorActive) throw new Error('admission selector boundary is not active')
const [promoted] = targets
+ if (promoted?.cellId === 'production-gce-c34') {
+ throw new Error('C34 is a reserved migration-only spare')
+ }
if (
!promoted ||
selectorCellState(selectorInspection.selector, promoted.cellId) !== 'migration-only'
) {
throw new Error('promoted cell admission must be migration-only')
}
if (config.mode === 'retire-migration-cell') {
if (!selectorActive) throw new Error('admission selector boundary is not active')
const [retiring] = targets
+ if (retiring?.cellId === 'production-gce-c34') {
+ throw new Error('C34 is a reserved migration-only spare')
+ }
if (
!retiring ||
selectorCellState(selectorInspection.selector, retiring.cellId) !== 'migration-only'
) {
throw new Error('retired cell admission must be migration-only')
}* feat(relay): declare Asia spare cell c35 as migration-only Adds a seventh asia-east2 cell at the C34 shape (cap 3000, 6000 request units, pool 16, e2-standard-4) in asia-east2-a, pinned to image F. It gets its own topology and registration wave but no promotion wave, so the admission script and workflow refuse to promote it; it stays a migration-only spare and out of the fleet pool list. Mirrors #25336. * test(relay): accept the c35 spare under the same-cap capacity allowlist

ELI5
Asia relay traffic runs on five machines. When one of them has to be restarted, its connections need somewhere to go, and today there is no empty Asia machine to catch them. This adds a sixth Asia machine of the same size that stays empty on purpose: ordinary new connections never land on it, and it only receives connections that an operator or a drain explicitly moves there.
Merging creates nothing. The machine appears only when an operator runs the existing topology workflow, and it takes no traffic until it is registered and the director is told about it.
What Changed
Before: Asia has C27-C31, all general (they take ordinary placement). There is no Asia spare, so draining an Asia cell has to fit into the other four cells' free seats.
After: the code declares C34, an Asia spare at the C31 shape:
asia-east2-c(zones become 2/2/2)relay@sha256:f30b5cb1…e269The image is the newest cell image the fleet serves. The director moved to
933c05econ 10-01, but that build changed only director code (#24446), and no cell has run it yet.Mechanism. Every Asia workflow refuses a cell it was not told about by name, so C34 is listed in each place C31 was, with one deliberate difference: it has no promotion wave.
production.tfvars): declares the machine, and makes it a regional rehome source like every other Asia cell. The rehome settings are per-cell, so they reach only C34's own template.asia-east2-conly.promoteandrecover-promotionreject it. The workflow's promotion case also has no C34 entry, and there is no canary-evidence entry for it.FLEET_POOL_CELL_IDS): unchanged. C34 is not added.No other cell, US resource, SQL, DNS, or certificate is touched.
Database connections (
relay-cloud-sql-connection-budget.mjs):This fits, but it is the last Asia-shaped cell the shared instance can take at pool 16. An idle migration-only cell opens few of its 16 connections in practice.
Why
The relay redesign (decision §7, Q2) calls for one spare per region. For Asia that means a sixth cell at the 3k shape, kept migration-only. The spare is a precondition for paced drains and parallel rolls.
Alternatives considered:
Linked Issue
N/A, internal capacity work (relay redesign batch 1).
Visual Proof
N/A. Infrastructure configuration and operator workflows only, no UI.
Testing
node --test dev/scripts/*.test.mjsfromcloud/: 827 of 828 pass. The one failure isrelay-load-control-peer.test.mjs, which this PR does not touch. It cannot loadtweetnaclin a lane worktree without installed dependencies, which matches the baseline.asia-east2and stays out ofgeneral.promoteandrecover-promotionreject it, and it cannot share a register wave with C33. Its topology wave is accepted only inasia-east2-cat pool 16. It rolls as a same-cap migration-only cell. C35 is still rejected everywhere.-refresh=false -lock=false), using the topology workflow's exact target set and its live-image overlay:Plan: 3 to add, 1 to change, 0 to destroy.c34.relay.onorca.devhost rule. Every other resource is a no-op, including the asia-east2 subnet, router and NAT.prepare-relay-asia-topology-input.mjsandvalidate-relay-asia-topology-plan.mjsboth accept this plan:{"environment":"production","cells":["production-gce-c34"],"changes":4}.production-gce-c34is free everywhere checked:inspectrun 37248143823);main's tfvars.Review
Agent skill upstream boundary
Notes
promote-general-cell/retire-migration-cellmodes accept any migration-only cell, so they must not name C34. Placement and regional rehome only select general cells.terraform console, which handles an uncreated cell.Checklist
N/Afor visual proof with reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (cloud scripts are outside these; CI will cover)