Don't change the current state when checkpointing - #325
Open
jdewar wants to merge 1 commit into
Open
Conversation
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.
When checkpointing I don't believe we want to change the state. This usually plays out fine because after a checkpoint when catching_up (which is probably the most common non-:subscribed state), it immediately sets the state back to catching_up when it sees that it's behind. However, persisting event position has nothing to do with state transition, and this feels like a copy-paste mistake.
I don't have an idea what a test for this would look like; the situation we ran into was a subscription getting stuck in a state that would stop event processing. It's several months back at this point so the details have been lost, but we had gone through a number of eventstore tweaks in order to make a massive import of data go fast: we increased checkpoint_threshold > 1 for projectors and we added event selectors, while we were also at the mercy of some database networking issues via our database provider.