There is no way to "reject but try a different snapshot". The offered snapshot is the latest one matching the criterium, and you either use it or not - "ignoring it".
There's no "yeah not that one but another one". How would the lib know what you're looking for? Keep offering all snapshots you possibly had? Sounds rather weird. -- Konrad `ktoso` Malawski Akka <http://akka.io> @ Lightbend <http://lightbend.com> On 29 December 2016 at 12:36:07, Sergey A. ([email protected]) wrote: Hi All, May be I'm missing something obvious (sorry about that - in between holydays week). So my problem is - persistent state of persistent actor is changed (evolved), so I want to recover from events if previous snapshot was taken from old state. Documentation says: http://doc.akka.io/docs/akka/2.4/scala/persistence.html To skip loading snapshots and replay all events you can use > SnapshotSelectionCriteria.None. This can be useful if snapshot > serialization format has changed in an incompatible way. It should > typically not be used when events have been deleted. > > > 1. override def recovery = > 2. Recovery(fromSnapshot = SnapshotSelectionCriteria.None) > > At first look, it's exactly what I need, but in this case I should: 1. start application with SnapshotSelectionCriteria.None and run until new snapshot taken 2. change code or configuration (to remove override) 3. start application again and forever (until next upgrade) if I did not perform steps 2.-3. and application will be restarted app will be recovered from events (soo slow). So I'm looking for something like that: Введите код... override def receiveRecover: Receive = { case cmd@SnapshotOffer(metadata, offeredSnapshot: OldFormat) => rejectOffer case cmd@SnapshotOffer(metadata, offeredSnapshot: NewFormat) => state = offeredSnapshot Btw, I already tried to ignore SnapshotOffer with old type (removing 1st case above), but it led to worst variant - snapshot was silently bypassed and only recent events (not included into spanshot) replayed. Any thoughts ? -- >>>>>>>>>> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
