You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f8edd96
Browse filesBrowse the repository at this point in the historyBrowse files
## Problem
Projection discovery instances begin at the same keyset head after a
roll, repeatedly offering the same owners to the advisory claim.
Revision, hostname and PID alone may be identical across Cloud Run
replicas.
## Fix
Select a random 128-bit process seed on first use, mix it with the
revision, and cache the resulting SHA-256 stripe modulo 4096 for the
process lifetime. A local lock makes first-use initialization and
logging occur once even with concurrent scanners. No metadata server or
network I/O is used. The larger stripe space reduces collisions at 30–50
instances; restarts may choose a different stripe. Log the chosen stripe
once in the process selector, rather than for every scanner.
Seed each scanner at its committed_at lower bound between the oldest
matching result and startup time. Existing committed_at + document ID
ordering remains oldest-first after that bound, then wraps to the head.
Every row remains discoverable; no durable state changes. The existing
follow-up seed takes precedence. Page sizes, sweep cadence, owner-drain
concurrency and owner claims are unchanged.
## Tests
314 passed across 8 files using `BACKEND_UNIT_TEST_FILE_LIST=<file> bash
backend/test.sh` through `bin/omi-heavy run --`: projection discovery,
batch-stage environment ratchet, flag budget, unit policy, follow-up
desync, follow-up reads, sweep owner-chain and owner-drain tests.
Injected seeds model separate processes with identical metadata and
verify process-stable selection, different stripes and one log per
process. Full-cycle coverage covers stripe boundaries through 4095,
timestamp ties, wrap and empty/short collections.
B1 from the supplied correctness review is fixed. The
insert-behind-cursor follow-up remains outside this change.
## Risk
This is discovery desynchronization, not exclusive partitioning. Hash
collisions and sparse/skewed timestamp ranges can still share starting
rows. Startup adds one scoped head read per scanner; a seed beyond the
newest result retries the head immediately. Throughput and claim-busy
impact require a separately authorized production canary. No production
access, merge or deployment in this lane.
## Rollback
The switch defaults on. Set
`BATCH_PIPELINE_PROJECTION_STRIPING_ENABLED=off` and restart scanners to
recover the exact pre-change cursor sequence and query budget.
Pagination off also bypasses seeding.
Failure-Class: none
This is cross-instance discovery contention; the blocked-page class
covers dependency starvation and the scheduler-shard class covers shared
control mutations. Transaction fences remain unchanged.
Copy file name to clipboardExpand all lines: backend/docs/feature-flag-registry.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -543,6 +543,7 @@ and an explicit empty literal renders as `''`.
543
543
| `BATCH_PIPELINE_PROJECTION_PREDECESSOR_REPLAY_ENABLED` | Default on; a blocked projection successor schedules its owner's missing predecessor through the existing ordered walk | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
544
544
| `BATCH_PIPELINE_PROJECTION_PREFETCH` | Default 4; an owner-chain walk reads the next N rows' successor links, job bindings, result payloads and audio manifests ahead of the chain, and runs the candidate lookup beside context and build | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
545
545
| `BATCH_PIPELINE_PROJECTION_SOURCE_DELETED_ENABLED` | Default on; settle deleted original sources without a tombstone or redirect as source_deleted, without content publication | backend | env | open | — | — | — | — | keep | keep | — | cl2-cost / lead2 |
546
+
| `BATCH_PIPELINE_PROJECTION_STRIPING_ENABLED` | Default on unless off; seed projection discovery at an instance-specific committed_at stripe, then wrap through every row | backend | env | open | — | — | — | — | keep | keep | — | omi-pipeline |
546
547
| `BATCH_PIPELINE_RAMP_EXCLUDE_HEAVY_OWNERS` | Ship-on partial-ramp admission isolation; only off disables; owners over 30 open jobs or six hours pending audio use legacy | backend | env | closed | — | — | — | — | keep | keep | — | dazheng |
547
548
| `BATCH_PIPELINE_RECOVERED_MERGE_RELEASE_ENABLED` | Default on unless false; the post-recovery owner wake commits the recovered unit, then its content's ready siblings, at once past an unready merge head (the unit itself also past the catch-up depth hold), so the same wake's chain walk projects them | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
548
549
| `BATCH_PIPELINE_RECOVERY_DISPATCH_INTERVAL_SECONDS` | Default 5; batch serving dispatches quarantine recovery on its own loop at this interval, on the maintenance leader only | backend | env | closed | — | — | — | — | keep | keep | — | dazheng |
@@ -1104,6 +1105,7 @@ their code default (`fail` tells you which way a missing value resolves).
1104
1105
- `BATCH_PIPELINE_PROJECTION_PREDECESSOR_REPLAY_ENABLED` — Default on; a blocked projection successor schedules its owner's missing predecessor through the existing ordered walk (fail: open)
1105
1106
- `BATCH_PIPELINE_PROJECTION_PREFETCH` — Default 4; an owner-chain walk reads the next N rows' successor links, job bindings, result payloads and audio manifests ahead of the chain, and runs the candidate lookup beside context and build (fail: open)
1106
1107
- `BATCH_PIPELINE_PROJECTION_SOURCE_DELETED_ENABLED` — Default on; settle deleted original sources without a tombstone or redirect as source_deleted, without content publication (fail: open)
1108
+
- `BATCH_PIPELINE_PROJECTION_STRIPING_ENABLED` — Default on unless off; seed projection discovery at an instance-specific committed_at stripe, then wrap through every row (fail: open)
1107
1109
- `BATCH_PIPELINE_PUBLISH_CONCURRENCY` — GPU worker post-flight publication concurrency: bounded fenced transitions and one ordered drain per owner per flight; default 4, 1 = legacy serial kill switch, max 16 (fail: closed)
1108
1110
- `BATCH_PIPELINE_RAMP_EXCLUDE_HEAVY_OWNERS` — Ship-on partial-ramp admission isolation; only off disables; owners over 30 open jobs or six hours pending audio use legacy (fail: closed)
1109
1111
- `BATCH_PIPELINE_RECORD_PROTOCOL_READY` — One-time native record protocol cutover; default closed retains record_pending obligations without expiry (fail: closed)
0 commit comments