1{
2 "runOn": [
3 {
4 "minServerVersion": "4.0",
5 "topology": [
6 "replicaset"
7 ]
8 },
9 {
10 "minServerVersion": "4.1.7",
11 "topology": [
12 "sharded",
13 "load-balanced"
14 ]
15 }
16 ],
17 "data": [
18 {
19 "_id": 1,
20 "x": 11
21 },
22 {
23 "_id": 2,
24 "x": 22
25 }
26 ],
27 "tests": [
28 {
29 "description": "ReplaceOne succeeds after PrimarySteppedDown",
30 "failPoint": {
31 "configureFailPoint": "failCommand",
32 "mode": {
33 "times": 1
34 },
35 "data": {
36 "failCommands": [
37 "update"
38 ],
39 "errorCode": 189,
40 "errorLabels": [
41 "RetryableWriteError"
42 ]
43 }
44 },
45 "operation": {
46 "name": "replaceOne",
47 "arguments": {
48 "filter": {
49 "_id": 1
50 },
51 "replacement": {
52 "_id": 1,
53 "x": 111
54 }
55 }
56 },
57 "outcome": {
58 "result": {
59 "matchedCount": 1,
60 "modifiedCount": 1,
61 "upsertedCount": 0
62 },
63 "collection": {
64 "data": [
65 {
66 "_id": 1,
67 "x": 111
68 },
69 {
70 "_id": 2,
71 "x": 22
72 }
73 ]
74 }
75 }
76 },
77 {
78 "description": "ReplaceOne succeeds after WriteConcernError ShutdownInProgress",
79 "failPoint": {
80 "configureFailPoint": "failCommand",
81 "mode": {
82 "times": 1
83 },
84 "data": {
85 "failCommands": [
86 "update"
87 ],
88 "writeConcernError": {
89 "code": 91,
90 "errmsg": "Replication is being shut down",
91 "errorLabels": [
92 "RetryableWriteError"
93 ]
94 }
95 }
96 },
97 "operation": {
98 "name": "replaceOne",
99 "arguments": {
100 "filter": {
101 "_id": 1
102 },
103 "replacement": {
104 "_id": 1,
105 "x": 111
106 }
107 }
108 },
109 "outcome": {
110 "result": {
111 "matchedCount": 1,
112 "modifiedCount": 1,
113 "upsertedCount": 0
114 },
115 "collection": {
116 "data": [
117 {
118 "_id": 1,
119 "x": 111
120 },
121 {
122 "_id": 2,
123 "x": 22
124 }
125 ]
126 }
127 }
128 },
129 {
130 "description": "ReplaceOne fails with a RetryableWriteError label after two connection failures",
131 "failPoint": {
132 "configureFailPoint": "failCommand",
133 "mode": {
134 "times": 2
135 },
136 "data": {
137 "failCommands": [
138 "update"
139 ],
140 "closeConnection": true
141 }
142 },
143 "operation": {
144 "name": "replaceOne",
145 "arguments": {
146 "filter": {
147 "_id": 1
148 },
149 "replacement": {
150 "_id": 1,
151 "x": 111
152 }
153 }
154 },
155 "outcome": {
156 "error": true,
157 "result": {
158 "errorLabelsContain": [
159 "RetryableWriteError"
160 ]
161 },
162 "collection": {
163 "data": [
164 {
165 "_id": 1,
166 "x": 11
167 },
168 {
169 "_id": 2,
170 "x": 22
171 }
172 ]
173 }
174 }
175 }
176 ]
177}
View as plain text