akkadotnet / Akka.Persistence.MongoDB

MongoDB support for Akka.Persistence
Apache License 2.0
31 stars 36 forks source link

Need to sort MongoDb highest seqNr using only the seqNr, not ordering #344

Closed Aaronontheweb closed 1 year ago

Aaronontheweb commented 1 year ago

https://github.com/akkadotnet/Akka.Persistence.MongoDB/blob/ef7bed77e9628a6000109cb0a0f25964fa7f095f/src/Akka.Persistence.MongoDb/Journal/MongoDbJournal.cs#L226

This query may not return the actual highest seqNr if PersistAsync is being used and Mongo processes parallel transactions in arbitrary orders. Need to use the combo of PersistentId and SeqNr (descending) instead.

Aaronontheweb commented 1 year ago

Nevermind, this code was for replaying tags - not individual persistence ids.