-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(spanner): Transaction was started in a different session (#8467)
* fix: Transaction was started in a different session Retrying a "Session not found" error could cause a "Transaction was started in a different session" error. This happened because: 1. The detection of a "Session not found" error would remove the session from the pool, and also remove the session ID from the session handle 2. The retry mechanism would check out a new session from the pool, but not assign it to the transaction yet 3. The retry would then proceed to retry the transaction with an explicit BeginTransaction RPC. This function would however pick a new session from the pool, because step 2 had not yet assigned the transaction a new session. 4. The higher level retry loop would then after executing the BeginTransaction RPC assign the session that was picked in step 2 to the transaction. 5. The transaction would then proceed to use the session from step 2 with the transaction from step 3. * chore: remove unused code * chore: fix import order
- Loading branch information
Showing
5 changed files
with
267 additions
and
14 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