| 1 |
runOn: |
| 2 |
- minServerVersion: "4.3.1" |
| 3 |
topology: ["replicaset", "sharded", "load-balanced"] |
| 4 |
|
| 5 |
data: |
| 6 |
- { _id: 1, x: 11 } |
| 7 |
- { _id: 2, x: 22 } |
| 8 |
|
| 9 |
tests: |
| 10 |
- description: "FindOneAndUpdate succeeds with RetryableWriteError from server" |
| 11 |
failPoint: |
| 12 |
configureFailPoint: failCommand |
| 13 |
mode: { times: 1 } |
| 14 |
data: |
| 15 |
failCommands: ["findAndModify"] |
| 16 |
errorCode: 112 |
| 17 |
errorLabels: ["RetryableWriteError"] |
| 18 |
operation: |
| 19 |
name: "findOneAndUpdate" |
| 20 |
arguments: |
| 21 |
filter: { _id: 1 } |
| 22 |
update: { $inc: { x: 1 } } |
| 23 |
returnDocument: "Before" |
| 24 |
outcome: |
| 25 |
result: { _id: 1, x: 11 } |
| 26 |
collection: |
| 27 |
data: |
| 28 |
- { _id: 1, x: 12 } |
| 29 |
- { _id: 2, x: 22 } |
| 30 |
|
| 31 |
- description: "FindOneAndUpdate fails if server does not return RetryableWriteError" |
| 32 |
failPoint: |
| 33 |
configureFailPoint: failCommand |
| 34 |
mode: { times: 1 } |
| 35 |
data: |
| 36 |
failCommands: ["findAndModify"] |
| 37 |
errorCode: 11600 |
| 38 |
errorLabels: [] |
| 39 |
operation: |
| 40 |
name: "findOneAndUpdate" |
| 41 |
arguments: |
| 42 |
filter: { _id: 1 } |
| 43 |
update: { $inc: { x: 1 } } |
| 44 |
returnDocument: "Before" |
| 45 |
outcome: |
| 46 |
error: true |
| 47 |
result: |
| 48 |
errorLabelsOmit: ["RetryableWriteError"] |
| 49 |
collection: |
| 50 |
data: |
| 51 |
- { _id: 1, x: 11 } |
| 52 |
- { _id: 2, x: 22 } |