akka-persistence-dynamodb icon indicating copy to clipboard operation
akka-persistence-dynamodb copied to clipboard

DynamoDBRecovery.getReplayBatch should use and honour toSequenceNr

Open nefilim opened this issue 10 years ago • 2 comments

it looks like currently it only/always loads fromSequenceNr to (fromSequenceNr + maxDynamoBatchGet_replayParallelism). also, as it stand today, would it load all events if there are more than (fromSequenceNr + maxDynamoBatchGet_replayParallelism) ?

to conserve consumed read units, it should only load fromSequenceNr to toSequenceNr.

nefilim avatar Sep 17 '14 14:09 nefilim

I think the code you are referencing is being called from here, https://github.com/sclasen/akka-persistence-dynamodb/blob/master/src/main/scala/akka/persistence/journal/dynamodb/DynamoDBRecovery.scala#L23 which will be called with increasing fromSequenceNr inside the recursive asyncReplayMessages function. So afaik it will load all requested messages.

+1 to some code that only loads up to toSequenceNr if that is less than maxDynamoBatchGet*replayParallelism

fancy a PR?

sclasen avatar Sep 17 '14 15:09 sclasen

Should be fun, unfortunately I'm not going to have time for a few weeks: abandoning akka-persistence and digging deep to build something home grown and make up lost time. Would love to revisit akka-persistence once it's more stable, sounds like that won't be until the end of the year though.

nefilim avatar Sep 18 '14 14:09 nefilim