Skip to content

Make a retried request id wait for the original commit - #106

Merged
venkat1701 merged 1 commit into
metacoglabs:mainfrom
Ujjwaljain16:fix/duplicate-waits-for-publication
Nov 23, 2026
Merged

venkat1701 merged 1 commit into
metacoglabs:mainfrom
Ujjwaljain16:fix/duplicate-waits-for-publication

Conversation

@Ujjwaljain16

Copy link
Copy Markdown
Contributor

Fixes #105.

A retry with the same requestId as a commit that was still being fsynced got DUPLICATE straight 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 got DUPLICATE instead of the error, and new commits were still written to the WAL before being rejected.

Now:

  • a duplicate waits until the original commit is published, or fails with the pipeline error. A request that was published before the failure still gets DUPLICATE.
  • append checks the pipeline before it writes anything, so once the pipeline has failed nothing more reaches the WAL. System transactions and branch create/close go through append too, so they're covered by the same line.

commit keeps its body and is wrapped, so the wait happens after the commit lock is released. GroupCommitter gets ensureRunning and awaitPublished. The failed commit's own outcome is still unknown after a sync failure, as before.

CommitPipelineTest has 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 on main. ./mvnw install passes on JDK 25.

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
@venkat1701
venkat1701 merged commit 98bbc79 into metacoglabs:main Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A retried request id is acknowledged before the original commit is durable

2 participants