Repository navigation
fix(sync): isolate backfill UID sequencer from dev - #19647
Merged
Merged
Conversation
Failure-Class: FC-sync-backfill-cross-environment-state
Failure-Class: FC-sync-backfill-cross-environment-state
Failure-Class: FC-sync-backfill-cross-environment-state
Failure-Class: FC-sync-backfill-cross-environment-state
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
failure_stagefor attribution.Incident cause and limits
Dev and prod used the same Firestore sequencer collections and Redis host. The dev sweep could claim prod pending work, and dev workers then failed staged-audio downloads against the dev bucket. The shared global cutover guard wrote a 30-minute deadline whenever its mode key was not
on, including when missing. That branch explains the observed synchronized 30-minute stalls. The available aggregates do not prove whether an unobserved direct admission, Redis eviction, or a reset made the key non-on;legacy_migrationlog events do not write the mode key.Historical dev-side
sync_staged_audio_expiredevents do not prove prod objects remain. The supplied aggregate count has no job IDs, UIDs, or task payloads. Recovery requires a reviewed manifest correlating dev failure events with retained task metadata. The script checks only Redis job and GCS object-existence metadata; it downloads no audio. No production data or service was accessed or changed for this PR.Rollout and recovery
After merge, deploy the new code to both dev sync services at 100% traffic; verify no old dev revision serves traffic or has an in-flight request; only then resume the dev sync-jobs and sync-backfill queues. Keep the dev sequencer Scheduler job paused. Old prod revisions retain their current keys and documents during the prod mixed-revision window. No scheduler or GCP configuration is changed here.
Dry-run command from
backend/after separately authorized production credentials and a reviewed JSONL manifest are prepared:A later authorized recovery adds
--apply. Seebackend/docs/runbooks/sync-backfill-sequencer-env-isolation.mdfor selection, input, and idempotency details. The script was not run against prod. Apply now resumes an existing deterministic recovery job after interruption at creation, ledger claim, registration, or kick; tests cover each boundary. Dev sequenced and legacy backfill deliveries ACK before any Redis or registry access.Verification
backend/.venv/bin/python -m pytest -q tests/unit/test_sync_stage_isolation.py tests/unit/test_sync_backfill_uid_sequencer.py tests/unit/test_recover_dev_failed_sync_backfill.py tests/unit/test_sync_cloud_tasks.py tests/unit/test_sync_backfill_inflight_limit.py tests/unit/test_sync_dead_letters.pyfrombackend/: 185 passed.backend/.venv/bin/python -m pytest -q tests/unit/test_sync_status_read_ownership.pyfrombackend/: 12 passed.backend/.venv/bin/python -m pytest -q tests/unit/test_sync_capture_pipeline.pyfrombackend/: 20 passed.npm run test:sync-cloud-tasks-stack:emulator: passed with isolated Firestore and Redis.bash backend/testing/e2e/run.sh -q --tb=short: 120 passed, 3 skipped, 2 xfailed with an explicit offline stage.backend/.venv/bin/python -m pytest -q tests/unit/test_sync_job_stale_self_heal.py tests/unit/test_sync_jobs_corrupt_blob.py tests/unit/test_sync_two_lane.py tests/unit/test_sync_v2.pyfrombackend/: 224 passed with explicit prod stage fixtures.test_sync_ledger_fence_cutover.pystalled during collection in an attempted wider run; it was stopped without running tests.OMI_PR_BODY_FILE=/tmp/omi-sequencer-env-scope-pr-body.md make preflight: 33 checks passed.scripts/failure-class validate --pr-body-file /tmp/omi-sequencer-env-scope-pr-body.md: passed.Missing or unknown
OMI_ENV_STAGEnow logs an invalid sync-stage error and returns HTTP 503 from every sync route. Strict stage selection also rejects all sync Redis key and Firestore collection access before choosing a name. Only explicitprod,dev,local, andofflinestages are accepted.Failure-Class: new
🤖 Generated with Claude Code