safety-data / akka-persistence-redis

Akka persistence plugin for Redis
Apache License 2.0
27 stars 13 forks source link

Fallback to fromSequenceNr instead of to 0L #5

Closed ikuo closed 7 years ago

ikuo commented 7 years ago

A fix to prevent overwriting lastSequenceNr of snapshot to 0L in case that highest sequenceNr is not found in Redis db.

Expected behavior (after this fix)

  1. On snapshot loaded, lastSequenceNr is set to sequenceNr of the loaded snapshot.
  2. akka-persistence-redis tries to load journal, but could not find highestSequenceNr in Redis db.
  3. sequenceNr should be unchanged.

Actual behavior (befor this fix)

  1. On snapshot loaded, lastSequenceNr is set to sequenceNr of the loaded snapshot.
  2. akka-persistence-redis tries to load journal, but could not find highestSequenceNr in Redis db.
  3. sequenceNr has been overwritten to 0L
satabin commented 7 years ago

Thanks for this fix. Artifacts with this fix are now published as 0.3.0-SNAPSHOT