Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes a concurrency issue creating constraints
When multiple concurrent transactions wants to create uniqueness constraint for a given label and property they would first race towards creating the backing index. One would win and get the exclusive lock on the label first and the others would await that lock. This lock would would be released during building of the index, which would then set the stage for the next race, which would be creation of the constraint for that index rule. One would win and set the last constraint tx field in the meta data store, whereas the others would notice that change and rollback. So to the problem: The transactions doing the rollback would think that it should delete the index that it registered as being the index backing the constraint that it wanted to create. This perhaps was correct previously when constraint creation was monolithic both for the whole schema store as well as keeping that lock during building of the backing index. With that gone this is no longer correct. The solution is to simply not delete the backing index when encountering this type of rollback. Trying to create a uniqueness constraint on non-unique data will still delete the backing index in addition to not creating the constraint, so this change just fix a concurrency issue with creating successful uniqueness constraint.
- Loading branch information
Showing
7 changed files
with
159 additions
and
19 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