Repository navigation
config(sync): turn off the per-UID backfill sequencer in prod - #21883
Merged
Merged
Conversation
With the sequencer on, each user's backfill uploads ran one worker job at a time. Pendant users record faster than that drains, so their queues only grow; anything still waiting after the 24h sync-job TTL is retired unprocessed and re-uploaded behind the same queue. Prod had 508,369 pending entries across 1,724 users, about 251k past the TTL. 'off' is the flag's documented kill switch: new backfill uploads dispatch straight to Cloud Tasks (sync-backfill queue, 90 concurrent), and the Scheduler sweep keeps draining the entries already queued.
mdmohsin7
added a commit
that referenced
this pull request
Oct 16, 2026
… off (#21909) ## Summary With `SYNC_BACKFILL_UID_SEQUENCER=off`, the backfill worker now processes direct backfill jobs immediately. Before this change it still sent them back into the one-per-UID queue whenever the user had an active or pending sequenced entry. ## Why #21883 turned the sequencer off, and it is off on both prod sync services now. Ten minutes after the switch, sequencer registrations were unchanged (1,414 → 1,594 per 10 min), and every one came from the backfill worker. The worker's cutover branch (`run_sync_job`, epoch-less backfill payloads) did two things when the flag was off: - It re-registered the job into the sequencer if the user had an active owner or any pending entry. - Otherwise it called `refresh_direct_run`, which makes `kick()` defer that user's sequenced drain. All 1,724 users with a backlog still have pending entries (502k total), so the kill switch changed nothing for them. ## Change - The cutover branch now runs only when the sequencer is on. Flag off goes straight to `_run_sync_job_body`, and the already-sequenced entries keep draining through `kick`/Scheduler in parallel. - Sequenced deliveries (those carrying `sequencer_epoch`) are untouched. They still finish their job and kick the next one. Trade-off: with the flag off, a user's direct jobs and their leftover sequenced jobs can run concurrently. That is the pre-sequencer behaviour, paced by the Cloud Tasks queue. ## Product invariants affected none ## Failure class Failure-Class: new Adds `FC-kill-switch-keeps-the-gated-path`: a rollout flag turned off must stop admitting new work to the gated path, even while leftover state from the flag-on period exists. ## Verification - `test_old_backfill_task_migrates_on_flag_on_and_runs_direct_when_off` now asserts that, with the flag off, a direct job runs and is not registered for an idle owner, an active owner, or a pending backlog, and that `refresh_direct_run` is never called. The old code registers in the last two cases, so the test fails on it. - `test_sync_task_persistence_fence_terminalizes_backfill_and_releases_its_slot` no longer pads the adoption read that the flag-off path no longer makes. - `tests/unit/test_sync_cloud_tasks.py` and `tests/unit/test_sync_backfill_uid_sequencer.py`: the same 11 failures as unmodified `main` in my local environment, and nothing new. 🤖 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/21909?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/21909?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F21909&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. -->
This was referenced Oct 16, 2026
Merged
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
Turns
SYNC_BACKFILL_UID_SEQUENCERoff forbackend-syncandbackend-sync-backfill(dev and prod) so offline-sync backfill uploads are no longer processed one job per user at a time.Why
Users report offline recordings that never get processed, with the backlog growing daily.
offis the flag's documented kill switch. New backfill uploads dispatch directly to Cloud Tasks, which has room for 90 concurrent jobs on the backfill queue. The Scheduler sweep keeps draining entries already queued, so the Scheduler must stay enabled.Changes
backend/deploy/runtime_env/_base.yaml:SYNC_BACKFILL_UID_SEQUENCERon→offfor both sync services.backend/deploy/runtime_env.yaml: regenerated.config/feature-flags.yaml: registry note updated.Product invariants affected
INV-MEM-4: unaffected. This only changes how offline-sync backfill jobs are dispatched; memory admission still goes through canonical consolidation.Verification
python3 backend/deploy/compose_runtime_env.py --checkreports the manifest is up to date.off.sync_uid_sequencer action=registeredstops on new uploads, that backfill jobs finalize, and that the pending count falls.🤖 Generated with Claude Code