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

DRIVERS-1389 Make ExceededTimeLimit a retryable reads error #1478

Merged
merged 9 commits into from
Nov 30, 2023
3 changes: 3 additions & 0 deletions source/retryable-reads/retryable-reads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ An error is considered retryable if it meets any of the following criteria:
=============================== ==============
**Error Name** **Error Code**
=============================== ==============
ExceededTimeLimit 262
InterruptedAtShutdown 11600
InterruptedDueToReplStateChange 11602
NotWritablePrimary 10107
Expand Down Expand Up @@ -703,6 +704,8 @@ degraded performance can simply disable ``retryableReads``.
Changelog
=========
:2023-11-28: Add ExceededTimeLimit to the list of error codes that should
be retried.
:2023-08-26: Require that in a sharded cluster the server on which the
operation failed MUST be provided to the server selection
mechanism as a deprioritized server.
Expand Down
147 changes: 147 additions & 0 deletions source/retryable-reads/tests/unified/exceededTimeLimit.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions source/retryable-reads/tests/unified/exceededTimeLimit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
description: "ExceededTimeLimit is a retryable read"

schemaVersion: "1.3"

runOnRequirements:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted that these requirements are consistent with the legacy tests in https://github.com/mongodb/specifications/blob/master/source/retryable-reads/tests/legacy/find.yml

- minServerVersion: "4.0"
topologies: [single, replicaset]
- minServerVersion: "4.1.7"
topologies: [sharded, load-balanced]

createEntities:
- client:
id: &client0 client0
useMultipleMongoses: false # Ensure the `configureFailpoint` and `find` command are run on the same mongos.
kkloberdanz marked this conversation as resolved.
Show resolved Hide resolved
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
Loading