-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: Skip backtracking when far behind #600
Conversation
core/src/main/scala/akka/persistence/r2dbc/internal/BySliceQuery.scala
Outdated
Show resolved
Hide resolved
core/src/test/scala/akka/persistence/r2dbc/query/EventsBySliceBacktrackingSpec.scala
Show resolved
Hide resolved
!state.backtracking && | ||
state.latest != TimestampOffset.Zero && | ||
// no backtracking if far behind current wall clock time | ||
previousTimestamp.isAfter(clock.instant().minus(firstBacktrackingQueryWindow)) && |
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.
I don't think it has to be more exact than this.
I have also verified that this works as expected with a sample app. Generated some 100k events test data. Ran catch up without triggering any backtracking, and then storing some new events that trigger backtracking again, and after a while backtracking stops again.
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.
No, there is one problem. Let's say that a projection is stopped/crashed and then isn't started immediately again. Then it should still run backtracking from the start offset (minus some) until the backtracking offset is ahead of the start offset.
1be050a
to
f125c73
Compare
01151f8
to
b5c772b
Compare
Included in #614 |
No description provided.