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

Merged
merged 3 commits into from
Jan 20, 2025

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):

Sorry, something went wrong.

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.

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb merged commit 077bb8d into akkadotnet:dev Jan 20, 2025
3 checks passed
Copy link
Member

@to11mtm to11mtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful. <3

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