-
Notifications
You must be signed in to change notification settings - Fork 4
fix: ensure that query starts from latestBacktracking in events-by-slice #175
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
Open
leviramsey
wants to merge
1
commit into
akka:main
Choose a base branch
from
leviramsey:backtrack-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
So the hypothesis is that a normal query moved the offset forward more than the backtracking window:
However, that could happen after a restart too. After a restart the backtracking only goes back the backtracking window (plus backtrackingBehindCurrentTime). The assumption is that the backtracking window should cover all late arrivals.
I don't know if we could see if parts of the GSI was more far behind than the backtracking window.
Would it make sense to instead increase the backtracking window?
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.
Would be useful if we can confirm the GSI was actually minutes behind. Maybe the AWS team have internal visibility into this.
Another scenario is around the backtracking behind-current-time (10 seconds by default), which actually sets how late events can be. If parts of the GSI are over 10 seconds behind on updates, the backtracking queries can move ahead of this, and events will be missed (rather than behind the backtracking window).
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.
Good point, that is even more likely. Is there a reason for why we have this as tight as 10 seconds for DynamoDB?
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 think we've discussed increasing it. But looks like it was just copied over from r2dbc originally:
Having over 10 second delays would be possible. The GSI can also be under-provisioned and write-throttled.
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.
Just to clarify, or verify my thought, write throttling in itself isn't a problem if it holds back all persistence ids for a slice. It would be a problem if the GSI partially let some persistence ids move forward, while others are held back.
(and remember, here we are using single slice queries)
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.
Yes, I see the same. It would be any kind of partial updates to the GSI within a slice that could create problems. I'd expect that changes could be at the level of DynamoDB's internal partitions, and throttling is applied within those partitions, so seems possible that there could be partition-level delays that would be partial for a slice.