Skip to content

docs(relay): 2026-09 reconnect findings, checklist, roadmap, and Roll 2 plan - #18958

Merged
Jinwoo-H merged 1 commit into
mainfrom
relay-reconnect-2026-09-docs
Sep 6, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
relay-reconnect-2026-09-docs

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1401 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1401

ELI5

The write-up of what went wrong with phone reconnects on 2026-09-04, what we changed, how the fleet-wide cell image roll went (done 2026-09-05), and the plan for the last roll. Documents only.

Contents

  • cloud/docs/relay-reconnect-2026-09-findings.md: findings 1–8, every gate and wave of Roll 1 with run IDs, root causes of each gate freeze, final image census (all serving cells on 519f4914, c7 on 85bf6799, selector gen 148).
  • cloud/docs/relay-improvement-checklist-2026-09.md: per-item checklists; 1.1 fully ticked.
  • cloud/docs/relay-improvement-roadmap-2026-09.md: ranked roadmap.
  • cloud/docs/relay-roll2-plan-2026-09.md: Roll 2 (per-cell locks + statement timeout + accept abandonment + 6 h lease) and close-out plan; private IP deferred to an owner decision.

Split out of #18565 so the record lands independently of the code review there.

…ap, and Roll 2 plan

Operator record for the 2026-09-04 relay reconnect incident and the Roll 1
same-cap cell image roll (complete 2026-09-05, selector gen 148), plus the
follow-up checklist, roadmap, and the Roll 2 implementation plan.
Docs only; split out of #18565 so the record merges independently of the code.

@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 critical issues — minor suggestions inline.

Reviewed changes

