-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CDRIVER-4751 Make ExceededTimeLimit a retryable read error (#1482)
- Loading branch information
1 parent
5e27ad6
commit 9d9d996
Showing
3 changed files
with
318 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
170 changes: 170 additions & 0 deletions
170
src/libmongoc/tests/json/retryable_reads/unified/ExceededTimeLimit.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,170 @@ | ||
{ | ||
"description": "ExceededTimeLimit is a retryable read", | ||
"schemaVersion": "1.3", | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "4.2", | ||
"topologies": [ | ||
"replicaset", | ||
"sharded", | ||
"load-balanced" | ||
], | ||
"auth": true | ||
} | ||
], | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"useMultipleMongoses": false, | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "find-tests" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "coll0" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "coll0", | ||
"databaseName": "find-tests", | ||
"documents": [ | ||
{ | ||
"_id": 1, | ||
"x": 11 | ||
}, | ||
{ | ||
"_id": 2, | ||
"x": 22 | ||
}, | ||
{ | ||
"_id": 3, | ||
"x": 33 | ||
}, | ||
{ | ||
"_id": 4, | ||
"x": 44 | ||
}, | ||
{ | ||
"_id": 5, | ||
"x": 55 | ||
}, | ||
{ | ||
"_id": 6, | ||
"x": 66 | ||
} | ||
] | ||
} | ||
], | ||
"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" | ||
], | ||
"closeConnection": false, | ||
"errorCode": 262 | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "find", | ||
"arguments": { | ||
"filter": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
}, | ||
"batchSize": 10 | ||
}, | ||
"object": "collection0", | ||
"expectResult": [ | ||
{ | ||
"_id": 2, | ||
"x": 22 | ||
}, | ||
{ | ||
"_id": 3, | ||
"x": 33 | ||
}, | ||
{ | ||
"_id": 4, | ||
"x": 44 | ||
}, | ||
{ | ||
"_id": 5, | ||
"x": 55 | ||
}, | ||
{ | ||
"_id": 6, | ||
"x": 66 | ||
} | ||
] | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"find": "coll0", | ||
"filter": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
}, | ||
"batchSize": 10 | ||
}, | ||
"commandName": "find", | ||
"databaseName": "find-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"find": "coll0", | ||
"filter": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
}, | ||
"batchSize": 10 | ||
}, | ||
"commandName": "find", | ||
"databaseName": "find-tests" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
147 changes: 147 additions & 0 deletions
147
src/libmongoc/tests/json/retryable_reads/unified/exceededTimeLimit.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,147 @@ | ||
{ | ||
"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", | ||
"useMultipleMongoses": false, | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "retryable-reads-tests" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "exceededtimelimit-test" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "exceededtimelimit-test", | ||
"databaseName": "retryable-reads-tests", | ||
"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 | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"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": "exceededtimelimit-test", | ||
"filter": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
} | ||
}, | ||
"commandName": "find", | ||
"databaseName": "retryable-reads-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"find": "exceededtimelimit-test", | ||
"filter": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
} | ||
}, | ||
"commandName": "find", | ||
"databaseName": "retryable-reads-tests" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |