Conversation
Contributor
Author
|
@dgafka, could you please prioritize reviewing and merging this fix for a 1.x patch release, rather than waiting for 2.0? Applications still running 1.x are affected: after a reconnect, synchronous projections can miss events written inside the current transaction. A 1.x release would let affected applications receive the fix without requiring a major-version upgrade. Thank you. |
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 is this change proposed?
LazyProophEventStorerebuilds its inner Event Store when the PDO connection changes, butLazyProophProjectionManagerkeeps returning the manager cached for the same context. That manager still holds the previous Event Store and PDO connection.After a reconnect, a synchronous projection can therefore read through the old connection while the command appends an event inside a transaction on the new one. The projection cannot see the uncommitted event and leaves the read model unchanged.
Description of Changes
Associate each cached manager with the inner Event Store used to create it and rebuild the manager when that instance changes. This reuses the existing reconnect detection and preserves the per-context cache.
The regression scenario initializes a synchronous projection, reconnects, updates an aggregate inside an open transaction, and checks the read model before commit. It also checks rollback and a subsequent retry.
In-memory mode returns its configured projection manager directly, without reconnect tracking.
Fixes #703.
Pull Request Contribution Terms