Four docs-only files recording the 2026-09-04 auth/relay outage and the Roll 1 cell roll, plus the Roll 2 close-out plan. Reviewed the full incident record (Findings 1–13 and the #19–#50 gate log), the per-item checklist, the ranked roadmap, and the Roll 2 plan. Cross-references between the four files resolve and roadmap item numbers match the checklist sections.

ℹ️ Nitpicks

  • The PR body describes the findings doc as "findings 1–8", but it actually contains Findings 1–13. Consider updating the description so readers aren't surprised by the extra sections.
  • The cell counts don't obviously reconcile across the record: the roadmap/checklist say "roll all 23 cells" and "22 of 23 cells still have it", the findings "Roll inputs" section says "20 serving cells on 5aedbca5" while listing 18 by name, and the final census enumerates 29 cells (19 general + 8 existing-only + 2 migration-only). A one-line definition of what "23 cells" counts (vs. the 29-cell census) would keep a future reader from tripping over the discrepancy.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

- [x] 4.3: ±10 % jitter on control lease renewal; unit test on the distribution; wire-compatible (server accepts early renewals already).

### 4.1 Lock contention (partial: stablyai/orca #18722 merged; ships Roll 2)
- [x] Replace the global `FOR UPDATE` over `relay_cells` with per-cell row locks; counters delta-only. Remaining: `assignOnce` placement lock is still global (optimistic snapshot follow-up). with per-cell row locks or `pg_advisory_xact_lock(cell)`; counters delta-only.

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.

Duplicated editing artifact: the trailing with per-cell row locks or \pg_advisory_xact_lock(cell)`; counters delta-only.repeats the fix description already at the start of the bullet and dangles after theassignOnce` note.

Suggested change
- [x] Replace the global `FOR UPDATE` over `relay_cells` with per-cell row locks; counters delta-only. Remaining: `assignOnce` placement lock is still global (optimistic snapshot follow-up). with per-cell row locks or `pg_advisory_xact_lock(cell)`; counters delta-only.
- [x] Replace the global `FOR UPDATE` over `relay_cells` with per-cell row locks; counters delta-only. Remaining: `assignOnce` placement lock is still global (optimistic snapshot follow-up).

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Added three relay documentation files. The roadmap lists post-outage hardening priorities and completed work. The Roll 2 plan defines staging, deployment, monitoring, rollback, follow-up, deferred items, and excluded work. The checklist tracks implementation status, uplift ranking, rollout lanes, user-visible disruption, and per-item execution steps.

Merge Risk: 🟠 High · up to 2e935

The new operational documentation is not ready to use: it conflicts on completed rollout state, Roll 2 scope, rollback images, pruner configuration, and monitoring. Following the current instructions could cause unnecessary production changes or an incorrect relay recovery.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the documentation scope and lists the included files, but it omits most required template sections, including What Changed, Why, Linked Issue in the required format, Visual Pr… Complete the required template sections. Add What Changed, Why, and Testing details; provide the linked issue using the required format; mark Visual Proof as N/A with a reason because this is documentation-only; complete or mark applicable …
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the documentation changes: reconnect findings, checklist, roadmap, and Roll 2 plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Description check

Explanation

The description explains the documentation scope and lists the included files, but it omits most required template sections, including What Changed, Why, Linked Issue in the required format, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist.

Resolution

Complete the required template sections. Add What Changed, Why, and Testing details; provide the linked issue using the required format; mark Visual Proof as N/A with a reason because this is documentation-only; complete or mark applicable sections as N/A; and complete the checklist items.

  • Fix all pre-merge checks with AI

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: 8


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: c5e78474-ec06-4364-8d09-9f84aab85cf1

📥 Commits

Reviewing files that changed from the base of the PR and between 7bb54cc and 2e935b1.

📒 Files selected for processing (4)
  • cloud/docs/relay-improvement-checklist-2026-09.md
  • cloud/docs/relay-improvement-roadmap-2026-09.md
  • cloud/docs/relay-reconnect-2026-09-findings.md
  • cloud/docs/relay-roll2-plan-2026-09.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

**Deployed to production**
- Auth instance cap 20 + dead-family audit fix (orca-cloud #474) as revision `orca-cloud-auth-00031-tox`.
- Dynamic NAT ports in both regions (stablyai/orca #18693). Zero drops and zero proxy dial errors since.
- Nine alert policies with log metrics: 4 auth (#475), 3 relay Cloud SQL/NAT (#18693), 1 cell process-exit (#18717), all on the relay Slack channel.

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 | 🟡 Minor | ⚡ Quick win

Correct the alert-policy count.

The listed categories total eight policies: 4 auth + 3 relay Cloud SQL/NAT + 1 cell process-exit. Correct “Nine” or identify the missing policy. Exact counts are needed for incident coverage audits.

Comment on lines +81 to +82
- **Roll 2 (week 2–3):** proxy `--private-ip` (2.1) + relay pool `statement_timeout` (2.3) + lock-contention
fix (4.1), all in one image/template. Prerequisite: 2.1's peering and private IP exist first.

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Remove private IP from Roll 2's hard dependency until owner approval.

These lines put the --private-ip change in Roll 2, make 2.1 a hard dependency, and say that both director and cells ride Roll 2. The Roll 2 plan defers the private-IP move and ships only flag support. Keep the flag unset for Roll 2 and document the private-IP rollout as a separate owner-approved change.

Also applies to: 96-97, 151-152

- [x] 4.3: ±10 % jitter on control lease renewal; unit test on the distribution; wire-compatible (server accepts early renewals already).

### 4.1 Lock contention (partial: stablyai/orca #18722 merged; ships Roll 2)
- [x] Replace the global `FOR UPDATE` over `relay_cells` with per-cell row locks; counters delta-only. Remaining: `assignOnce` placement lock is still global (optimistic snapshot follow-up). with per-cell row locks or `pg_advisory_xact_lock(cell)`; counters delta-only.

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 | 🟡 Minor | ⚡ Quick win

Make the lock-fix status unambiguous.

This line marks the replacement complete, says that assignOnce remains global, and then appends a second alternative: “per-cell row locks or pg_advisory_xact_lock(cell).” State which lock strategy shipped and list assignOnce as the remaining follow-up in a separate sentence.

Comment on lines +182 to +183
- [ ] Director: honor requested region when the preferred region has headroom, else sticky. Behind the existing flag.
- [ ] Measure with `orca_relay_runtime_metrics` region counters before/after.

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 3 'orca_relay_runtime_metrics|region.*label|label.*region' \
  cloud --glob '*.tf' --glob '*.ts' --glob '*.md'

Repository: stablyai/orca

Length of output: 14724


Restore a region-level metric before measuring item 4.2. The orca_relay_runtime_metrics definitions omit the region label, so the planned measurement cannot distinguish Asia from US. Add a compatible region-level metric or revise item 4.2 to use an available measurement.


| # | Item | Why | How | Size |
|---|---|---|---|---|
| 1.1 | **Roll all 23 cells onto the current relay image** | Every cell still runs the image that exits the whole process on a Postgres connect timeout (Finding 6). The fixed image runs only on the director and c7. Any future DB stall repeats the 200-crashes-in-48h pattern. | `cloud-deploy-relay-production-same-cap` waves, gated by the 15-min monitor. Roll inputs and canary results are in the findings doc ("Roll inputs", "Canary blast radius"). | one afternoon |

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 | ⚡ Quick win

Synchronize the active status across the roadmap and checklist.

  • cloud/docs/relay-improvement-roadmap-2026-09.md#L12-L12: replace the pre-Roll 1 claim that all cells still need the old-image rollout.
  • cloud/docs/relay-improvement-roadmap-2026-09.md#L67-L67: update the old-image census and retain only the documented exceptions.
  • cloud/docs/relay-improvement-checklist-2026-09.md#L7-L9: update the status cutoff to include the September 5 completion records.
  • cloud/docs/relay-improvement-checklist-2026-09.md#L33-L39: move completed Roll 1 and #478 actions out of “Awaiting owner go.”
📍 Affects 2 files
  • cloud/docs/relay-improvement-roadmap-2026-09.md#L12-L12 (this comment)
  • cloud/docs/relay-improvement-roadmap-2026-09.md#L67-L67
  • cloud/docs/relay-improvement-checklist-2026-09.md#L7-L9
  • cloud/docs/relay-improvement-checklist-2026-09.md#L33-L39

| # | Item | Why | How | Size |
|---|---|---|---|---|
| 1.1 | **Roll all 23 cells onto the current relay image** | Every cell still runs the image that exits the whole process on a Postgres connect timeout (Finding 6). The fixed image runs only on the director and c7. Any future DB stall repeats the 200-crashes-in-48h pattern. | `cloud-deploy-relay-production-same-cap` waves, gated by the 15-min monitor. Roll inputs and canary results are in the findings doc ("Roll inputs", "Canary blast radius"). | one afternoon |
| 1.2 | **Enable the refresh_tokens pruning job** (orca-cloud #476, merged, off) | `refresh_tokens` is 63 M rows / 26 GB and grows forever; its size is what turned a slow disk into a sign-out storm (Finding 13). | Build an auth image from main (the 21:04Z deploy already contains the entrypoint: `orca-cloud-auth-00031-tox`, digest `343a0915…`), set `auth_token_pruner_enabled = true` and the image digest in `infra/terraform-apps/environments/production.tfvars`, apply targeted. First run with a small `auth_token_pruner_max_deleted_rows`. Watch the run summary's `stopReason`, not the exit code. ~48 M rows drain in ~10 days at 200k/hour. | 1 hour + 10 days of watching |

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.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n 'auth_token_pruner_(max_deleted_rows|max_rows_per_run)' \
  --glob '*.tf' --glob '*.tfvars' --glob '*.ts' --glob '*.md'

Repository: stablyai/orca

Length of output: 151


🤖 get_repo_knowledge executed:

get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions

Length of output: 42980


🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' '--- matching files ---'
git ls-files | rg '(^|/)(cloud/docs|.*(roadmap|roll.?2|checklist|pruner|refresh_tokens).*)'
printf '%s\n' '--- exact identifier occurrences ---'
git grep -n -E 'auth_token_pruner_(max_deleted_rows|max_rows_per_run)' -- ':!node_modules' || true
printf '%s\n' '--- roadmap context ---'
sed -n '1,25p' cloud/docs/relay-improvement-roadmap-2026-09.md

Repository: stablyai/orca

Length of output: 6659


🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' '--- cloud documentation files ---'
git ls-files cloud/docs | sort
printf '%s\n' '--- all pruner-related references in cloud docs ---'
rg -n -i 'pruner|refresh_tokens|max_deleted|max_rows_per_run' cloud/docs || true

Repository: stablyai/orca

Length of output: 7579


Update the roadmap to use the canonical pruner setting.

The checklist and Roll 2 plan use auth_token_pruner_max_rows_per_run, and the findings record that setting as applied. The roadmap still uses auth_token_pruner_max_deleted_rows and says the job is off. Update the identifier and deployment status to prevent operators from using stale instructions.

-f predecessor-image-digest=<serving digest>`. Blue/green; prior revision stays as rollback.
Watch director `orca_relay_postgres_transaction_retry` per minute before and after. The director
goes first so the per-cell locks are live before any cell restart burst.
4. Same-cap `verify` mode against c7 with target=<new>, rollback=`519f4914`. Read-only.

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 | ⚡ Quick win

Use c7's current image as the rollback value.

This step uses rollback=\519f4914`for c7, but the plan states that c7 serves85bf6799and later gives c7's rollback as85bf6799`. Use the c7-specific value here. Otherwise the verify or recovery path can target an image that is not c7's previous serving image.

Proposed correction
-4. Same-cap `verify` mode against c7 with target=<new>, rollback=`519f4914`. Read-only.
+4. Same-cap `verify` mode against c7 with target=<new>, rollback=`85bf6799`. Read-only.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
4. Same-cap `verify` mode against c7 with target=<new>, rollback=`519f4914`. Read-only.
4. Same-cap `verify` mode against c7 with target=<new>, rollback=`85bf6799`. Read-only.

Comment on lines +116 to +119
Failure handling: a failed canary re-enters through `mode=rollback` with rollback-digest = desired
image (Roll 1 c27 pattern). A gate freeze on an Asia latency probe despite the 4 000 ms bar is a
stop-and-investigate, not a retry. Monitor-side freezes (freshness, continuity deadline) re-gate
after a 2 min back-off; the chain does this on its own.

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 | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 5 'rollback-digest|mode=rollback|canary-apply' \
  --glob '*.yml' --glob '*.yaml' --glob '*.md'

Repository: stablyai/orca

Length of output: 151


🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' '--- target document ---'
sed -n '1,150p' cloud/docs/relay-roll2-plan-2026-09.md
printf '%s\n' '--- repository references ---'
rg -n -C 6 'rollback-digest|mode=rollback|canary-apply|Roll 1|c27|519f4914|85bf6799' . \
  --glob '!node_modules' --glob '!dist' --glob '!build'
printf '%s\n' '--- workflow and automation files ---'
git ls-files | rg '(^|/)(\.github/workflows|.*workflow.*|.*canary.*|.*relay.*|.*roll.*)' | head -200

Repository: stablyai/orca

Length of output: 50370


🤖 get_repo_knowledge executed:

get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions

Length of output: 18141


🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' '--- plan lines 70-125 ---'
sed -n '70,125p' cloud/docs/relay-roll2-plan-2026-09.md
printf '%s\n' '--- exact rollback option references ---'
rg -n -C 4 'rollback-digest|rollbackDigest|mode[=:][[:space:]]*rollback|mode=rollback' \
  cloud .github --glob '*.yml' --glob '*.yaml' --glob '*.mjs' --glob '*.md' --glob '*.json' \
  | head -300
printf '%s\n' '--- candidate workflow files ---'
git ls-files cloud .github | rg 'relay|roll|workflow|admission|same-cap' | rg '\.(yml|yaml|mjs|md)$' | head -250

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' '--- same-cap workflow inputs and rollback path ---'
sed -n '1,180p' .github/workflows/cloud-deploy-relay-production-same-cap.yml
sed -n '240,315p' .github/workflows/cloud-deploy-relay-production-same-cap.yml
printf '%s\n' '--- same-cap job rollback variables and apply command ---'
rg -n -C 8 'ROLLBACK|rollback|TARGET_DIGEST|target-image-digest|rollback-image-digest|selectedImage|--image|--rollback-image|mode' \
  .github/workflows/cloud-deploy-relay-production-same-cap-job.yml \
  cloud/dev/scripts/relay-production-same-cap-wave.mjs \
  cloud/dev/scripts/validate-relay-capacity-plan.mjs

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '1,180p' .github/workflows/cloud-deploy-relay-production-same-cap.yml
sed -n '240,315p' .github/workflows/cloud-deploy-relay-production-same-cap.yml
rg -n -C 8 'ROLLBACK|rollback|TARGET_DIGEST|target-image-digest|rollback-image-digest|selectedImage|--image|--rollback-image|mode' \
  .github/workflows/cloud-deploy-relay-production-same-cap-job.yml \
  cloud/dev/scripts/relay-production-same-cap-wave.mjs \
  cloud/dev/scripts/validate-relay-capacity-plan.mjs

Repository: stablyai/orca

Length of output: 50370


Distinguish pre-apply recovery from post-apply rollback. mode=rollback applies rollback-image-digest as DESIRED_IMAGE_DIGEST. Roll 1 c27 used 519f4914 because the canary failed before applying the target. If a Roll 2 canary already applied <new>, use the prior serving digest: 85bf6799 for c7 and 519f4914 for the other cells. Document the live-image condition instead of saying “desired image.”

@Jinwoo-H
Jinwoo-H merged commit 3bb038a into main Sep 6, 2026
25 checks passed
@Jinwoo-H
Jinwoo-H deleted the relay-reconnect-2026-09-docs branch September 6, 2026 00:21
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ap, and Roll 2 plan (stablyai#18958)

Operator record for the 2026-09-04 relay reconnect incident and the Roll 1
same-cap cell image roll (complete 2026-09-05, selector gen 148), plus the
follow-up checklist, roadmap, and the Roll 2 implementation plan.
Docs only; split out of stablyai#18565 so the record merges independently of the code.
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