Define required mirror partial-write semantics#16
Open
jeregrine wants to merge 1 commit into
Open
Conversation
MirrorStore writes the authoritative backend before its required mirror. If the mirror rejects that write, the adapter returns a plain mirror_failed error even though the authoritative value and ETag have already changed. A caller retrying with its previous ETag then conflicts, but the error contains no indication that anything committed.\n\nAdd a deterministic integration test that records the original ETag, rejects the mirror write, proves that a retry with the old ETag conflicts, and fails because the ordinary error hid the committed authoritative value. The test is intentionally red pending a decision on the contract.\n\nPossible fixes are to return typed partial success with the authoritative result and new ETag, durably queue and repair the mirror before reporting success, compensate/roll back the authoritative write when possible, or narrow the meaning of required mode so callers do not interpret this as an atomic failure.
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,
MirrorStorewrites the authoritative backend before its required mirror. If the mirror fails, it returns a plain{:error, {:mirror_failed, reason}}even though the authoritative value and ETag have already changed. Retrying with the caller's old ETag then conflicts.This PR adds a failing integration test that demonstrates the authoritative commit and stale-ETag conflict. It intentionally does not choose a fix yet.
Which contract do you prefer?
:requiredsemantics so this is explicitly non-atomic and callers can recover correctly.The focused test currently fails with:
ordinary mirror failure hid committed authoritative value "value-v2".