[iris] Fix scheduling loop: filter reservation jobs at SQL level#4179
[iris] Fix scheduling loop: filter reservation jobs at SQL level#4179
Conversation
Add has_reservation column to jobs table so _claim_workers_for_reservations can filter at SQL level instead of deserializing all active job protobufs. On production DB (1,340 active jobs, 218MB of request_proto): p50 drops from 156ms to 0.0ms, p95 from 2,669ms to 0.1ms.
|
Claude finished @rjpower's task in 1m 37s —— View job PR Review: [iris] Fix scheduling loop: filter reservation jobs at SQL level
Adds a denormalized Findings:
No bugs, correctness issues, or guideline violations found. Clean PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a18b6333ed
ℹ️ 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".
Add has_reservation column to jobs table so _claim_workers_for_reservations can filter at SQL level instead of deserializing all active job protobufs. On production DB (1,340 active jobs, 218MB of request_proto): p50 drops from 156ms to 0.0ms, p95 from 2,669ms to 0.1ms. Adds before/after comparison to the benchmark script.
Delete Table, Column, Predicate, SelectExpr, Order, Join, JoinedQuery and all 16 module-level table constants from db.py. Replace ~100 callsites across 8 production files and 12 test files with raw SQL + decode_rows/decode_one helpers. Every query is now visible as plain SQL at its callsite. Net -556 lines. Follows #4179 which fixed the immediate scheduling perf issue. --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Russell Power <rjpower@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Add has_reservation column to jobs table so _claim_workers_for_reservations can filter at SQL level instead of deserializing all active job protobufs. On production DB (1,340 active jobs, 218MB of request_proto): p50 drops from 156ms to 0.0ms, p95 from 2,669ms to 0.1ms. Adds before/after comparison to the benchmark script.
Delete Table, Column, Predicate, SelectExpr, Order, Join, JoinedQuery and all 16 module-level table constants from db.py. Replace ~100 callsites across 8 production files and 12 test files with raw SQL + decode_rows/decode_one helpers. Every query is now visible as plain SQL at its callsite. Net -556 lines. Follows #4179 which fixed the immediate scheduling perf issue. --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Russell Power <rjpower@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Add has_reservation column to jobs table so _claim_workers_for_reservations
can filter at SQL level instead of deserializing all active job protobufs.
On production DB (1,340 active jobs, 218MB of request_proto): p50 drops
from 156ms to 0.0ms, p95 from 2,669ms to 0.1ms. Adds before/after
comparison to the benchmark script.