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

feat: Skip backtracking when far behind #600

Closed
wants to merge 6 commits into from

Conversation

patriknw
Copy link
Member

No description provided.

!state.backtracking &&
state.latest != TimestampOffset.Zero &&
// no backtracking if far behind current wall clock time
previousTimestamp.isAfter(clock.instant().minus(firstBacktrackingQueryWindow)) &&
Copy link
Member Author

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.

Copy link
Member Author

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.

@patriknw patriknw force-pushed the wip-heartbeat-patriknw branch from 1be050a to f125c73 Compare October 9, 2024 14:35
@patriknw
Copy link
Member Author

Included in #614

@patriknw patriknw closed this Oct 18, 2024
@patriknw patriknw deleted the wip-catchup-patriknw branch October 18, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant