AkkaNetContrib / Akka.Persistence.ServiceFabric

[DEPRECATED] ServiceFabric support for Akka.Persistence
Apache License 2.0
13 stars 7 forks source link

Document truncation of Journal read count #6

Open AndersSahlin opened 9 years ago

AndersSahlin commented 9 years ago

The read count is truncated from Long to Int. Document this behavior.

In ServiceFabricPersistence.ServiceFabricEventJournal.GetMessagesAsync

int m = max > int.MaxValue ? int.MaxValue : (int)max;

rogeralsing commented 9 years ago

This one is a bit ugly. The JVM Api is designed around long values for journal sequence numbers, which is all fine. In our specific implementation here, there are two issues;

  1. We use Linq to objects to filter the journal, l2o uses integers for its methods, thus, the value needs to be truncated.
  2. We are probably not going to ever be able to deserialize more than int.Max entries from servicefabric. as that would probably take a couple of days and a bizarre amount of memory to deserialize such object.

So, are we OK with the long to int truncation?

cc. @clca

clca commented 9 years ago

It is probably a corner case considering that it would assume that an Actor would need 100s GB of storage for its state. We may want to catch this case at the plug-in level and return some sort of error.