Repository navigation
Conversation
Contributor
Author
|
The follow-up fix in If The regression test was committed separately in Validation:
|
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?
PDO projections that read multiple streams can process newer events before older events left in another stream’s next batch.
EventStoreGlobalStreamSource::loadFromMultipleStreamslimited each stream separately, then sorted only the events already loaded.With a batch size of 2, the projection regression test received
1…6, 20, 21, 7…12instead of1…12, 20, 21.Description of Changes
Summary
Merge the next event from each stream using bounded buffers:
Preserve event position order within each stream and use stream declaration order to resolve equal timestamps. Apply gap tracking and cleanup to the positions actually consumed.
Evidence
test_projecting_multiple_streams_in_order_across_batches, which reproduces the ordering inversion between pages.After: the same tests pass, covering cursor resumption, buffer refills, equal timestamps, stream position order, and gaps loaded ahead of consumption.
PdoEventSourcingsuite on PostgreSQL: 269 tests, 747 assertions, no failures; one skipped test and one deprecation inlaminas/laminas-code.PdoEventSourcingsuite on MySQL: 269 tests, 745 assertions, no failures; two skipped tests and the same dependency deprecation.git diff --check: passed.Merge Danger
Door: two-way. The change can be reverted without a migration; the position format remains compatible.
Blast Radius: projections. PDO projection pages now contain at most the requested number of events. Multi-stream projections may perform additional reads when one stream contains most of the oldest events, while keeping buffers bounded.
Pull Request Contribution Terms