Repository navigation
fix(batch): share projection finish backfill across replicas (SCA-2024) - #25225
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbac40b56b
ℹ️ 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".
| return held_merge_owners(self.client, self.namespace, limit, after=after) | ||
|
|
||
| def projection_finish_backfill_complete(self) -> bool: | ||
| from database.batch_pipeline_projection_finish_backfill import backfill_complete |
There was a problem hiding this comment.
Move the backfill helper import to module scope
This new function-local import violates the explicit import rule in backend/AGENTS.md, which requires all imports at module top level and prohibits imports inside functions. Move backfill_complete into the module's import block; the backfill module does not import batch_pipeline_store, so this dependency does not require a local import to avoid a cycle.
AGENTS.md reference: backend/AGENTS.md:L168-L168
Useful? React with 👍 / 👎.
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 777515b3b1
ℹ️ 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".
| ], | ||
| ) | ||
| def test_cli_rejects_unsafe_or_unbounded_invocation_before_opening_store(monkeypatch, arguments): | ||
| from scripts import batch_pipeline_projection_finish_backfill as cli |
There was a problem hiding this comment.
Move the new test imports to module scope
The new function-local CLI import violates the explicit rule in backend/AGENTS.md: all imports must be at module top level, never inside functions. Move this import into the module import block, along with the newly added function-local projection_finish_entry_fields import in test_batch_projection_finish_backoff.py. The rule applies to backend tests as well as production modules.
AGENTS.md reference: backend/AGENTS.md:L168-L168
Useful? React with 👍 / 👎.
# Conflicts: # backend/config/flag_budget.json # backend/deploy/runtime_env/pending/usage-month-enable-5.patch
SCA-2024: Replace the per-process projection finish survey with a bounded, resumable stamping pass and shared versioned completion marker. New replicas use filtered discovery immediately once maintenance finishes; until then, serving keeps the legacy page without per-row stamp transactions.
Persisted/ready transitions maintain clock fields regardless of the read lever, including backend-listen request paths and operator scripts. All Store backends expose marker readiness; Postgres/simulation require their own control marker, so Firestore maintenance cannot enable filtering over an uncertified population. The runbook records the writer audit, read budgets, deployment order, rollback and re-enable gates.
The bounded integration repair merges approved main
6262a2b82e(including SCA-1993 / #25220) and refreshes only the usage-month full-map snapshot hashes and the pending patch's context. Served runtime inputs, qualification code, assertions, monthly defaults, epochs, TTLs and activation authority are unchanged. The pending patch still proposes exactly six 0->5 lever values on the same three services and is excluded from ordinary composition. Published commit history is preserved. The integration conflict in Firestore budget registrations retains both main's new fresh-delivery entry and this PR's two existing entries unchanged.Validation:
backend/test.shrun: 11 + 17 passed. Existing module-stub and import-time side-effect checks pass over the full tree (2,998 test files and 2,592 production files, zero violations).flag-budget-count.patch:count277→278 is the only changed JSON value. Duplicate-rejecting parsing confirms 278 unique registered names, 161 seeded/replacement slots and 117 owned exceptions. SCA-2012 added the fresh-guard entry without updating this summary; all registrations, owners, expiries, scope, defaults and both Firestore budgets are preserved.777515b3b1passes 107 qualification tests; integration with approved main yields 3 failures / 104 passes; the two-artifact repair restores 107 passes.make preflight: 44 checks passed, including Firestore query/index checks; composed runtime manifest is current.777515b3b1cleared CI emulator proofs and shard 2. Its local emulator evidence was 40 passed with one pre-existing throughput skip; no isolation, privacy, custody or timeout guard was relaxed.Two Multica review rounds are already complete. The SCA-2073 owner ruling permits bounded integration repair through the capped release route; this new head remains at the current issue step for owner scope/freshness reconciliation. No third review or author-side reviewer is requested. Exact-head hosted green CI and existing finding dispositions remain release gates. Production rolls belong to the rollout lead. No production/cloud/account reads or writes, activation, scan/stamp, deployment, installation, credentials change or GitHub merge performed. Re-enable still requires all writers deployed and stamping complete, #25145 / SCA-1799 merged/deployed, and nonzero GMP values for both finish-read and completion counters; matched-window savings and a zero-missing-clock census remain post-deployment acceptance.
Writer evidence: request-path and job/script audit.
Product invariants affected
none
Failure-Class: none
Pipeline-Tuning: no active numeric tuning. Existing retry delays, serving page sizes and cadence are unchanged. The existing offline monthly proposal remains two 0->5 values on three services; this repair only updates its context to approved config literals, without applying it.
Body-waived: historical local-receipt lines above name earlier heads of this PR (777515b, 2c13d4c); current head bc6c99845ff8fcc3d9aacc1ac5e03bc45a65b19 is the origin/main merge-in with conflict-resolution-only delta per SCA-2175, with hosted CI green at that head.