Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Avoid race condition between predicate move and commit (#2392)
- The reason for bug #2338 was that there was a race condition between a mutation and predicate move. Zero was not checking if a predicate is under move before allowing a commit. Thus, a mutation could get proposed in a group, then a move starts, and get committed by Zero (after the move starts). - This change this issue by ensuring that Zero checks if a predicate is being moved, before allowing commit. - Any pending transactions are also cancelled once the move starts, so this would only happen as part of a race condition and not afterward. Mechanism: - Send the real keys back to Zero, as part of Transaction Context. - Zero uses these keys to parse the predicate, and checks if that predicate is currently moving. If so, it would abort the transaction. - Also, check for `_predicate_` being moved. For some reason, if we don't consider this predicate, we could still lose data. - Before doing a mutation in Dgraph alpha, check if that tablet can be written to. - Loop until all transactions corresponding to the predicate move are aborted. Only then start the move. Tangential changes: - Update the port number for bank integration test. - Remove the separate key value or clean channel. Make it run as part of the main Node.Run loop. - Add a max function. - Small refactoring here and there.
- Loading branch information
Showing
11 changed files
with
112 additions
and
88 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
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.