-
Notifications
You must be signed in to change notification settings - Fork 64
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
Lucene Index - Read Committed #411
Comments
Started branch 'issue-411' |
In case that the |
Check if this affects the inernal method call "isCallerReader". possible solution:
|
To avoid a conflict with the snapshotservice we need to prafix the eventLogEntryID instad of sufix the eventLogEntryID. This is because the snapshotservice constructs the following JPQL which includes the eventLogEntries
|
issue imixs#411
Read Uncommitted
In the current version Lucene Index works with an Isolation level equals to 'Read Uncommitted'. This means, during a transaction each client reads the uncommitted index. This means a different transaction read changed index by an transaction which is still in progress. This leads to Dirty reads. In addition a rollback did not update the index. This my lead to kind of unexpected behavior and errors.
Read Committed
The solution is an implementation of "Read Committed". This means a transaction can not search in a uncommitted index. Index updated by different transaction which is still in progress can not be read. Dirty reads are prevented.
Solution
The LuceneIndexWriter writes a LucenEventLogEntry each time a client requests an update. This is called the EventLogCache. When a client reads the index, the LuceneIndexSearchService calls the method "flushEventLogCache" of the LuceneIndexWriter. This is a method running in a new Transaction (annotation TransactionNew). The method checks if committed EventLog entries exits. If so the method updates the index first. This new behavior will have a tolerable impact on performance as the first read call must wait until the index was refreshed. Writes become a little bit faster.
The text was updated successfully, but these errors were encountered: