-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ExecuteInTx PostgreSQL version (#1045)
* Enforce contract of ExecuteInTx at the API level Previously ExecuteInTx accepted open transaction, but required users never to execute any commands on it prior to calling ExecuteInTx. This API change enforces this contract by making ExecuteInTx to open transaction internally and pass it to the callback func. * Implement PG version of ExecuteInTx which does fewer roundtrips to the Server PostgreSQL doesn't benefit from SAVEPOINT/ROLLBACK logic like CockroachDB does. With this change Nakama checks server DB engine and enables CockroachDB optimization only when necessary. There are 2 behviour change in the PG version of ExecuteInTx: - it retries on all "Class 40" (a.k.a retriable) codes, not just serialization error: 40000 transaction_rollback 40002 transaction_integrity_constraint_violation 40001 serialization_failure 40003 statement_completion_unknown 40P01 deadlock_detected - It doesn't ignore COMMIT result code anymore
- Loading branch information
Showing
14 changed files
with
104 additions
and
217 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.