Skip to content

fix(deploy): trains stop reverting the recovery queue and the fresh queue re-points - #22460

Merged
Git-on-my-level merged 2 commits into
mainfrom
fix/deploy-queue-ops-literals
Oct 19, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
fix/deploy-queue-ops-literals

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Prod-track fix that must land before the next backend train: deploys stop reverting operator queue fixes.

Why

  • The 07:07Z train (733a74a, run 39211633982) reset batch-quarantine-recovery from the operator's 16/8 (01:27Z) back to the deploy-action literal 4/4.
    • Recovery then ran about 3–6/min against about 8 quarantines/min, and quarantine→projection p95 reached 383s at the gate (1,285s at 08:33Z).
    • The 5% record-lane re-qualification failed. Evidence: workspace data/run-2026-10-13-two-lane-nemotron/requal-5pct-0819Z.md.
    • The lead re-applied 16/8 on prod-operator.
  • The same train re-pointed queues the lead had to fix by hand after every train (post_train_queue.sh):
    • backend-sync-backfill, plus backend-sync's SYNC_BACKFILL_TASKS_QUEUE, went back to sync-backfill, which was retired after the 10-19 04:52Z stall. The sync-backfill-lifecycle literal overrides the manifest.
    • The manifest still names sync-jobs for backend-sync and backend-integration (SYNC_TASKS_QUEUE), retired after the 10-18 18:59Z stall.

What

  • .github/actions/deploy-backend-stack/action.yml: recovery queue --max-concurrent-dispatches=16 --max-dispatches-per-second=8. Attempts (5) and backoff (5–60s) are unchanged.

  • backend/deploy/runtime_env/prod.overlay.yaml (and the regenerated runtime_env.yaml):

    • SYNC_TASKS_QUEUE=sync-jobs-fresh on backend-sync and backend-integration;
    • SYNC_BACKFILL_TASKS_QUEUE=sync-backfill-fresh on backend-sync and backend-sync-backfill;
    • backfill worker SYNC_TASKS_QUEUE=sync-backfill-fresh.

    All five are today's live values, so the next train changes nothing live.

  • .github/actions/sync-backfill-lifecycle/action.yml: the manifest's queue now wins over the sync-backfill default. The default moves first in the env overlay, and the backfill handler output reads the manifest value. Dev declares none and keeps sync-backfill.

  • backend/scripts/runtime_env_validation/workflows.py: the static validator models the lifecycle the same way.

  • Review fixes (Codex P1/P2, commit 2a583cf):

    • sync_ledger_fence_cutover.py now pauses and records sync-jobs-fresh and sync-backfill-fresh too in prod (dev keeps the two legacy queues), so the cutover barrier covers the queues that carry dispatch. The runbook is updated.
    • The backfill reconcile step now manages the manifest-selected queue (prod: sync-backfill-fresh, same 90/15 and 5–60s) instead of the retired sync-backfill.
  • Docs updated to 16/8 (batch_pipeline_runtime.md, listen_pusher_pipeline.mdx).

This is the ops half of #22233 plus the backfill re-point. #22233 is not the vehicle: its other half codifies BATCH_PIPELINE_PERCENT=100, which waits for the gate. On integration/legacy-retire, lane 7's ops file (backend/deploy/ops/prod.yaml) and config-train take these values over (#22430, #22455).

Failure-Class: new

New class FC-deploy-literal-reverts-operator-value: a deploy re-asserts an older literal over an incident-driven operator value. The prevention is to declare the value in reviewed config the deploy reads, with any remaining literal pinned to the live value by a contract test. No existing class covers deploy-time reversion of operator state (searched the registry for deploy/reset/literal contracts).

Product invariants affected

  • INV-DATA-1: matched by path only (deploy actions). Only Cloud Tasks queue names and one queue's rate change; no project, endpoint, authority or data plane changes.
  • INV-MEM-4: matched by path only (backend/deploy/runtime_env.yaml regenerated). The only changed keys are the sync queue names above; no memory intake, consolidation or projection setting changes.

Verification

  • test_sync_two_lane.py::test_backfill_queue_comes_from_the_manifest_not_a_literal runs the lifecycle step's real bash: a manifest declaring sync-backfill-fresh yields sync-backfill-fresh, and an empty manifest yields sync-backfill. It also asserts the overlay order so the manifest wins.
  • test_batch_pipeline_recovery_runtime_contract.py pins 16/8; test_sync_reprocess_coalesce.py pins sync-jobs-fresh on integration.
  • pytest results:
    • test_sync_two_lane test_batch_pipeline_recovery_runtime_contract test_sync_reprocess_coalesce test_backend_runtime_env_validator test_render_backend_runtime_env test_cloud_run_live_caps test_cloud_run_forbidden_env_deploy test_batch_pipeline_cohort_config: 435 passed;
    • test_auto_dev_backend_scope test_fleet_deployment test_scheduler_reconcile test_cloud_run_service_identity test_plan_quota_env_retirement test_workflow_contracts: 166 passed.
  • check-deployment-concurrency.py, check-release-process-guards.py, check-direct-backend-production-admission.py, check_feature_flag_registry.py, actionlint: OK.
  • After review fixes: 398 targeted tests passed (adds test_sync_ledger_fence_cutover.py with a prod four-queue barrier case and the live-caps reconcile tests).
  • Not exercised: a real train. After the next train, check that batch-quarantine-recovery reads 16/8, and that the serving revisions of backend-sync, backend-integration and backend-sync-backfill carry the fresh queues.

