Skip to content

config(firestore): ramp singleton_loops to 100% - #21971

Merged
Git-on-my-level merged 1 commit into
mainfrom
config/firestore-reads-singleton100
Oct 17, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
config/firestore-reads-singleton100

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Firestore reads loop: ramp singleton_loops 5% → 100% (all other levers unchanged; backfill_task_reads stays 5%).

  • singleton_loops puts the six reconcile/finalization loops and the queue-age publisher behind a Redis leader lease so one replica runs each loop per interval instead of every replica. Its callers account for ~290M reads/day by caller match; the two-lane cost analysis ranks this as a ~$45–51/day same-day cut.
  • Lease evidence at 5% (GKE in-cluster Prometheus, 6h): each reconcile loop acquired ~24× (once per interval), ownership hands off between listen pods, other pods skipped; Redis errors fall open to running locally.
  • Gate (≥30 min after listen is live): every reconcile loop acquires ≥1, 5xx rate clean on backend / backend-sync / desktop-backend, singleton callers' reads drop. Breach → back to 5% via set_levers.py.
  • Config only, generated with avo/firestore-reads/set_levers.py.

Product invariants

  • INV-DATA-1 / INV-MEM-4: no data-path change; loops keep their cadence (one leader per interval) and fail open on Redis errors (lease max-hold cap 900 s).

Test plan

  • test_render_backend_runtime_env.py, test_verify_pusher_config_references.py pass locally.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T03:15:41.347251Z 665ac2c PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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