Open patriknw opened 6 years ago
In the end we need a RecoverySuccess(highSeqNr)
, but it's unclear to me why we have to first asyncReadHighestSequenceNr
and then asyncReplayMessages
, instead of using the last sequenceNr from asyncReplayMessages
. Perhaps it's because asyncReadHighestSequenceNr
is also using asyncHighestDeletedSequenceNumber
? Might be possible to use max of asyncReplayMessages
and asyncHighestDeletedSequenceNumber
instead?
I'm starting to work on this.
I have not been able to reproduce any performance problem with asyncReadHighestSequenceNr. Tried with 5 million events and that query is still sub millis response time (not increasing with number of events).
The select highest journal sequence number cql query orders the journal messages by sequence_nr in descending order to get the highest sequence number. The journal's messages table orders the messages by sequence_nr in ascending order by default. This can cause the query to be much slower and take away much of the performance benefit of using snapshots.