Repository navigation
config(firestore): flag off singleton_loops (lease starvation UNSAFE x2 ticks at 5%) - #22851
Merged
Merged
Conversation
…x2 ticks at 5%) verify 2026-10-20T09:00:37Z: all five reconcile loops acquired=0, skipped_owner~44/h for a full hour (08Z tick: lease metrics absent = scrape gap; 09Z present: publisher loop acquired=6 in the same scrape), starvation signature re-observed 4 days after WQ1 lease rework merged (#22142). Flag off per runbook pending lease root-cause; four 5xx-guard refs and the other 12 keys unchanged.
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. |
This was referenced Oct 20, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Oct 20, 2026
#22926) ## Summary Restore the Firestore reads loop's visibility into `backend-sync`, `backend-sync-backfill` and `backend-integration`. #22118 (merged 2026-10-18 08:26Z, live ~13Z) gave those three services a revision-local GMP keep-regex. The regex omits `omi_firestore_billed_reads_by_{caller,origin}_total`, `omi_firestore_caller_label_overflow_total` and `omi_fsr_leader_lease_total`. Since then: - **Attribution blind spot.** The three services disappeared from per-caller read attribution in Managed Prometheus. At the 10-18 08Z trough they carried 320M reads/day (GMP 24h: sync 142.4M, backfill 150.4M, integration 26.9M). By subtraction they now carry about 500M of the fleet's 926M/day. That's the largest growth in the 10-18 → 10-20 regression (648M → 1007M/day), and the loop could not rank it. - **False lever flag-off.** The `singleton_loops` lease gate went blind to holders on those services. On 10-20 09Z, listen showed `skipped_owner` 44–69/h with `acquired=0`. The loop graded that as starvation and flagged the lever off (#22851). In `fsr_admit`, a recovery loop returns `skipped_owner` only while the tick key is live, and only an admission sets that key, so the work was running on an unscraped holder. This PR keeps the four families: about 270 series per instance on 10-18, against the sidecar's `samples: 10000` limit. It also pins them in `test_sync_scrape_retains_exporter_and_direct_sentinel_consumers`, so a future trim fails in CI instead of at ingestion. Predicted reads/day saved: **0 directly**. It restores attribution for about 55% of fleet reads and the lease evidence needed to re-ramp `singleton_loops`, which measured −119M/day on its callers at 100% on 10-17. Measurement line: after the Cloud Run train, `avo/firestore-reads/measure.py` shows `origins.missing_services == []` and `coverage_1h` ≥ 0.8 (0.381 at 10-20 18Z). The GMP query `sum by (service_name) (increase(omi_firestore_billed_reads_by_caller_total[1h]))` returns rows for all three services again. ## Lane / contract fs-regress (P1, two-lane rollout swarm 10-20). Owner sign-offs: none needed; the sync scrape profile comment block already says consumer changes update the allowlist and its test together. ## Product invariants affected none ## Verification - `backend/test.sh` with `BACKEND_UNIT_TEST_FILE_LIST` = `test_attach_cloud_run_gmp_sidecar.py` + `test_parakeet_request_metrics.py`: 7 passed (unit layer; regex contract only). - Prod series counts (GMP, `ro-prod`, aggregates): `max by (service_name) (count by (service_name, instance) (omi_firestore_billed_reads_by_caller_total))` at 10-18 08Z: sync 149, backfill 140, integration 115; origin series 100/62/79. - Not run: a collector startup or prod scrape. That's the deploy layer, measured by the line above. ## Rollback Revert this commit; the next Cloud Run train drops the four families again. No application behavior depends on the scrape. ## Deploy Cloud Run train (`backend-sync`, `backend-sync-backfill`, `backend-integration` revisions pick up the collector config). Owned by the rollout lead. Failure-Class: FC-metric-dropped-by-scrape-allowlist 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/22926?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/22926?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F22926&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Git-on-my-level
added a commit
that referenced
this pull request
Oct 20, 2026
…et; singleton_loops 25% (#22929) ## Summary Re-graduate two proven Firestore read levers stuck below 100%, and restart `singleton_loops` at 25%. This changes only the `FIRESTORE_READ_LEVERS` literal: runtime_env `_base.yaml` → rendered `runtime_env.yaml`, listen + pusher dev/prod values, flag registry, and the two contract tests that pin the literal. Generated with `avo/firestore-reads/set_levers.py` as the complete 13-key literal. | Lever | From → to | Evidence | Predicted reads/day saved | |---|---|---|---| | `usage_month_cache` | 5 → 100 | −45.0M/day absolute at 100% on 10-17 (loop readout `readout-2026-10-17T20Z-absolute.json`). It was flagged off 10-18 on an ambiguous backend-sync 5xx guard that stayed elevated with the lever at 0, then ran at 5% from 10-20 05Z with guards in band. | **~35–39M**. Its caller `user_usage:get_monthly_usage_stats_since` is 43.2M/day now (listen 33.1M + backend 10.1M, 24h to 10-20T17Z) vs ~4.9M/day at 100% on 10-17. | | `queue_age_sample_budget` | 5 → 100 | At 5% since 10-20 05Z with no guard breach (WQ3, reviewed SAFE in #22142). | Unknown until measured. Caller `durable_queue_age:_sample_status_page` is 46.8M/day visible (listen 40.3M, backend 6.5M) plus the sync services. It overlaps `singleton_loops`; never sum the two. | | `singleton_loops` | 0 → 25 | At 100% on 10-17: −119M/day on its callers (ledger READOUT 2026-10-17T05:20Z). The 10-20T09Z flag-off (#22851) read `acquired=0 / skipped_owner>0` on listen. `fsr_admit` returns `skipped_owner` for a recovery loop only while the tick key is live, and only an admission sets it, so the holder ran on backend-sync, whose lease counter #22118 hid (fixed in the companion PR). 25% first per the loop runbook until lease evidence is visible on every service. | Unknown at 25%. Visible callers are 93M/day on listen + backend. Per-process cohorts mean savings scale with the cohort share. | Measurement line: the Firestore reads loop (`avo/firestore-reads`) grades each lever from the served revision. `usage_month_cache` is graded on absolute caller reads vs `baseline-2026-10-20T05-00Z.json` (`get_monthly_usage_stats_since` 1.24M reads/h on backend). Fleet total is `progress.py` HEADLINE (926M/day at 10-20T17Z). ## Lane / contract fs-regress (P1, two-lane rollout swarm 10-20), on behalf of the `firestore-reads` loop (work items WQ8, WQ3, WQ1 → WQ10). ## Product invariants affected INV-MEM-4: path match only. The lever literal appears in a file under the INV-MEM-4 glob; no memory promotion, consolidation or intake behavior changes. `historical_scan_memo` and the other memory-path levers keep their current values. ## Verification - `backend/test.sh` with `BACKEND_UNIT_TEST_FILE_LIST` = `test_render_backend_runtime_env.py`, `test_verify_pusher_config_references.py`, `test_firestore_read_levers.py`, `test_fsr_s2_singleton_loops.py`, `test_fsr_wq3_queue_age_budget.py`, `test_fsr_s4_caches.py`: 70 passed (unit layer). - Precondition from the loop runbook for any `singleton_loops` enable: `FSR_QUEUE_AGE_PUBLISHER=1` in prod listen values, and `omi_queue_oldest_ready_age_seconds` present on listen (200 series) and Cloud Run (490) at 10-20 18:30Z (in-cluster Prometheus, `ro-prod`). - Not run: any deploy. Live effect is measured by the loop after the lead's train. ## Rollback Each lever is its own kill switch. `set_levers.py` with the previous literal (`usage_month_cache` 5, `queue_age_sample_budget` 5, `singleton_loops` 0), or revert this commit. The loop's hourly verify flags a lever off on a 5xx or lease breach. ## Deploy `FIRESTORE_READ_LEVERS` train order: **listen → pusher → Cloud Run** (the Cloud Run candidate check compares listen/pusher env against main). Ship together with or after the companion sync-GMP scrape PR, so the `singleton_loops` lease gate can see every holder. Owned by the rollout lead. Failure-Class: none 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/22929?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/22929?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F22929&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
kriegcloud
pushed a commit
to kriegcloud/omi
that referenced
this pull request
Oct 20, 2026
BasedHardware#22118 gave backend-sync, backend-sync-backfill and backend-integration a metric keep-regex that omits omi_firestore_billed_reads_by_{caller,origin}_total, omi_firestore_caller_label_overflow_total and omi_fsr_leader_lease_total. From 2026-10-18 ~13Z those three services vanished from per-caller read attribution (320M reads/day at the 10-18 trough; ~500M/day now by subtraction) and from the singleton_loops lease gate, which then graded a healthy backend-sync lease holder as starvation and flagged the lever off (BasedHardware#22851). Keep the four families (~270 series per instance against the 10000-sample limit) and pin them in the scrape contract test. Failure-Class: FC-metric-dropped-by-scrape-allowlist Co-Authored-By: Claude Opus 5.5 <[email protected]>
kriegcloud
pushed a commit
to kriegcloud/omi
that referenced
this pull request
Oct 20, 2026
…et; singleton_loops 25% FIRESTORE_READ_LEVERS literal only (runtime_env, listen + pusher values, flag registry, two pinned contract tests): - usage_month_cache 5 -> 100: measured -45.0M reads/day at 100% on 10-17; flagged off 10-18 on an ambiguous backend-sync 5xx guard that stayed elevated with the lever at 0. Its caller is 43.2M/day now (listen 33.1M, backend 10.1M, 24h to 10-20T17Z). - queue_age_sample_budget 5 -> 100: 5% since 10-20 05Z with no guard breach. - singleton_loops 0 -> 25: the 10-20T09Z "starvation" flag-off (BasedHardware#22851) read acquired=0 / skipped_owner>0 on listen; skipped_owner proves a live tick key, i.e. an admission on a holder whose lease counter BasedHardware#22118 hid. 25% first per the loop runbook until lease_1h is visible on every service. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Firestore reads loop config:
singleton_loops5 → 0, all other 12 keys byte-identical to the deployed literal (#22629 state). Single-lever emergency flag-off, generated withavo/firestore-reads/set_levers.py.2026-10-20T09:00:37Z— all five reconcile loops (reconcile_abandoned_byok_finalization_jobs,reconcile_listen_finalization_jobs,reconcile_pending_deletion_wipes,reconcile_stale_in_progress_conversations,reconcile_stale_processing_conversations) showacquired=0, skipped_owner≈44/hfor the whole 08–09Z hour at 5% cohort. The 08Z tick's "lease metrics absent" was a scrape gap; the 09Z scrape is present and healthy for the publisher loop (publish_all_queue_oldest_ready_ages acquired=6in the same window), so this is a real starvation signature, re-observed 4 days after the WQ1 lease rework merge (perf(firestore): singleton lease fail-open rework + queue-age sample budget lever (dark, WQ1+WQ3) #22142, takeover ≤300s). At 05–06Z the same loops acquired 4–6/h (normal 900s max-hold rotation), so the onset is 07–08Z.lease_1hacquisitions across at least one other session's deploy.Rendered literal identical across
_base.yaml, regeneratedruntime_env.yaml, listen/pusher dev+prod values, the flag registry doc, and the two pinned contract tests. The literal keeps all 13 keys — missing keys default OFF (backend/config/firestore_read_levers.py) — so the graduated levers stay explicit.Product invariants affected
FIRESTORE_READ_LEVERSkey.Test plan
backend/tests/unit/test_verify_pusher_config_references.py+backend/tests/unit/test_render_backend_runtime_env.py: 112 passed locally (lane venv, this commit).scripts/render_feature_flag_registry.py—FIRESTORE_READ_LEVERSrow nowsingleton_loops:0for dev+prod.Rollout
Review chain (zcode glm-5.3): recorded in this PR body before merge.