-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix query batch size detection failure #505
Fix query batch size detection failure #505
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review
@@ -219,15 +219,15 @@ private Source<EventEnvelope, NotUsed> EventsByPersistenceIdSource( | |||
timestamp: r.representation.Timestamp, | |||
tags: r.tags)); | |||
|
|||
private Source<EventEnvelope, NotUsed> CurrentJournalEvents(long offset, long max, MaxOrderingId latestOrdering) | |||
private Source<EventEnvelope[], NotUsed> CurrentJournalEvents(long offset, long max, MaxOrderingId latestOrdering) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using SelectMany
and return a list of EventEnvelope
s, we use Select
and return a list of EventEnvelope[]
arrays instead. This list count will be consistently equals to the number of rows we fetched from the database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful. <3
Fixes #502
An alternate way to #503 for fixing #502
Changes
CurrentJournalEvents
to return a stream orEventEnvelope
array, this way we can still count the actual number of rows returned by the database.Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):