Skip to content

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

@Aaronontheweb

Description

@Aaronontheweb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions