Skip to content

revert(batch): back out #24697 owner page collapse and drain requeue - #24707

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/pipeline-revert-24697
Nov 5, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/pipeline-revert-24697

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Problem

#24697 (6547604) has served on backend-integration since 2026-11-05 14:53Z (revision 01572-22x) and regressed projection drain. Owner-drain turn logs, Cloud Logging, read-only:

window turns/s rows advanced/s claim_busy share
14:30-14:45Z (pre-train) 3.4 11.9 70%
15:30-15:33Z (post) 30 8.4 60% (of 10x more turns)

Cause: Projector sweep now calls request_drain(owner) for every collapsed owner not in this process's draining set, on every sweep. The de-dupe is per process only, so across ~48 integration instances the same heavy owners are requested everywhere. Turns hit the owner claim held elsewhere (claim_busy) or find nothing (end) in ~0.8 s. owner_page also adds one jobs read per page row. Projection over-SLA kept rising (178.7k at 15:40Z), and rows advanced fell 30%.

Fix

Revert #24697 (git revert -m 1 6547604a). The single conflict was the GMP keep-list in backend/deploy/cloud_run_gmp_sync.yaml. I kept main's version, which still lists the two now-unemitted counter names: harmless, with no keep-list churn. No later commit touched the reverted files, and nothing references the removed symbols.

A forward fix (request drains only for owners without a live claim, or rate-limit requests per owner, behind a kill switch) is a follow-up.

Tests

bin/omi-heavy run -- .venv/bin/python -m pytest -q over the #24697 test set plus test_attach_cloud_run_gmp_sidecar.py: 463 passed.

Risk / rollback

Restores the pre-#24697 projection scheduler, which served all morning. Rollback = revert this revert.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

Reverts 6547604 (#24697). In prod on backend-integration (rev 01572-22x,
serving since 2026-11-05 14:53Z) every sweep re-requests drains for each
collapsed owner. The only de-dupe is per process, so across ~48 instances
the same heavy owners are requested everywhere. Owner-drain turns rose from
3.4/s to 30/s, about 60% ended claim_busy, and rows advanced fell from
11.9/s to 8.4/s (-30%). owner_page also adds a jobs read per page row.

The GMP keep-list keeps the two counter names (harmless, now unemitted) so
the conflict with later keep-list edits stays empty.

Evidence: omi-workspace data/run-2026-11-05-omi-pipeline/diag-24697-1540Z.md

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

chatgpt-codex-connector Bot commented Nov 5, 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-11-05T15:51:06.636652Z 81467fd 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.

@Git-on-my-level
Git-on-my-level merged commit e88fb82 into main Nov 5, 2026
64 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/pipeline-revert-24697 branch November 5, 2026 16:00
Git-on-my-level added a commit that referenced this pull request Nov 5, 2026
…4710)

## Problem
Fleet instances repeatedly request the same projection owners. Requests
arriving during a losing claim-busy turn immediately re-enter the FIFO
and repeat the contention.

## Fix
- Read-only GET of the existing Redis owner-claim key at initial launch,
off the event loop; held owners defer admission and any peek error
admits as before.
- Jittered 5–15 second backoff only for claim_busy turns re-requested
through `again`. Productive `more=True` continuations retain immediate
FIFO progress and bypass the new admission peek.
- Cap retry timers and clear them on close; return overflow intent to
the existing next-serving-pass handoff.
- Export skipped-drain and claim-busy-backoff counters through the
serving GMP keep-list.

Based on merged revert #24707 (e88fb82); only L2 is included. Prefetch,
capacity, page sizes, assignment fencing and the #24697 collapse remain
unchanged. The optional head item was skipped: the cited code is a
read-before-owner-draining skip, not a clear head-staleness skip.

## Tests
- Requested stage-env/budget/owner-drain guard through
`BACKEND_UNIT_TEST_FILE_LIST=/tmp/l2f.txt bash test.sh`: **97 passed**
across 3 isolated files.
- Original focused owner-drain/projection/simulation/sweep/metrics/GMP
set: **426 passed**.
- Policy suite: **73 passed**; switch semantics cover shadow and serve
parser modes.
- Registry generator/parser check passed; stage-env ratchet baseline is
unchanged.
- The switch is now read through `config.batch_pipeline` /
`config.policy.kill_switch`, with an owned helper-backed flag-budget
entry and generated registry documentation. Only `off` disables it in
every parser mode.
- Final repository gates and exact-head GitHub CI are being rerun for
the follow-up commit.
- Code and hermetic unit tests only; no production access or GCP tier
used.

## Risk and rollback
Low-risk advisory scheduling change; durable result rows remain
discoverable. `PROJECTION_DRAIN_CLAIM_AWARE=off` restores previous
admission, re-request and FIFO behavior. Default is on; only `off`
disables it.

Failure-Class: FC-immediate-retry-loses-shared-cas

Line-Count-Exception: backend/config/batch_pipeline.py | 818 -> 825 |
Add the requested seven-line policy kill-switch accessor to remove the
raw stage env read; no stage-env ratchet baseline change.
Git-on-my-level added a commit that referenced this pull request Nov 8, 2026
…4943)

<!-- claude-projects-attribution: {"github_login":"Git-on-my-level"} -->
_Requested by **David**_

## What changes

Retro P6 adds `batch-pipeline-tuning-disclosure` to the shared manifest
in both local and CI lanes. Numeric capacity assignments and concurrency
environment defaults in the batch config, pipeline source, worker/pusher
charts, and `backend/utils/pusher_*.py` require numeric disclosures in
one PR-body section naming a matched knob: before/after, from/to, or a
nearby numeric arrow (`6 -> 4` or `6 → 4`). A knob with no removed
numeric assignment may instead use `new: <num>` or `initial <num>`.
Newly added literals directly assigned or compared to state-like names,
or passed as state/status/phase/disposition/outcome/reason kwargs, must
name an exit, terminal, dead-letter, re-entry, clear, or recovery path;
literals already anywhere in the merge-base tree are exempt.
`Numbers-waived: <reason>` and `State-exit-waived: <reason>` waive their
respective requirement and echo the reason.

HTML comments, fenced code blocks and inline code are stripped before
validating disclosures, state exits or waivers. Logging arguments and
literals merely near state-related words do not count as new states.

The same single manifest entry runs hermetic regression tests before
checking the body. Only changed lines trigger detection; flags,
comment-only lines, and unchanged context do not count. The detector
deliberately misses indirect/formula tuning: this is a disclosure
ratchet.

David approved this exact manifest and script/test change on
**2026-11-08 at 16:13Z**. No workflow file changed. The change is
limited to `.github/checks-manifest.yaml` and the two P6 files under
`.github/scripts/`.

## Why this check

The retro's #24481 HPA retune is the design precedent; the sweep below
exercises HPA bounds changes such as #24742. Its from/to wording is
supported, but its knob names are only in inline code, which the
requested prose-only rule excludes. Existing product-invariant and
failure-class checks validate different author declarations; neither
detects capacity knobs or new lifecycle literals. This check reuses the
manifest's existing diff/metadata plumbing without changing workflow
wiring or inventing another PR orchestration layer.

## Product invariants affected

none

Failure-Class: none

## Merged-PR false-positive sweep (2026-11-08T20:01:42.025036+00:00)

**200 merged PRs screened; 69 trigger-touching diffs checked; 16 would
fail and 53 would pass.** 14 failing PRs require numeric disclosures; 2
require state declarations (3 state literals total). The prior sweep
reported 18 failures; the refreshed capped corpus also advances its
merge cutoff.

