Skip to content
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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Arkatufus
Copy link
Contributor

@Arkatufus Arkatufus commented Jan 8, 2025

Fixes #502

An alternate way to #503 for fixing #502

Changes

  • Make CurrentJournalEvents to return a stream or EventEnvelope array, this way we can still count the actual number of rows returned by the database.
  • Add regression spec

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

Copy link
Contributor Author

@Arkatufus Arkatufus left a 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)
Copy link
Contributor Author

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 EventEnvelopes, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant