- protected LeaderStateChanged newLeaderStateChanged(String memberId, String leaderId) {
- return new LeaderStateChanged(memberId, leaderId);
+ protected LeaderStateChanged newLeaderStateChanged(String memberId, String leaderId, short leaderPayloadVersion) {
+ return new LeaderStateChanged(memberId, leaderId, leaderPayloadVersion);
+ }
+
+ @Override
+ public long snapshotSequenceNr() {
+ // When we do a snapshot capture, we also capture and save the sequence-number of the persistent journal,
+ // so that we can delete the persistent journal based on the saved sequence-number
+ // However , when akka replays the journal during recovery, it replays it from the sequence number when the snapshot
+ // was saved and not the number we saved.
+ // We would want to override it , by asking akka to use the last-sequence number known to us.
+ return context.getSnapshotManager().getLastSequenceNumber();