Repository navigation
Make a retried request id wait for the original commit - #106
Merged
venkat1701 merged 1 commit intoNov 23, 2026
Merged
venkat1701 merged 1 commit into
venkat1701 merged 1 commit into
Conversation
A commit retried with the same request id while the original was still being synced got DUPLICATE straight away, so a client could be told its write was done before it was durable. After a sync failure the retry got DUPLICATE instead of the error, and new commits were still written to the WAL before they were rejected. A duplicate now waits until the original is published, or fails with the pipeline error. append checks the pipeline before writing anything. Fixes metacoglabs#105
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.
Fixes #105.
A retry with the same
requestIdas a commit that was still being fsynced gotDUPLICATEstraight away. The original wasn't durable or published yet, so if its sync then failed, the client had been told "done" for something that was lost. After a failed sync the retry also gotDUPLICATEinstead of the error, and new commits were still written to the WAL before being rejected.Now:
DUPLICATE.appendchecks the pipeline before it writes anything, so once the pipeline has failed nothing more reaches the WAL. System transactions and branch create/close go throughappendtoo, so they're covered by the same line.commitkeeps its body and is wrapped, so the wait happens after the commit lock is released.GroupCommittergetsensureRunningandawaitPublished. The failed commit's own outcome is still unknown after a sync failure, as before.CommitPipelineTesthas four tests: a retry waits while the original is held in its fsync, a retry after a failed sync gets the error, nothing is written after the failure (checked after a restart), and a retry of a commit that was published before the failure still succeeds. The first three fail onmain../mvnw installpasses on JDK 25.