-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not retry a read operation when in a transaction (#982)
Fixes a regression introduced in 4.4.0 in scope of JAVA-4034, and was undetected due to the lack of a specification test for the required behavior. JAVA-4684
- Loading branch information
Showing
3 changed files
with
130 additions
and
25 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
115 changes: 115 additions & 0 deletions
115
...src/test/resources/unified-test-format/transactions/do-not-retry-read-in-transaction.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
"description": "do not retry read in a transaction", | ||
"schemaVersion": "1.4", | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "4.0.0", | ||
"topologies": [ | ||
"replicaset" | ||
] | ||
}, | ||
{ | ||
"minServerVersion": "4.2.0", | ||
"topologies": [ | ||
"sharded", | ||
"load-balanced" | ||
] | ||
} | ||
], | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"useMultipleMongoses": false, | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
], | ||
"uriOptions": { | ||
"retryReads": true | ||
} | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "retryable-read-in-transaction-test" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "coll" | ||
} | ||
}, | ||
{ | ||
"session": { | ||
"id": "session0", | ||
"client": "client0" | ||
} | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "find does not retry in a transaction", | ||
"operations": [ | ||
{ | ||
"name": "startTransaction", | ||
"object": "session0" | ||
}, | ||
{ | ||
"name": "failPoint", | ||
"object": "testRunner", | ||
"arguments": { | ||
"client": "client0", | ||
"failPoint": { | ||
"configureFailPoint": "failCommand", | ||
"mode": { | ||
"times": 1 | ||
}, | ||
"data": { | ||
"failCommands": [ | ||
"find" | ||
], | ||
"closeConnection": true | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "find", | ||
"object": "collection0", | ||
"arguments": { | ||
"filter": {}, | ||
"session": "session0" | ||
}, | ||
"expectError": { | ||
"isError": true, | ||
"errorLabelsContain": [ | ||
"TransientTransactionError" | ||
] | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"find": "coll", | ||
"filter": {}, | ||
"startTransaction": true | ||
}, | ||
"commandName": "find", | ||
"databaseName": "retryable-read-in-transaction-test" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
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