Repository navigation
fix(blob): never gate apply commits on wire-carried save flags; gate local writes on blob durability - #1641
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors blob pre-commit logic to prevent deadlocks on replication-apply paths and replication divergence (orphan blob references) on local-write paths. It ensures that local record commits gate on the blob's durable landing and strips origin-local write instructions (saveBeforeCommit and saveInRecord) before serialization. The feedback suggests checking if a blob's saving promise is pending in addition to checking for a null fileId to avoid skipping durability gates on manually saved blobs. Additionally, it recommends using object destructuring instead of the delete operator in hot paths to prevent V8 deoptimizations.
|
Reviewed; no blockers found. |
… destructuring (review)
|
Both addressed in f6b1b96: the still-streaming gap was real, but keying on Lavinia, via Claude |
Patch cherry-pick: mergedCherry-picked onto |
kriszyp
left a comment
There was a problem hiding this comment.
Reviewed via Claude review-queue — sound blob-durability fix, local writes now correctly block commit on save durability. CI red is a pre-existing unrelated subscriptionReplay flake. LGTM.
Fixes #1640
trackPersistedBlobs) now runs first instartPreCommitBlobsForRecordand only tracks blobs for cleanup, never gating the commit, andpack()no longer shipssaveBeforeCommit/saveInRecord. Wire-carried flags could previously gate a receiver's commit on an in-flight receive stream, freezing the apply loop (see issue).fileIdset) are exempt from that gate: a local write carrying one references another row's blob, and tracking it would let abort cleanup delete a file the owning record still needs.Behavior change: a local write whose fresh blob fails to save now rejects instead of committing a broken reference, matching the existing
saveBeforeCommitfault contract. Four tests updated accordingly.Validated on the 4-node staging repro from the issue: blob tables converge to exact row equality within minutes of load stop.
blob.test.js62 passing; the 3test:unit:resourcesfailures reproduce onorigin/mainand are unrelated.🤖 Generated with Claude Code