...
1runOn:
2 -
3 minServerVersion: "4.0"
4 topology: ["replicaset"]
5 -
6 minServerVersion: "4.1.7"
7 topology: ["sharded", "load-balanced"]
8
9data:
10 - { _id: 1, x: 11 }
11 - { _id: 2, x: 22 }
12
13tests:
14 -
15 description: "FindOneAndUpdate succeeds after PrimarySteppedDown"
16 failPoint:
17 configureFailPoint: failCommand
18 mode: { times: 1 }
19 data:
20 failCommands: ["findAndModify"]
21 errorCode: 189
22 errorLabels: ["RetryableWriteError"]
23 operation:
24 name: "findOneAndUpdate"
25 arguments:
26 filter: { _id: 1 }
27 update: { $inc: { x : 1 }}
28 returnDocument: "Before"
29 outcome:
30 result: { _id: 1, x: 11 }
31 collection:
32 data:
33 - { _id: 1, x: 12 }
34 - { _id: 2, x: 22 }
35 -
36 description: "FindOneAndUpdate succeeds after WriteConcernError ShutdownInProgress"
37 failPoint:
38 configureFailPoint: failCommand
39 mode: { times: 1 }
40 data:
41 failCommands: ["findAndModify"]
42 writeConcernError:
43 code: 91
44 errmsg: Replication is being shut down
45 errorLabels: ["RetryableWriteError"]
46 operation:
47 name: "findOneAndUpdate"
48 arguments:
49 filter: { _id: 1 }
50 update: { $inc: { x : 1 }}
51 returnDocument: "Before"
52 outcome:
53 result: { _id: 1, x: 11 }
54 collection:
55 data:
56 - { _id: 1, x: 12 }
57 - { _id: 2, x: 22 }
58 -
59 description: "FindOneAndUpdate fails with a RetryableWriteError label after two connection failures"
60 failPoint:
61 configureFailPoint: failCommand
62 mode: { times: 2 }
63 data:
64 failCommands: ["findAndModify"]
65 closeConnection: true
66 operation:
67 name: "findOneAndUpdate"
68 arguments:
69 filter: { _id: 1 }
70 update: { $inc: { x: 1 } }
71 returnDocument: "Before"
72 outcome:
73 error: true
74 result:
75 errorLabelsContain: ["RetryableWriteError"]
76 collection:
77 data:
78 - { _id: 1, x: 11 }
79 - { _id: 2, x: 22 }
View as plain text