Repository navigation
Fix claim aging race and retained body hydration on 0.6 - #663
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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: 61db389d19
ℹ️ 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".
| let ambiguous: Vec<&ReadySnapshotRow> = ready_map | ||
| .values() | ||
| .filter(|rows| rows.len() > 1 && !rows.iter().any(|row| row.live_body)) | ||
| .flatten() |
There was a problem hiding this comment.
Let emitted lane evidence override colliding live copies
When pre-fix physical aging raced a receipt claim and the destination priority lane allocated the same lane_seq as the source—commonly sequence 1 in two previously empty lanes—the tombstoned claimed source and its live replacement share this hydration key. This filter excludes any group containing a live row from the attempt-evidence lookup, so claimed_lanes remains empty and the later ranking selects the replacement despite the ledger identifying the tombstoned source. Rescue or completion then persists the replacement priority and can retry the job on the wrong physical lane; include these collision groups in the lookup and let emitted lane evidence select the claimed body.
Useful? React with 👍 / 👎.
A claim can commit before its lane cursor advances. Physical aging could then tombstone its body, after which completion, cancellation or rescue rolled back and left the claim ring pinned.
Physical aging excludes claimed rows before its batch limit, locks claim heads in their existing order, and rechecks the selected identities in a fresh statement. Hydration matches the exact attempt and uses unique emitted physical-lane evidence to distinguish colliding bodies. Equally supported bodies fail explicitly.
Active point reads and callback reads now recover a retained tombstoned body when the normal body lookup misses. This fallback only reads; mutable attempt state and receipt closures remain transition work. Generic cancellation resolves the running attempt before a historical available replacement and shares the normal hydrated receipt transition.
When hydration selects a tombstoned source, recovery takes the affected claim heads with NOWAIT, rechecks all ready copies of that attempt and tombstones its old replacements. A fresh retry has a different ready run lease and remains eligible. Competing emitted copies or head contention abort the whole transaction. Conflicting historical terminal bodies use the existing self-contained representation so their physical priority and payload survive later retry and retention carry.
No schema changes or strong relation locks are added. Ordinary live-body reads and hydration keep their existing relation lookups. Historical recovery adds scoped attempt-ledger reads, weak relation locks and tombstone writes. Fresh mutation rechecks rely on READ COMMITTED isolation.
The soak harness fails on missing or ambiguous ready-body errors from parent Rust workers and claiming Rust children, and waits for child log readers before reconciliation. Default aging remains enabled. Operator-facing configuration and metric names are restored in the changelog. The main port is #664.
Validation:
Known limits: already-pruned bodies cannot be rebuilt; claims without unique emitted evidence retain the documented compatibility fallback. Worker completion using its already carried job body does not perform historical replacement retirement, so it can leave an old replacement claimable. Updated physical-aging callers prevent new replacements but cannot fence an older caller during rollout. Existing terminal-view and read/prune limitations remain.