Repository navigation
test(jobstore): port fenced scheduler pull parity (PL-141–143) - #23929
Git-on-my-level wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis 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.
2 issues found across 3 files
Confidence score: 4/5
backend/scripts/run-emulator-proofs.shcan pass without testing the sim or emulator backends whenOMI_REQUIRE_STORE_BACKENDS=postgres. Require both backends for this proof.backend/tests/integration/test_store_conformance.pymisses the control query becauseScheduler.pullcallscontrol_candidatebefore thestore.runwrapper. Spy oncontrol_candidateto verify the no-control-read guarantee.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/scripts/run-emulator-proofs.sh">
<violation number="1" location="backend/scripts/run-emulator-proofs.sh:78">
P2: This preserves an inherited selector that can disable the required legs: with `OMI_REQUIRE_STORE_BACKENDS=postgres`, missing sim and emulator backends skip and this proof can pass without testing them. Force `sim,emulator` for this runner, or normalize caller-supplied values so those two backends are always required.</violation>
</file>
<file name="backend/tests/integration/test_store_conformance.py">
<violation number="1" location="backend/tests/integration/test_store_conformance.py:490">
P2: This assertion does not verify the claimed no-control-read guarantee: `Scheduler.pull` calls `control_candidate` before the `store.run` wrapper, so its control query is invisible to `reads`. Spy on `control_candidate` or add backend-level read instrumentation, then assert the busy path performs no control/queue reads.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| # Includes PL-141/142/143 scheduler pull ownership, expiry and abort/restart recovery. | ||
| # Sim + Firestore must execute here; Postgres is qualified locally with all backends required. | ||
| run_proof "job-store conformance (sim + emulator, including fenced scheduler pulls)" \ | ||
| env "OMI_REQUIRE_STORE_BACKENDS=${OMI_REQUIRE_STORE_BACKENDS:-sim,emulator}" \ |
There was a problem hiding this comment.
P2: This preserves an inherited selector that can disable the required legs: with OMI_REQUIRE_STORE_BACKENDS=postgres, missing sim and emulator backends skip and this proof can pass without testing them. Force sim,emulator for this runner, or normalize caller-supplied values so those two backends are always required.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/scripts/run-emulator-proofs.sh, line 78:
<comment>This preserves an inherited selector that can disable the required legs: with `OMI_REQUIRE_STORE_BACKENDS=postgres`, missing sim and emulator backends skip and this proof can pass without testing them. Force `sim,emulator` for this runner, or normalize caller-supplied values so those two backends are always required.</comment>
<file context>
@@ -72,9 +72,10 @@ run_proof "summary task recovery, concurrency and expiry" \
+# Includes PL-141/142/143 scheduler pull ownership, expiry and abort/restart recovery.
+# Sim + Firestore must execute here; Postgres is qualified locally with all backends required.
+run_proof "job-store conformance (sim + emulator, including fenced scheduler pulls)" \
+ env "OMI_REQUIRE_STORE_BACKENDS=${OMI_REQUIRE_STORE_BACKENDS:-sim,emulator}" \
"$PYTHON" -m pytest -q -p no:cacheprovider tests/integration/test_store_conformance.py
</file context>
| assert queue.pull(1001) == [] | ||
| # Postgres acquires through a transaction; Firestore uses conditional CAS. | ||
| # Neither may enter the queue/control read set or write anything when busy. | ||
| assert set(reads) <= {'pull_claims'} and writes == [] |
There was a problem hiding this comment.
P2: This assertion does not verify the claimed no-control-read guarantee: Scheduler.pull calls control_candidate before the store.run wrapper, so its control query is invisible to reads. Spy on control_candidate or add backend-level read instrumentation, then assert the busy path performs no control/queue reads.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/tests/integration/test_store_conformance.py, line 490:
<comment>This assertion does not verify the claimed no-control-read guarantee: `Scheduler.pull` calls `control_candidate` before the `store.run` wrapper, so its control query is invisible to `reads`. Spy on `control_candidate` or add backend-level read instrumentation, then assert the busy path performs no control/queue reads.</comment>
<file context>
@@ -427,3 +430,138 @@ def body(tx):
+ assert queue.pull(1001) == []
+ # Postgres acquires through a transaction; Firestore uses conditional CAS.
+ # Neither may enter the queue/control read set or write anything when busy.
+ assert set(reads) <= {'pull_claims'} and writes == []
+ monkeypatch.setattr(h.store, 'run', run)
+ assert snapshot() == before
</file context>
# Conflicts: # backend/tests/integration/test_store_conformance.py
# Conflicts: # backend/scripts/run-emulator-proofs.sh
|
Folded into survivor #24591 ( Merged, with one deliberate exception: the formatting-only change to |
|
Hey @Git-on-my-level 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
The scheduler contention repair in #23927 added fenced pull ownership to every Store adapter, but its behavioral regression covered Firestore and a unit fake. A migration could retain the interface while losing the no-write, expiry or rollback guarantee on Postgres. This adds the same production-Scheduler cases to the existing Store conformance matrix for old Firestore, new Postgres and the single-threaded simulator.
The existing shared primitive is the real
SchedulerplusStore.acquire_pull_claim; the change exercises it through the establishedtesting/store_fixtures.pymatrix. It introduces no alternate implementation. The fixture also removes its own throwaway Firestore pull-claim documents. The existingbackend/scripts/run-emulator-proofs.shinvocation now requires the simulator and Firestore legs (a caller can require all three). Updating this script also selects the existing proof workflow, whose path filter does not include changes to the suite itself; no workflow change is needed.Validation:
bin/omi-heavy,OMI_REQUIRE_STORE_BACKENDS=all, a dynamically allocated loopback Firestore emulator, anonymous synthetic customer data and throwaway Unix-socket Postgres:PYTHONPATH=backend backend/.venv/bin/python -m pytest -q -p no:cacheprovider backend/tests/integration/test_store_conformance.py— 101 passed, one pre-existing simulator concurrency skip. New cases: 12 passed, zero skips/xfails.PYTHONPATH=backend backend/.venv/bin/python -m pytest backend/tests/unit/test_store_fixtures_iam.py -q— 2 passed.backend/scripts/run-emulator-proofs.shrunner also passed throughomi-heavywith all three stores required, including the new Store matrix.bash -npassed for the runner.This qualifies the existing interface locally; it does not measure deployed throughput or establish recovery of production projection debt. The companion KB ledger and Plan A acceptance carry PL-141/142/143. Merge remains lead-owned.
Product invariants affected
none
Failure-Class: FC-unowned-scheduler-shard-writes
🤖 Generated with Claude Code