fix(proxy): persist file ownership across replicas - #1521
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f0025329c
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Deep review as promised in round 4. Verdict up front: the durable file-pin half is a real fix; the reservation-cleanup half is a feature-scale settlement protocol redesign riding in a Scope assessmentTwo separable changes are bundled:
Migration: collides with main today (P1)
Collision map across open PRs (all sharing or predating this branch point):
Safe sequencing: serialize all Conflict sources (CONFLICTING label)
FindingsP1 — migration multi-head startup failure. As above. P1 — rebase must be semantic, not textual. #1561 interaction as above; also the new P2 — ambiguous-dispatch quota hold leans on a defeasible backstop. P2 — unbounded buffering loop can stall forwarded streams. The new cleanup-ready wait in P2 — fail-closed flip converts successful upstream calls into 502s. P2 — retry re-reservation removal needs one more test. P3 — mixed-version rollout semantics. design.md documents drain requirements for pins only, but the delayed-200 handoff changes both sides of the internal forward. Idempotent release makes most old/new pairings benign, but new-origin + old-receiver (immediate 200, finalizer not yet installed, receiver crash) leaves the reaper as sole recovery. Worth one paragraph in the migration plan and/or a forward-contract version gate. P3 — compact branch asymmetry. The terminal-compaction branch of Positive notes: the loop-prevention guard ( Recommendation
|
|
Maintainer decision on the review above: we will NOT require the A/B split — the PR can proceed as a whole, but classified as behavior-changing (no fix-class soak exemption): it merges after a hard review pass and then soaks in beta before any stable cut. To get there, please: (1) do the semantic (not mechanical) rebase — main has moved through #1561/#1562 and today's #1558 settlement-confirmation gating, all in your touched region; the finally-signal in _settle_compact_api_key_usage must be reconciled with main's release-then-raise path; (2) retarget the migration's down_revision onto the current single alembic head; (3) address the P1/P2 findings above, in particular the unbounded cleanup-ready buffering wait (bound it and fail closed) and the DISPATCH_AMBIGUOUS reliance on the 6h stale reaper — note a first-party fix for #1594 is starting now and touches exactly that reaper/heartbeat surface, so plan to rebase on top of it. The fail-closed file-pin flip (DB error → 502 on successful upstream create) is accepted as part of the whole-PR review. |
Summary
Persist live
file_id -> account_idownership pins in the shared database so file finalization and Responsesinput_filerequests remain bound to the uploading account across replicas.The durable owner decision uses database-authoritative time, does not trust a process-local cache, and fails closed before account selection or upstream dispatch when ownership cannot be established safely.
Type of change
fix:— bug fix (no behavior change beyond the bug)feat:— new user-facing feature or capabilityrefactor:— internal refactor (no behavior change, no API change)docs:— documentation onlychore:/ci:/build:— tooling, CI, packagingtest:— test-only changeLinked issue: None — no matching issue or pull request in the bounded upstream search.
OpenSpec
Change directory:
openspec/changes/persist-file-account-pins/Changes
Simplicity
.env.exampleentry, dashboard navigation item, dependency, or public API surface is added.Test plan
ty, and architecture checks: passed.openspec validate persist-file-account-pins --strict: passed.openspec validate --specs --strict: 48/48 specs passed./opsx:verify persist-file-account-pins: 11/11 tasks, 3/3 requirements, 35/35 scenarios, zero findings.Screenshots / output
Not applicable: this is a backend routing/persistence change and does not change dashboard rendering.
Verified behavior includes:
Checklist
/opsx:verifyis clean.