Method: `gh pr list --repo BasedHardware/omi --state merged --search
'merged:>=2026-10-09' --limit 200 --json
number,title,body,mergeCommit,mergedAt,files`, followed by `gh pr diff
<number> --repo BasedHardware/omi` for matching paths. Full paginated
file lists were checked whenever the initial listing reached 100 files.
Each diff was checked against its PR body and reconstructed PR
merge-base: merge-parent merge-base for normal merges;
PR-head/merge-parent merge-base cross-checked with the recorded PR base
for one-parent merges. State candidates use a whole-tree lookup at that
merge-base.

The capped corpus spans **2026-11-04T12:58:21Z through
2026-11-08T19:20:24Z**: a sample within the requested 30-day window, not
full-month coverage. No production reads or GCP tier were used.

The stricter state association passes #24743 (the prior proximity-only
candidate). #24733 and #24729 now pass the expanded numeric wording. The
required inline-code stripping means #24742 still fails: its from/to
numbers are supported, but its matched knob names appear only in inline
code. #24884 and #24725 also fail when their state names are excluded as
inline code. These are explicit effects of the requested prose-only
policy, not claims that those historical PRs omitted all semantic
explanation.

Sample of would-fail PRs:

| PR | Detected change | Missing disclosure |
| --- | --- | --- |
| [#24889](#24889) | Tuning:
`max_count` | Initial/new numeric value naming a matched knob in prose,
before/after disclosure, or Numbers-waived |
| [#24884](#24884) | New state:
`record_barrier_aged` | State literal and exit declaration in prose, or
State-exit-waived (inline code is excluded) |
| [#24799](#24799) | Tuning:
`MIN_STORAGE_PCM_BUDGET_MB` | Initial/new numeric value naming a matched
knob in prose, before/after disclosure, or Numbers-waived |
| [#24742](#24742) | Tuning:
`maxReplicas`, `minReplicas` | Matched knob name in prose alongside the
existing from/to numbers |
| [#24736](#24736) | Tuning:
`PAGE_SIZE` | Initial/new numeric value naming a matched knob in prose,
before/after disclosure, or Numbers-waived |
| [#24725](#24725) | New state:
`marker_retry_overflow`, `marker_write_failed` | State literal and exit
declaration in prose, or State-exit-waived (inline code is excluded) |
| [#24716](#24716) | Tuning:
`limit` | Initial/new numeric value naming a matched knob in prose,
before/after disclosure, or Numbers-waived |
| [#24712](#24712) | Tuning:
`MAX_OWNER_DRAINS` | Numeric before/after, from/to or arrow disclosure
naming a matched knob in prose, or Numbers-waived |
| [#24710](#24710) | Tuning:
`MAX_DELAYED_OWNERS` | Initial/new numeric value naming a matched knob
in prose, before/after disclosure, or Numbers-waived |
| [#24707](#24707) | Tuning:
`MAX_HEAD_REQUEUES` | Numeric before/after, from/to or arrow disclosure
naming a matched knob in prose, or Numbers-waived |

All would-fail PRs: #24889, #24884, #24799, #24742, #24736, #24725,
#24716, #24712, #24710, #24707, #24703, #24697, #24689, #24680, #24643,
#24601.

## Validation

- **26 focused regression tests passed** on head
`1788dd10315e7a709dcaf6150838907638386ad0`, covering fenced/inline
examples, direct state association (including the logging regression),
from/to and arrows, and first-time versus changed numeric values.
- **`make preflight` passed all 14 selected local checks**, including 26
P6 tests and 78 manifest-contract tests, with `OMI_PR_BODY_FILE` and
`BACKEND_UNIT_FILE_BUDGET_SECONDS=900`. The normal bounded pre-push gate
also passed all 14 checks using the final body and the same budget, with
`GOOGLE_APPLICATION_CREDENTIALS` and every `CLOUDSDK_*` variable
removed.
- `scripts/pr-preflight --suggest` required no invariant citations;
`Failure-Class: none` is declared above.
- No workflow file changed; only the manifest and two P6 scripts differ
from the merge base.
- No production reads or GCP tier used. Full-month coverage beyond the
200-PR cap, indirect/formula tuning and product/runtime behavior are not
established by this check.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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