Skip to content

Commit

Permalink
GODRIVER-3030 Retry ReadConcernMajorityNotAvailableYet errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdale committed Nov 15, 2024
1 parent 91abd88 commit cb31801
Show file tree
Hide file tree
Showing 93 changed files with 4,869 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/integration/unified/unified_spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var (
"command-monitoring/logging",
"connection-monitoring-and-pooling/logging",
"sessions",
"retryable-reads/unified",
"retryable-writes/unified",
"client-side-encryption/unified",
"client-side-operations-timeout",
Expand Down
2 changes: 1 addition & 1 deletion internal/integration/unified_spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const dataPath string = "../../testdata/"
var directories = []string{
"transactions/legacy",
"convenient-transactions",
"retryable-reads",
"retryable-reads/legacy",
"read-write-concern/operation",
"server-discovery-and-monitoring/integration",
"atlas-data-lake-testing",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
147 changes: 147 additions & 0 deletions testdata/retryable-reads/unified/exceededTimeLimit.json
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"
}
}
]
}
]
}
]
}
68 changes: 68 additions & 0 deletions testdata/retryable-reads/unified/exceededTimeLimit.yml
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
Loading

0 comments on commit cb31801

Please sign in to comment.