Skip to content

relay: give the asia-east2 cells the regional rehome identity - #19239

Merged
Jinwoo-H merged 1 commit into
mainfrom
relay/asia-cells-rehome-identity
Sep 7, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
relay/asia-cells-rehome-identity

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​24
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5

DRAFT: do not merge before the bidirectional rehome director is deployed

The asia-east2 cells (production-gce-c27, c28, c29) report regional_rehome_protocol 0 because relay_region_rehome_source_cell_ids lists only the 16 US cells, and membership in that list is what sets ORCA_RELAY_REHOME_DIRECTOR_SERVICE_ACCOUNT and ORCA_RELAY_REHOME_AUDIENCE in the GCE startup template. A cell reports protocol 1 only with both present. At protocol 0 a cell is neither a rehome source, a target, nor a fleet-safety member, so ~226 mis-homed desktops on those cells cannot be moved back.

What

  • production.tfvars: add the three Asia cell ids to relay_region_rehome_source_cell_ids.
  • variables.tf: the check assert that required every rehome source to sit in the primary region is relaxed to "configured, unfenced, explicit connection limit". Region eligibility now belongs to the director's own source and target predicates. The assert was advisory (a Terraform check warns rather than fails).
  • relay-same-cap-script-census.test.mjs: the census cross-check keys on protocol 1 for every reviewed serving cell, with a protocol-0 case kept on a cell outside the list.

Plan evidence

Read-only plan with a process-local token, -lock=false, no -out. Totals are identical with and without this change (the drift backlog the Terraform README documents). A targeted plan for c27's instance template shows 1 add / 1 destroy, and the only attributable delta is the two rehome env lines. The director service account and audience are global constants shared with the US cells, so no new IAM binding is needed.

Hard ordering

On current main two director gates reject Asia cells: the trust probe returns 409 for a source cell outside the default region, and source selection skips it as source_ineligible. The same-cap deploy job runs the trust probe after isolate/drain and after its targeted apply, so rolling an Asia cell at protocol 1 today would leave it serving-but-isolated. After this tfvars change lands, protocol-0 rolls of c27–c29 are also not dispatchable (the capacity-plan validator requires the rehome lines absent at protocol 0).

Safe sequence:

  1. Deploy the director with the bidirectional rehome change (removes both gates).
  2. Merge this PR. Never an untargeted root apply.
  3. Deploy Relay Production Same-Cap canary-apply for ONE Asia cell with target-rehome-protocol 1 / rollback-rehome-protocol 0 (it does its own targeted template + MIG apply).
  4. Batch-apply the remaining two.
  5. Confirm protocol 1 on fresh incarnations before enabling the rehome control.

Verification

terraform fmt -check -recursive, terraform validate, cloud dev-script suites (148 pretest, 530 main). Independent adversarial review, two rounds; round 2 approved.

`relay_region_rehome_source_cell_ids` listed only the 16 US cells, and that
list is the sole thing that stamps ORCA_RELAY_REHOME_DIRECTOR_SERVICE_ACCOUNT
and ORCA_RELAY_REHOME_AUDIENCE into a cell's startup script. A cell reports
regionalRehomeProtocol 1 only when both are present, so c27-c29 have always
reported 0. That leaves them ineligible as rehome sources and, once the worker
is bidirectional, as targets too, which strands the US desktops homed there.

This is a prerequisite only. Merge and roll it ONLY AFTER the bidirectional
rehome director change is deployed. Two live gates still hard-code the primary
region and would reject an Asia source no matter what the template stamps:
`cloud/apps/relay/src/app.ts` line 610 fails the trust probe with 409 when the
source cell's region is not RELAY_DEFAULT_REGION, and
`cloud/apps/relay/src/assignment-store.ts` line 5476 skips such a cell as
source_ineligible during rehome source selection. The bidirectional lane
removes both.

The topology check asserted every source sits in the primary region. That
mirrored those two gates rather than protecting anything Terraform owns, so it
is now advisory: it requires only a configured, unfenced cell with an explicit
connection limit, and the comment records that region eligibility belongs to
the director's own source and target predicates. Every cell's region is
already constrained by the assert above it.

The same-cap census test cross-checked membership against us-central1. Every
reviewed serving cell now carries the trust, so it asserts protocol 1 for all,
plus one non-source cell to keep the validator's protocol-0 branch covered.

Roll sequencing, because this apply is not self-contained:

- After the apply the Asia templates carry the two rehome lines, and the
  `unexpectedRehome` rule at `cloud/dev/scripts/validate-relay-capacity-plan.mjs`
  lines 243-247 rejects a protocol-0 plan that contains them. So c27-c29 have
  no dispatchable protocol-0 same-cap roll until the director gate is gone or
  this is reverted.
- The same-cap job runs the per-host trust probe after isolate, drain, and the
  targeted apply. A 409 there leaves the cell serving but isolated and
  migration-only, which is what happened to c13 on 2026-09-06.
