Repository navigation
docs(backend): C025 runbook — regionalize syncing-local staging bucket to us-central1 - #21242
Conversation
Cost ledger card C025: prod syncing-local is multi-region, paying replication for <=8-minute staging blobs (+$46/day WoW). Runbook covers replacement bucket provisioning, intake pause + job drain (queued raw audio can outlive 8 min), 15-min signed-URL cache waitout, env flip in all four chart values, rollback, and old-bucket deletion gates.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d01c19c319
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| and unused raw blobs drain via the one-day lifecycle. Account-deletion | ||
| cleanup resolves only the currently configured temporal bucket: ensure old | ||
| processes/URLs are drained and the old bucket expires leftovers; do not |
There was a problem hiding this comment.
Fence account-deletion jobs during the bucket flip
When an account-deletion task is queued before the flip but executes after backend-sync starts with the new value, backend/utils/other/storage.py::delete_all_user_storage_objects() scans syncing/{uid}/ only in the currently configured bucket, so the task can mark the wipe complete while that user's raw audio remains in the old bucket until asynchronous lifecycle cleanup. The procedure drains only sync work and explicitly relies on expiry here; fence and drain deletion admissions/tasks too, or make the wipe cover both buckets, before changing the env.
AGENTS.md reference: backend/AGENTS.md:L145-L145
Useful? React with 👍 / 👎.
| `syncing-local-us-central1`. For dev, change both corresponding `dev_` files | ||
| to `syncing-local-development-us-central1` after dev provisioning. |
There was a problem hiding this comment.
Keep an already-regional dev bucket configured
When preflight finds syncing-local-development already regional, the earlier branch says not to create a replacement, but this step still switches both dev charts and the later Cloud Run values to syncing-local-development-us-central1. In that permitted path the named replacement was never provisioned, so the dev rollout loses staging access; make this update conditional and retain the verified existing name when provisioning is skipped.
Useful? React with 👍 / 👎.
|
Hermetic E2E + Merge Gate red is pre-existing on main: the same workflow fails on main at 2f0e9b2 (this PR's base, 17:27Z run) and a36fe08 (17:34Z), and multiple unrelated PR branches failed in the same 17:56–18:10Z window while others passed — 'Memory read admission exhausted' is the #21227 admission machinery tripping inside the shared hermetic harness. Absent from this diff (docs-only). Rerunning the failed jobs. |
|
Red hermetic/unit checks root-caused and fixed in #21249 (first-attempt admission gated on document headroom denied legitimate truncated pages with 503 'Memory read admission exhausted'; reproduced on clean main, fix validated against #21227's own suites). Once #21249 merges, base-updating this PR should clear the shared failures; rerunning failed jobs in the meantime. |
…rdware#21249) into cost/c025-syncing-local-region
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab37d80099
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # deterministically (attempts=0 → MemoryReadAdmissionDenied). Raise the | ||
| # burst for this suite and give every test a fresh allowance — the shared | ||
| # module-global instance otherwise carries spent tokens between tests. | ||
| import utils.memory.read_resilience as _rr |
There was a problem hiding this comment.
Move the resilience import to module scope
Move utils.memory.read_resilience into the top-level import block rather than importing it when this fixture executes; otherwise this test's module graph depends on fixture ordering and violates the backend's strict requirement that imports never live inside functions.
AGENTS.md reference: backend/AGENTS.md:L161-L161
Useful? React with 👍 / 👎.
…to cost/c025-syncing-local-region
Grok review (read-only) found two blockers in the no-copy drain: Firestore sync_backfill_pending docs carry raw_blob_paths and survive a Cloud Tasks + Redis drain (expire as sync_staged_audio_expired post-flip); failed/partial backfill jobs keep staged blobs and recover_dev_failed_sync_backfill.py resolves paths against the current bucket env. Runbook now requires the sequencer queue drained + recoverable failed/partial jobs finished or copied before the flip, accounts chat voice-message staging in the URL-cache clock, and documents the backfill clone-order hazard.
|
Both BLOCKERs fixed in c610554 (verified against |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c610554392
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 4. Change `BUCKET_TEMPORAL_SYNC_LOCAL` in **both** prod charts: | ||
| `backend/charts/backend-listen/prod_omi_backend_listen_values.yaml` and | ||
| `backend/charts/pusher/prod_omi_pusher_values.yaml` to | ||
| `syncing-local-us-central1`. For dev, change both corresponding `dev_` files |
There was a problem hiding this comment.
Deploy the bucket name selected during provisioning
When syncing-local-us-central1 is globally occupied—the provisioning section explicitly permits choosing a different unique name—this line still directs both production charts to the fixed occupied name. The later Cloud Run literal will then either diverge from Helm if it uses the bucket actually created, or every producer will target a bucket this procedure never provisioned if it copies this literal, breaking the cutover uploads; use the recorded/provisioned C025_NEW value in every chart and runtime overlay instead.
AGENTS.md reference: backend/AGENTS.md:L151-L151
Useful? React with 👍 / 👎.
|
Re-review (cursor grok-4.7-high, read-only — agentctl exec-horse-lion-fresh-nest-access-weather): VERDICT: APPROVE. Both prior blockers verified closed against the code (sequencer pending-doc semantics in |
What
Ops runbook for regionalizing the sync v2 temporal staging bucket (
syncing-localprod,syncing-local-developmentdev) from multi-region tous-central1, where every serving consumer (backend, backend-sync, pusher) already runs. Docs-only change — no code touched.Why
Cost ledger card C025 (MEASURED, billing export): the bucket pays "Network Data Transfer GCP Replication within Northern America" for staging blobs, plus multi-region Class A unit prices. Combined ops+replication across the sync buckets stepped 2026-10-06 from ~$41/day to ~$129/day run rate (+$46/day WoW ex-drip), scaling with sync v2 adoption. The staging bucket's blobs are disposable (480s janitor + 1-day lifecycle backstop), so multi-region durability buys nothing here. Avoidable share modelled ~$40–60/day at current volume (replication line removal + lower Class A unit price; Class B list prices are identical multi-region vs regional).
What the runbook covers
raw_blob_paths, resolved against the worker's current env). So the cutover requires: pause intake → drain Cloud Tasks/sequenced/retry jobs → wait out the 15-min signed-URL Redis cache → flipBUCKET_TEMPORAL_SYNC_LOCALin all four chart values (prod+dev, backend-listen+pusher) → deploy → verify → resume.omi-private-cloud-syncbucket is explicitly out of scope.Verification
BUCKET_TEMPORAL_SYNC_LOCALwiring site enumerated (4 chart values files, storage.py, recovery script, export_openapi, test harnesses).make preflightpassed (13 checks). Docs-only; no tests required.Deploy note
The GCP-side bucket provisioning + cutover is an operator procedure executed per the runbook after merge; chart values intentionally remain unchanged in this PR until the new buckets exist.
🤖 Generated with Claude Code
Product invariants affected