Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ExceededTimeLimit a retryable read error #1482

Merged
merged 4 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/libmongoc/src/mongoc/mongoc-error.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ _mongoc_read_error_get_type (bool cmd_ret,
}

switch (error.code) {
case MONGOC_SERVER_ERR_EXCEEDEDTIMELIMIT:
case MONGOC_SERVER_ERR_INTERRUPTEDATSHUTDOWN:
case MONGOC_SERVER_ERR_INTERRUPTEDDUETOREPLSTATECHANGE:
case MONGOC_SERVER_ERR_NOTPRIMARY:
Expand Down
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"
}
}
]
}
]
}
]
}