By looking at the patch it seems it's a bug indeed - would you submit the patch 
as a PR Stephen?
I opened up an issue, so you could open a PR referencing the issue nr: 
https://github.com/akka/akka/issues/18112

Thanks a lot for finding this and the patch!

-- 
Cheers,
Konrad 'ktoso’ Malawski
Akka @ Typesafe

On 3 August 2015 at 13:39:13, Patrik Nordwall (patrik.nordw...@gmail.com) wrote:

Why do you need to specify the timestamp when you know the sequence number?

Anyway, has this been reported as an github issue?

/Patrik

On Mon, Jul 20, 2015 at 5:07 AM, Stephen McDonald <stephen...@gmail.com> wrote:
BTW for anyone who hits this issue and needs an immediate solution, here's how 
I fixed it within my own project. Couldn't quite subclass as I mentioned 
earlier, due to LocalSnapshotStore being private, so I made a copy and tweaked 
as required to support timestamp handling in snapshot criterias:

https://github.com/stephenmcd/curiodb/commit/d034599d1f38077106c87a69b543a479c24efcb1


On Monday, 20 July 2015 11:36:54 UTC+10, Stephen McDonald wrote:
Hi Hakkers,

I came across some surprising behaviour with the LocalSnapshotStore - I was 
trying to implement what I imagine would be a common pattern: remove older 
snapshots each time a new snapshot is created. I did this with 
`deleteSnapshots(SnapshotSelectionCriteria(meta.sequenceNr, meta.timestamp - 
1))`, only to find it would delete all snapshots for the given persistence ID 
and sequenceNr, regardless of timestamp given.

After staring at my own code for a very long time, I looked at the source for 
LocalSnapshotStore and found that it seems to ignore timestamps altogether:

https://github.com/akka/akka/blob/master/akka-persistence/src/main/scala/akka/persistence/snapshot/local/LocalSnapshotStore.scala#L161

I initially thought this to be a bug, but looking at the history it appears to 
have been intentionally removed:

https://github.com/akka/akka/commit/63baaf1b2b3d0fc6c1971307fd1e66d74106c968

I was able to fix this with a minor change in the attached diff. Is there any 
interest in this fix? Or am I naive to some history around this? 

I guess if it's the intended behaviour, I can easily enough subclass it and 
override the relevant bits to take timestamps into account - does that sound 
reasonable?

Thanks for Akka, it's amazing!

--
Stephen McDonald
http://jupo.org
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Patrik Nordwall
Typesafe -  Reactive apps on the JVM
Twitter: @patriknw

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to