You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using Akka.Persistence.PostgreSql version 1.4.17 and have seen issues recovering from snapshots using the JSON format. I am using PersistentFSM<TState, TData, TEvent> which is offered a snapshot which is subsequently ignored because it has not been deserialized to the correct type.
The actor handles this by reading all events from the journal instead so no errors are thrown, indeed its only by chance that I spotted this behavior.
protectedoverrideboolReceiveRecover(objectmessage){switch(message){case TEvent domainEvent:this.StartWith(this.StateName,this.ApplyEvent(domainEvent,this.StateData));returntrue;case PersistentFSM.StateChangeEvent stateChangeEvent:this.StartWith(this.StatesMap[stateChangeEvent.StateIdentifier],this.StateData, stateChangeEvent.Timeout);returntrue;case SnapshotOffer snapshotOffer:if(!(snapshotOffer.Snapshot is PersistentFSM.PersistentFSMSnapshot<TData> snapshot))returnfalse;// <~~ snapshotOffer.snapshot is Newtonsoft.Json.Linq.JObject but should be PersistentFSM.PersistentFSMSnapshot<TData>this.StartWith(this.StatesMap[snapshot.StateIdentifier], snapshot.Data, snapshot.Timeout);returntrue;case RecoveryCompleted _:this.Initialize();this.OnRecoveryCompleted();returntrue;default:returnfalse;}}
Reading the snapshot store from the DB I can see that the manifest field is "" as was mentioned to be the issue in #63.
Following through the code I can see the same method mentioned is at fault for not adding the manifest correctly.
I have also tried switching to BYTEA with a mind to use my own serialization but the lack of manifest again prevents me from doing so. Journal entries looks to have manifest set correctly, this only seems to effect snapshots.
Related to: #63 and #49
I am currently using
Akka.Persistence.PostgreSql
version 1.4.17 and have seen issues recovering from snapshots using the JSON format. I am usingPersistentFSM<TState, TData, TEvent>
which is offered a snapshot which is subsequently ignored because it has not been deserialized to the correct type.The actor handles this by reading all events from the journal instead so no errors are thrown, indeed its only by chance that I spotted this behavior.
Reading the snapshot store from the DB I can see that the manifest field is
""
as was mentioned to be the issue in #63.Following through the code I can see the same method mentioned is at fault for not adding the manifest correctly.
I have also tried switching to BYTEA with a mind to use my own serialization but the lack of manifest again prevents me from doing so. Journal entries looks to have manifest set correctly, this only seems to effect snapshots.
My akka.conf for context:
The text was updated successfully, but these errors were encountered: