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

Bug: can't support multiple snapshots taken at same seqNr and persistentId #432

Closed
Aaronontheweb opened this issue Aug 6, 2024 · 0 comments · Fixed by #455 · May be fixed by #434
Closed

Bug: can't support multiple snapshots taken at same seqNr and persistentId #432

Aaronontheweb opened this issue Aug 6, 2024 · 0 comments · Fixed by #455 · May be fixed by #434

Comments

@Aaronontheweb
Copy link
Member

Version Information
Version of Akka.NET? v1.5.27 and later
Which Akka.NET Modules? Akka.Persistence.Sql

Describe the bug

Related issue: akkadotnet/akka.net#7312 - the problem is the primary key index we use for the SnapshotStore doesn't also cover the Timestamp, thus we can end up with the issues described in that thread.

Expected behavior

Should be able to save snapshots at the same PersisentId and SeqNr combination because they will typically be differentiated by Timestamp value.

Actual behavior

When SaveSnapshot call volume is low, things will still work because the snapshot code is designed to replace the existing snapshot at the matching seqNr through simulated "upsert" mechanics. However, this is vulnerable to race conditions if multiple snapshots in a row are all saved in rapid succession.

Environment

SQL Server

Additional context

I added work-around ideas to akkadotnet/akka.net#7312 - that issue must be fixed first before this one can be closed out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant