-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "more than two versions is not allowed" (#75)
This error was reported from "make bench" and is caused by concurrent transactions attempting to modify the same record. This is disallowed because it would break the serialization rules of a transaction. Normally (in a server environment) it might block the second transaction until the in-flight row becomes frozen (returns to a single version) - then be able to proceed (only in some isolation modes). However, this is not as trivial in a share-nothing architecture (as least not right now). So, a proper (new) SQLSTATE 40001 "serialization failure" is returned instead. Clients that receive this must restart the transaction again. Better reporting of error is not the bug. The actual bug is why the error is raised in the first place, since "make bench" runs sequential transactions that should never happen. This was caused by UPDATE (which was a DELETE/INSERT) underneath not being able to handle the case where the record to be updated is the in-flight version and not the frozen version. So, in a nutshell, UPDATE was in some cases just trying to always create a new version. This also fixes another related bug where implicit transactions were not revisiting pages to perform the neeccesary cleanup (like that which happens on a COMMIT/ROLLBACK) also potentially leaving expired versions behind. Furthemore, a SQLSTATE 25P02 "in failed sql transaction" is returned for all statements after an error is returned during a transaction, until a COMMIT or ROLLBACK is issued also triggering the correct cleanup. Fixes #74
- Loading branch information
1 parent
27b0e2d
commit 51d1eea
Showing
15 changed files
with
447 additions
and
87 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
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.