Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix read journal, missing _includeDeleted checks #121

Merged
merged 2 commits into from
Nov 14, 2022

Conversation

Arkatufus
Copy link
Contributor

@Arkatufus Arkatufus commented Nov 11, 2022

Prerequisite for #117

Persistence query returned wrong number of events because it also includes soft deleted entries.

@Aaronontheweb Aaronontheweb merged commit cdd52ab into akkadotnet:dev Nov 14, 2022
@@ -171,7 +167,7 @@ public async Task<long> MaxJournalSequenceAsync()
{
await using var db = ConnectionFactory.GetConnection();

return await db.GetTable<JournalRow>()
return await BaseQueryStatic(db, _includeDeleted)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I'm realizing now (After approval) that this line should not have been changed;

Here are the queries from AFTER 'include-deleted' support was pulled from persistence-jdbc (But before license change! ;))

https://github.com/akka/akka-persistence-jdbc/blob/933ece9ae13c4ae9934ffc01e67ea477cfd8d85c/core/src/main/scala/akka/persistence/jdbc/query/dao/ReadJournalQueries.scala

The max journal 'sequence' (Ordering) does -not- have a filter on isDeleted. If I had to guess, including deleted in Max Ordering -probably- improves some edge cases around JournalSequenceActor, namely in cases where all of the entries in the journal are soft-delete records, (If that happened, there would be a delay on seeing new events, as the Journal Sequence actor would take time to look for the sequence gap.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants