Repository navigation
feat(history): check each dispatch against the core's commands - #72
Merged
Merged
Conversation
Signed-off-by: Feathbow <feathbow@gmail.com>
7 tasks
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.
Why
History replay steps every journaled event through the event core, but it kept only the core's state and dropped the commands the core emitted. A journal could therefore record a dispatch before the event that let the core order it, for example a rollout of update 1 dispatched before update 0 committed at staleness zero, and the history was still admitted. The learner side has no such gap: an attempt, a record and a commit are accepted only in the phase the core enters when it emits the matching command.
Most runtime history tests also ran at staleness zero, crossed at most one recovery window, and applied mutations to journals the tests assembled by hand. Refs #30.
What
dispatchedentry must name one of them and uses it up, so each command allows one dispatch. A dispatch of any other request is refused with a named problem.Validation
The core suite, formatting, lint and the type fixtures pass. With the dispatch check removed, the moved-dispatch mutation is admitted and the removed-restart case is refused at a result again, so two tests fail. Over six runs of the staleness-one test, both binding orders occurred and every run was admitted.