Replies: 2 comments 1 reply
-
Hi @RyanTT , there is a known issue with snapshot building process in some circumstances. I've fixed this yesterday. Could you please test your code using |
Beta Was this translation helpful? Give feedback.
-
Thank you for your quick response! I have downloaded the latest develop branch and tried the exact same scenario again but with your newer codebase and it seems to work flawlessly. I will notify you if any (de)serialization issues arise again. Tyvm! PS: Do you plan on providing a development nuget package or a beta/alpha nuget package through nuget.org any time soon? And if not, is there a rough estimate when a new nuget version will be provided? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am trying to implement a simple state machine with a snapshot builder.
What I'd to do is write JSON values. For this purpose, I am utilizing CreateJsonLogEntry + ReplicateAsync to distribute non-snapshot entries. This appears to work fine. However, when it comes to writing the Snapshot as an entry, I always get very strange inconsistent results that I cannot explain to myself:
CustomSnapshotBuilder : IncrementalSnapshotBuilder
WriteToAsync<TWriter>
, I use the following lines to write my desired snapshot data:This appears to write fine.
RaftMemoryBasedStateMachine : MemoryBasedStateMachine
ApplyAsync
method, I then check each arrivingLogEntry
for itsIsSnapshot
property, and deserialize the LogEntry the following way:Now there are two scenarios:
If one node in a cluster size = 1 becomes leader and writes entries to it's log, a second node joins the cluster by utilizing AddMember on the leader, the log's between the nodes replicate fine.
However, if one node in a cluster size = 1 becomes leader, writes entries to it's log to the point of causing a snapshot to be created, and THEN a second node joins the cluster by utilizing AddMember on the leader, then the following error appears on the newly joined node inside the
RaftMemoryBasedStateMachine : MemoryBasedStateMachine
ApplyAsync
method when an entry has IsSnapshot = false and my code tries to executeawait entry.DeserializeFromJsonAsync() as EntryBase;
. It errors out withDas System kann die angegebene Datei nicht finden.
meansThe System cannot find the specified file
. As you can see, the string it is trying to load is not correct (as my assemblies name surely does not contain a smiley)Could not load file or assembly 'YASP☻, Culture=neutral, PublicKeyToken=null'
.I am really confused about what I'm doing wrong. I tried to look at an older discussion about a similiar topic, however sadly the library seems to have changed a bit since then and the example is not applicable 1-to-1 anymore.
I'd be really glad if you were able to push me into a direction!
Thank you very much in advance!
Beta Was this translation helpful? Give feedback.
All reactions