I have an Actor class that receives two different kinds of messages which it persists via Akka.Persistence. If it catches an exception, it manually writes a third type of message to the persistence journal to record the exception details so my code has the info it needs to rebuild state after a restart if it needs to replay, long story.
MongoDb is the db I am using to store the persistence
Basically the issue is I am getting an error when it is trying to replay messages on startup, it seems to be hitting the Mongo 32mb sort buffer size limit but I'm not sure how to resolve it, as the way it's replaying messages is all within the Akka framework so I'm not sure how I can get around this.
Attached is the error, if you need to see parts of the code let me know which, as there are a lot of different interacting classes so it's too much to cut and paste and I'm not sure which would be relevant.
2017-05-15 13:59:50,536 [5] DEBUG MessageProcessor.Actors.Listeners.TEventListener - Checking for message gaps - TEvents 2017-05-15 13:59:50,644 [10] DEBUG Akka.Persistence.Journal.ReplayFilter - Started (Akka.Persistence.Journal.ReplayFilter) 2017-05-15 13:59:50,686 [11] DEBUG Akka.Persistence.MongoDb.Journal.MongoDbJournal - now supervising akka://M/system/akka.persistence.journal.mongodb/$a 2017-05-15 13:59:50,897 [24] DEBUG Akka.Persistence.Journal.ReplayFilter - Stopped 2017-05-15 13:59:50,901 [24] ERROR EndpointProcessor.Actors.Endpoints.QueuedEndpoint - Persistence failure when replaying events for persistenceId [endpoint-Report]. Last known sequence number [0] MongoDB.Driver.MongoCommandException: Command find failed: Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit..