Define explicit sync failure semantics#15
Open
jeregrine wants to merge 1 commit into
Open
Conversation
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.
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.
@chrismccord, a callback that returns
:synccurrently 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?
:syncbest effort and add a separate strict-sync primitive.The focused test currently fails with:
explicit :sync returned success even though persistence failed.