Rollback

Revert this PR. The next train then writes 4/4 and the retired queues again, so re-apply post_train_queue.sh and 16/8 by hand as before.

🤖 Generated with Claude Code

…ueue re-points

The 07:07Z train reset batch-quarantine-recovery from the operator's 16/8
(01:27Z) to the action literal 4/4; recovery backed up and the 5% record-lane
re-qualification failed. The same train re-pointed backend-sync-backfill (and
backend-sync's SYNC_BACKFILL_TASKS_QUEUE) at the sync-backfill queue retired
after the 04:52Z stall, and the manifest still named sync-jobs for backend-sync
and backend-integration, retired after the 10-18 18:59Z stall.

- deploy-backend-stack: recovery queue 16/8 (attempts and backoff unchanged).
- prod overlay: SYNC_TASKS_QUEUE=sync-jobs-fresh on backend-sync and
  backend-integration; SYNC_BACKFILL_TASKS_QUEUE and the backfill worker's
  SYNC_TASKS_QUEUE = sync-backfill-fresh. runtime_env.yaml regenerated.
- sync-backfill-lifecycle: the manifest's queue wins over the sync-backfill
  default (dev declares none and keeps sync-backfill).
- runtime env validator models the lifecycle the same way.

Failure-Class: new

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-19T09:34:39.272410Z 2a583cf New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 279687bba6

ℹ️ 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".

Comment on lines 1076 to +1077
SYNC_TASKS_QUEUE:
value: 'sync-jobs'
value: 'sync-jobs-fresh'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pause the queues that production actually uses

When the protected sync_ledger_fence_cutover.yml is run after this production re-point, sync_ledger_fence_cutover.py still pauses only sync-jobs and sync-backfill via its QUEUES constant. The new sync-jobs-fresh and sync-backfill-fresh queues therefore continue dispatching while the workflow sequentially promotes standby revisions and retires legacy revisions, defeating the barrier that prevents old and new ledger-fencing protocols from overlapping. Update the cutover queue set and runbook alongside these queue-name changes.

Useful? React with 👍 / 👎.

Comment on lines 117 to 120
ENV_OVERLAY: |-
${{ inputs.backfill_env_vars }}
SYNC_TASKS_QUEUE=sync-backfill
${{ inputs.backfill_env_vars }}
SYNC_TASKS_HANDLER_URL=${{ steps.backfill-service.outputs.url }}/v2/sync-jobs/run

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reconcile the manifest-selected backfill queue

Although the worker now receives sync-backfill-fresh from this overlay, the later Reconcile bounded sync backfill queue step still describes, creates, and updates the literal sync-backfill queue, and the platform/dispatch invocation is not passed backfill_env_vars. Consequently each deploy applies the calculated concurrency and retry settings to the retired queue while leaving the active queue unmanaged; if the active queue must be recreated or the worker capacity changes, dispatch can fail or retain an unsafe capacity. Resolve the same manifest-selected queue for the reconciliation step.

Useful? React with 👍 / 👎.

Review findings on this PR (Codex):
- P1: sync_ledger_fence_cutover paused only sync-jobs and sync-backfill, so in
  prod the fresh queues that now carry dispatch would keep running through
  the cutover barrier. Prod now pauses and records all four; dev keeps two.
- P2: the backfill queue reconcile still created/updated the retired
  sync-backfill queue and left the live one unmanaged. The dispatch/platform
  invocation now receives the manifest env and reconciles the queue it names
  (prod: sync-backfill-fresh, same 90/15 and 5-60s backoff as today).

Failure-Class: FC-deploy-literal-reverts-operator-value

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 83f4ea7 into main Oct 19, 2026
56 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/deploy-queue-ops-literals branch October 19, 2026 09:47
Git-on-my-level added a commit that referenced this pull request Oct 19, 2026
 sync)

Conflict in .github/actions/sync-backfill-lifecycle/action.yml: main's #22460 and lane 7's B4
(#22455) both stop trains re-pointing backfill at the retired sync-backfill queue. Resolved to
one resolution step (ops-queues): prod reads the ops file (fail-closed, lane 7); other projects
take the manifest's SYNC_BACKFILL_TASKS_QUEUE/SYNC_TASKS_QUEUE (main), sync-backfill only as
default. The queue reconcile step keeps main's manifest-driven queue name. #22460's test is
adapted to the single resolution step.
Git-on-my-level added a commit that referenced this pull request Oct 19, 2026
…ue (#22460)

main's #22460 moved prod SYNC_TASKS_QUEUE to sync-jobs-fresh, so deleting only the sync-jobs
mapping no longer leaves the prod queue unmapped. Unmap both legacy names.

Verified: test_staging_overlay.py + test_staging_fence.py 33 passed; staging-mirrors-prod 0 diffs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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