Closed sidsethupathi closed 7 years ago
Yes, it does not load all events in a range at once because it could blow up the memory. However it should act as a pagination mechanism and if this page is empty, then try the next one and so on until the upper limit.
If it does not try the next page then it is a bug.
Yes, I don't think it tries the next page if the current page is empty. I will do some more investigating to confirm.
It looks like this is a bug.
If you add akka-persistence-redis.read-journal.max = 1
to https://github.com/safety-data/akka-persistence-redis/blob/897f31698a9c61fbb19eeef5135dfdd2a090b2b4/src/test/scala/akka/persistence/query/journal/redis/EventsByPersistenceIdSpec.scala#L28-L32
you can reproduce this issue.
I believe this is now fixed. I published a new snapshot version with the fix. I you can confirm it, I will release version 0.3.0 by the end of the week.
I'm trying to call
eventsByPersistenceId(id, 0L, Long.MaxValue)
with a single event in my journal that has a score of600
. The reason for this large range is to effectively say I want every event for a givenpersistenceId
.It appears that the following code makes the
zrangebyscore
call with a with a min score of 0 and max score of 100 (the default configuredmax
value). Is this intentional?https://github.com/safety-data/akka-persistence-redis/blob/17563b5f236ee88e57b8cc70b896270fa538c044/src/main/scala/akka/persistence/query/journal/redis/EventsByPersistenceIdSource.scala#L192