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

Dependence on persisting system clock timestamps is vulnerable to clock skew #108

Open
leviramsey opened this issue Nov 29, 2024 · 0 comments

Comments

@leviramsey
Copy link
Contributor

The timestamp on persisted events is taken from the system clock. Since the eventsBySlices query uses timestamps for offsets, this can cause rejected sequence numbers, especially if backtracking cannot find the events (the backtracking window is exceeded by clock skew, or the projection is far behind and avoiding backtracking).

R2DBC defaults to avoiding this problem by deferring to the database's clock and ensuring monotonicity in the transaction; that approach is not applicable with dynamo. Perhaps it makes sense for the plugin to keep a cache, populated on replay and updated on persist, of the high watermark timestamps for entities (ensuring that the timestamp is monotonic increasing)?

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

No branches or pull requests

1 participant