- The only safe path: deploy the bidirectional rehome director, then dispatch
  `Deploy Relay Production Same-Cap` canary-apply for one Asia cell with
  target-rehome-protocol 1 and rollback-rehome-protocol 0, then batch-apply the
  remaining two. That job runs its own targeted template and MIG apply.
- Never reach these cells with an untargeted root apply. The current plan
  carries 60 changes and 50 destroys of unrelated standing drift.
@Jinwoo-H
Jinwoo-H force-pushed the relay/asia-cells-rehome-identity branch from 94a78f4 to fb9b29e Compare September 7, 2026 08:59
@Jinwoo-H
Jinwoo-H marked this pull request as ready for review September 7, 2026 09:03
@Jinwoo-H
Jinwoo-H merged commit db13cff into main Sep 7, 2026
24 checks passed

@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

  • production.tfvars — adds production-gce-c27/c28/c29 to relay_region_rehome_source_cell_ids, so their GCE startup templates emit the two ORCA_RELAY_REHOME_* lines and the cells report protocol 1.
  • relay-gce-cells.tf — relaxes the relay_gce_fixed_one_topology rehome-source assert from "primary-region" to "configured, unfenced, explicit connection limit"; region validity remains covered by the first assert (every cell region needs a configured subnetwork).
  • variables.tf — broadens the variable description to "any configured region".
  • relay-same-cap-script-census.test.mjs — asserts every SAME_CAP_CELLS member now reports protocol 1, and adds a protocol-0 case for production-gce-c17.

The changes are internally consistent: the relaxed check still requires the cell to exist (via try), be unfenced, and carry an explicit cap; the census test genuinely fails if a cell is dropped from the list (verified locally, 7/7); and once all same-cap cells emit rehome lines, validate-relay-capacity-plan.mjs uniformly forces protocol 1, so a protocol-0 roll of c27–c29 fails closed at plan validation rather than silently.

ℹ️ The body's hard-ordering describes a main that no longer exists

The body says "on current main two director gates reject Asia cells," but the bidirectional rehome director change — #19241 ("rehome hosts to their preferred region in either direction") — is already merged to main. The trust probe now gates on regionalRehomeProtocol >= 1 only (app.ts:609), and source selection's source_ineligible predicate has no region check (assignment-store.ts:5541). The code precondition is therefore in the tree; the remaining question is whether the running director has actually been redeployed with that code, not merely merged. Since the PR is no longer a GitHub draft, the body's "DRAFT: do not merge" note is now the only merge guard — worth confirming the director redeploy before merging.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 7, 2026
…ai#19239)

`relay_region_rehome_source_cell_ids` listed only the 16 US cells, and that
list is the sole thing that stamps ORCA_RELAY_REHOME_DIRECTOR_SERVICE_ACCOUNT
and ORCA_RELAY_REHOME_AUDIENCE into a cell's startup script. A cell reports
regionalRehomeProtocol 1 only when both are present, so c27-c29 have always
reported 0. That leaves them ineligible as rehome sources and, once the worker
is bidirectional, as targets too, which strands the US desktops homed there.

This is a prerequisite only. Merge and roll it ONLY AFTER the bidirectional
rehome director change is deployed. Two live gates still hard-code the primary
region and would reject an Asia source no matter what the template stamps:
`cloud/apps/relay/src/app.ts` line 610 fails the trust probe with 409 when the
source cell's region is not RELAY_DEFAULT_REGION, and
`cloud/apps/relay/src/assignment-store.ts` line 5476 skips such a cell as
source_ineligible during rehome source selection. The bidirectional lane
removes both.

The topology check asserted every source sits in the primary region. That
mirrored those two gates rather than protecting anything Terraform owns, so it
is now advisory: it requires only a configured, unfenced cell with an explicit
connection limit, and the comment records that region eligibility belongs to
the director's own source and target predicates. Every cell's region is
already constrained by the assert above it.

The same-cap census test cross-checked membership against us-central1. Every
reviewed serving cell now carries the trust, so it asserts protocol 1 for all,
plus one non-source cell to keep the validator's protocol-0 branch covered.

Roll sequencing, because this apply is not self-contained:

- After the apply the Asia templates carry the two rehome lines, and the
  `unexpectedRehome` rule at `cloud/dev/scripts/validate-relay-capacity-plan.mjs`
  lines 243-247 rejects a protocol-0 plan that contains them. So c27-c29 have
  no dispatchable protocol-0 same-cap roll until the director gate is gone or
  this is reverted.
- The same-cap job runs the per-host trust probe after isolate, drain, and the
  targeted apply. A 409 there leaves the cell serving but isolated and
  migration-only, which is what happened to c13 on 2026-09-06.
- The only safe path: deploy the bidirectional rehome director, then dispatch
  `Deploy Relay Production Same-Cap` canary-apply for one Asia cell with
  target-rehome-protocol 1 and rollback-rehome-protocol 0, then batch-apply the
  remaining two. That job runs its own targeted template and MIG apply.
- Never reach these cells with an untargeted root apply. The current plan
  carries 60 changes and 50 destroys of unrelated standing drift.
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