Skip to content

Define explicit sync failure semantics#15

Open
jeregrine wants to merge 1 commit into
js-cleanupfrom
js-explicit-sync-semantics
Open

Define explicit sync failure semantics#15
jeregrine wants to merge 1 commit into
js-cleanupfrom
js-explicit-sync-semantics

Conversation

@jeregrine

Copy link
Copy Markdown
Member

@chrismccord, a callback that returns :sync currently receives its normal reply when persistence fails. The mutation remains only in memory, so the caller cannot tell whether the acknowledged operation is durable.

This PR adds a failing test that forces a post-start backend write failure and asserts that explicit sync does not return a successful reply. It intentionally does not choose a fix yet.

Which contract do you prefer?

  1. Stop the DurableServer and fail the caller whenever an explicit sync fails.
  2. Add a callback/API result that returns the persistence error while keeping the server alive.
  3. Keep :sync best effort and add a separate strict-sync primitive.

The focused test currently fails with: explicit :sync returned success even though persistence failed.

A callback that returns :sync currently sends its normal reply even when the backend rejects the write. The mutation then exists only in memory, so the caller has no way to distinguish durable state from state that will be lost if the process exits.\n\nAdd a deterministic backend write failure and a regression test asserting that an explicit sync cannot return a successful reply after persistence fails. The test is intentionally red pending a decision on the public contract.\n\nPossible fixes are to stop the server and fail the caller on explicit sync errors, add a callback/API result that reports the persistence error while retaining the process, or define :sync as best effort and introduce a separate strict-sync primitive.
@jeregrine
jeregrine requested a review from chrismccord July 15, 2026 18:24
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.

1 participant