-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GODRIVER-3030 Retry ReadConcernMajorityNotAvailableYet errors. (#1893)
- Loading branch information
1 parent
6824503
commit 7ea8947
Showing
89 changed files
with
233 additions
and
2 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
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
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.
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.
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.
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.
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
147
testdata/retryable-reads/unified/readConcernMajorityNotAvailableYet.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": "ReadConcernMajorityNotAvailableYet 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": "readconcernmajoritynotavailableyet_test" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "readconcernmajoritynotavailableyet_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 ReadConcernMajorityNotAvailableYet", | ||
"operations": [ | ||
{ | ||
"name": "failPoint", | ||
"object": "testRunner", | ||
"arguments": { | ||
"client": "client0", | ||
"failPoint": { | ||
"configureFailPoint": "failCommand", | ||
"mode": { | ||
"times": 1 | ||
}, | ||
"data": { | ||
"failCommands": [ | ||
"find" | ||
], | ||
"errorCode": 134 | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"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": "readconcernmajoritynotavailableyet_test", | ||
"filter": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
} | ||
}, | ||
"commandName": "find", | ||
"databaseName": "retryable-reads-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"find": "readconcernmajoritynotavailableyet_test", | ||
"filter": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
} | ||
}, | ||
"commandName": "find", | ||
"databaseName": "retryable-reads-tests" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
68 changes: 68 additions & 0 deletions
68
testdata/retryable-reads/unified/readConcernMajorityNotAvailableYet.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: "ReadConcernMajorityNotAvailableYet 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 "readconcernmajoritynotavailableyet_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 ReadConcernMajorityNotAvailableYet" | ||
operations: | ||
- name: failPoint | ||
object: testRunner | ||
arguments: | ||
client: *client0 | ||
failPoint: | ||
configureFailPoint: failCommand | ||
mode: { times: 1 } | ||
data: | ||
failCommands: [ "find" ] | ||
errorCode: 134 # ReadConcernMajorityNotAvailableYet | ||
- 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 |
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