-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DRIVERS-1389 Make ExceededTimeLimit a retryable reads error (#1478)
See C Driver implementation for reference. mongodb/mongo-c-driver#1482 --------- Co-authored-by: Jeremy Mikola <[email protected]> Co-authored-by: Kevin Albertson <[email protected]>
- Loading branch information
1 parent
82da02b
commit 5786a46
Showing
3 changed files
with
218 additions
and
0 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
147 changes: 147 additions & 0 deletions
147
source/retryable-reads/tests/unified/exceededTimeLimit.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
source/retryable-reads/tests/unified/exceededTimeLimit.yml
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,68 @@ | ||
description: "ExceededTimeLimit is a retryable read" | ||
|
||
schemaVersion: "1.3" | ||
|
||
runOnRequirements: | ||
- minServerVersion: "4.0" | ||
topologies: [single, replicaset] | ||
- minServerVersion: "4.1.7" | ||
topologies: [sharded, load-balanced] | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
# Ensure the `configureFailpoint` and `find` commands are run on the same mongos | ||
useMultipleMongoses: false | ||
observeEvents: [ commandStartedEvent ] | ||
- database: | ||
id: &database0 database0 | ||
client: *client0 | ||
databaseName: &database0Name "retryable-reads-tests" | ||
- collection: | ||
id: &collection0 collection0 | ||
database: *database0 | ||
collectionName: &collection0Name "exceededtimelimit-test" | ||
|
||
initialData: | ||
- collectionName: *collection0Name | ||
databaseName: *database0Name | ||
documents: | ||
- { _id: 1, x: 11 } | ||
- { _id: 2, x: 22 } | ||
- { _id: 3, x: 33 } | ||
|
||
tests: | ||
- description: "Find succeeds on second attempt after ExceededTimeLimit" | ||
operations: | ||
- name: failPoint | ||
object: testRunner | ||
arguments: | ||
client: *client0 | ||
failPoint: | ||
configureFailPoint: failCommand | ||
mode: { times: 1 } | ||
data: | ||
failCommands: [ "find" ] | ||
errorCode: 262 # ExceededTimeLimit | ||
- name: find | ||
arguments: | ||
filter: { _id: { $gt: 1 } } | ||
object: *collection0 | ||
expectResult: | ||
- { _id: 2, x: 22 } | ||
- { _id: 3, x: 33 } | ||
expectEvents: | ||
- client: *client0 | ||
events: | ||
- commandStartedEvent: | ||
command: | ||
find: *collection0Name | ||
filter: { _id: { $gt: 1 } } | ||
commandName: find | ||
databaseName: *database0Name | ||
- commandStartedEvent: | ||
command: | ||
find: *collection0Name | ||
filter: { _id: { $gt: 1 } } | ||
commandName: find | ||
databaseName: *database0Name |