Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Index population applies all concurrent updates
=== Main issue === Regardless of where the population scan is currently at. Previously the index population scan would now and then digress from its normal scanning and apply updates that had trickled in from concurrent transactions while the population was running. While going through those updates it would ignore those that were for an entity id that the scan hadn't already visited, and i.e. would visit later and apply then instead. This was a merely a performance optimization, but a flawed one when considering how a label scan works, which is what drives an index population scan. A label scan reader reads bit-sets of size 64, loops through those bits, one per entity id and then moves on to read the next. Problem arises when a concurrent creation happens right in front of the scan, but inside the same bit-set range as the label scan is currently at. If the timing was such that, at this time the population would decide to apply external updates this would result in this particular update being skipped AND the label scan missing it. The result would be an index that was inconsistent with the store, even after a successfully population and ONLINE index. A consistency-checker run would also have pointed that out to you. Fix is to err on the safe side and always apply external updates, even if they are in front of the scan. Simpler is better. The down side is that the index population will have to do more work if there are concurrent transactions going on which affect the index. Comparing to previously then statistically twice as many external updates will be applied for an index population now. === Another related issue === There was another problem with applying updates right at the end of the population where the executor would be shut down before being able to apply those final updates and so they would also be missed. This has also been fixed.
- Loading branch information
Showing
12 changed files
with
347 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.