akka / akka-persistence-jdbc

Asynchronously writes journal and snapshot entries to configured JDBC databases so that Akka Actors can recover state
https://doc.akka.io/docs/akka-persistence-jdbc/
Other
308 stars 142 forks source link

fix: The new events-by-tag-buffer-sizes-per-query could miss events #688

Closed johanandren closed 1 year ago

johanandren commented 1 year ago

for infrequent tags because of an optimization that only works for full journal querying

Follow up to #681

sebastian-alfers commented 1 year ago

Thanks @johanandren for kicking this off. The change you initially proposed (xs.map(_.offset.value).max) did cause a java.lang.UnsupportedOperationException: empty.max as at some point xs was empty.

However, I think the bug was in the wrong usage of nextStartingOffset for the "next" batch not considering the config in case it exists (recently introduced by loopMaxOrderingId).

johanandren commented 1 year ago

Indeed. LGTM (can't mark with approve since it was my initial PR)

johanandren commented 1 year ago

Squashed and attributed to Sebastian.