Make fenced commits atomic - #45
Merged
Merged
Conversation
Lease recovery could act on stale reads while an actor commit was open. Lock the instance and claim through completion. Revalidate lease and process cleanup candidates after lock waits.
Greptile SummaryThe PR strengthens fenced commits by holding actor-instance and message-claim row locks through transaction completion, then revalidating locked state before lease recovery or stale-process cleanup.
Confidence Score: 5/5The PR appears safe to merge, with the latest release metadata synchronized and no outstanding findings. The current implementation locks and revalidates the durable ownership rows needed for atomic fenced commits, includes adapter-specific regression coverage, and consistently publishes version 0.14.8. Both previous review threads are resolved, and no new actionable issue was identified. Important Files Changed
Sequence DiagramsequenceDiagram
participant W as Active worker
participant DB as Database
participant R as Recovery worker
W->>DB: Lock actor instance
W->>DB: Validate activation fence
W->>DB: Lock exact message claim
W->>DB: Write state, result, and commit actions
R->>DB: Wait for locked rows
W->>DB: Commit and release locks
R->>DB: Re-read current rows
R-->>R: Skip requeue when claim already completed
Reviews (3): Last reviewed commit: "chore: bump version to 0.14.8" | Re-trigger Greptile |
Always release paused commits when an assertion or setup step fails. Give real-database concurrency tests enough time on slower CI runners.
CI began rejecting newly disclosed Vitest and Sharp advisories. Use patched test tooling and keep the Sharp override limited to vulnerable transitive versions.
Flatten activation release behind an early guard to match repository style. Exercise the cleanup interleaving against MySQL as well as PostgreSQL.
Owner
Author
Prepare the atomic fencing fix for release by aligning the package metadata, exported runtime version, and dated changelog entry.
Owner
Author
|
@greptileai please review the latest commit 57d437a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0.14.8releaseRoot cause
Fence validation used a plain SELECT before commit actions ran. A lease could expire while the transaction remained open, allowing another worker to recover the claim and advance the activation generation before the first worker wrote state. Recovery also acted on rows read before a lock wait, so it could requeue a message that completed while it was blocked.
Validation
pnpm run checkpnpm test(366 passed, 21 skipped)pnpm run pack:check(solid-objects@0.14.8)pnpm run test:packagenode scripts/release-notes.mjs 0.14.8pnpm audit --audit-level=high(no known vulnerabilities)pnpm peers check(no peer dependency issues)The PostgreSQL regression failed before the fix because the replacement claim settled before the first commit was released; it passes after the row-locking change. The same post-fix interleaving passes against MySQL 8.4. The database barriers always release in cleanup and use a 15-second integration-test timeout for slower CI runners.