Skip to content

Commit fb9879c

Browse files
CXX-3112 Sync spec tests from CXX-2808 (#1245) (#1378)
Sync from specifications commit 5fc23f40f79d18f0693e7159eba81f0e7b276715 Co-authored-by: Kevin Albertson <[email protected]>
1 parent 3f71089 commit fb9879c

17 files changed

+4461
-4355
lines changed

data/retryable-writes/unified/bulkWrite-serverErrors.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
"schemaVersion": "1.0",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "3.6",
6+
"minServerVersion": "4.0",
77
"topologies": [
88
"replicaset"
99
]
10+
},
11+
{
12+
"minServerVersion": "4.1.7",
13+
"topologies": [
14+
"sharded"
15+
]
1016
}
1117
],
1218
"createEntities": [
@@ -55,16 +61,7 @@
5561
"description": "BulkWrite succeeds after retryable writeConcernError in first batch",
5662
"runOnRequirements": [
5763
{
58-
"minServerVersion": "4.0",
59-
"topologies": [
60-
"replicaset"
61-
]
62-
},
63-
{
64-
"minServerVersion": "4.1.7",
65-
"topologies": [
66-
"sharded"
67-
]
64+
"minServerVersion": "4.3.1"
6865
}
6966
],
7067
"operations": [

data/retryable-writes/unified/insertOne-serverErrors.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
"schemaVersion": "1.0",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "3.6",
6+
"minServerVersion": "4.0",
77
"topologies": [
88
"replicaset"
99
]
10+
},
11+
{
12+
"minServerVersion": "4.1.7",
13+
"topologies": [
14+
"sharded"
15+
]
1016
}
1117
],
1218
"createEntities": [
@@ -55,16 +61,7 @@
5561
"description": "InsertOne succeeds after retryable writeConcernError",
5662
"runOnRequirements": [
5763
{
58-
"minServerVersion": "4.0",
59-
"topologies": [
60-
"replicaset"
61-
]
62-
},
63-
{
64-
"minServerVersion": "4.1.7",
65-
"topologies": [
66-
"sharded"
67-
]
64+
"minServerVersion": "4.3.1"
6865
}
6966
],
7067
"operations": [
Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,314 @@
1+
{
2+
"runOn": [
3+
{
4+
"minServerVersion": "4.3.1",
5+
"topology": [
6+
"replicaset",
7+
"sharded",
8+
"load-balanced"
9+
],
10+
"serverless": "forbid"
11+
}
12+
],
13+
"database_name": "transaction-tests",
14+
"collection_name": "test",
15+
"data": [],
16+
"tests": [
17+
{
18+
"description": "add RetryableWriteError and UnknownTransactionCommitResult labels to retryable commit errors",
19+
"failPoint": {
20+
"configureFailPoint": "failCommand",
21+
"mode": {
22+
"times": 2
23+
},
24+
"data": {
25+
"failCommands": [
26+
"commitTransaction"
27+
],
28+
"errorCode": 11602,
29+
"errorLabels": [
30+
"RetryableWriteError"
31+
]
32+
}
33+
},
34+
"operations": [
35+
{
36+
"name": "startTransaction",
37+
"object": "session0"
38+
},
39+
{
40+
"name": "insertOne",
41+
"object": "collection",
42+
"arguments": {
43+
"session": "session0",
44+
"document": {
45+
"_id": 1
46+
}
47+
},
48+
"result": {
49+
"insertedId": 1
50+
}
51+
},
52+
{
53+
"name": "commitTransaction",
54+
"object": "session0",
55+
"result": {
56+
"errorLabelsContain": [
57+
"RetryableWriteError",
58+
"UnknownTransactionCommitResult"
59+
],
60+
"errorLabelsOmit": [
61+
"TransientTransactionError"
62+
]
63+
}
64+
},
65+
{
66+
"name": "commitTransaction",
67+
"object": "session0"
68+
}
69+
],
70+
"expectations": [
71+
{
72+
"command_started_event": {
73+
"command": {
74+
"insert": "test",
75+
"documents": [
76+
{
77+
"_id": 1
78+
}
79+
],
80+
"ordered": true,
81+
"readConcern": null,
82+
"lsid": "session0",
83+
"txnNumber": {
84+
"$numberLong": "1"
85+
},
86+
"startTransaction": true,
87+
"autocommit": false,
88+
"writeConcern": null
89+
},
90+
"command_name": "insert",
91+
"database_name": "transaction-tests"
92+
}
93+
},
94+
{
95+
"command_started_event": {
96+
"command": {
97+
"commitTransaction": 1,
98+
"lsid": "session0",
99+
"txnNumber": {
100+
"$numberLong": "1"
101+
},
102+
"startTransaction": null,
103+
"autocommit": false,
104+
"writeConcern": null
105+
},
106+
"command_name": "commitTransaction",
107+
"database_name": "admin"
108+
}
109+
},
110+
{
111+
"command_started_event": {
112+
"command": {
113+
"commitTransaction": 1,
114+
"lsid": "session0",
115+
"txnNumber": {
116+
"$numberLong": "1"
117+
},
118+
"startTransaction": null,
119+
"autocommit": false,
120+
"writeConcern": {
121+
"w": "majority",
122+
"wtimeout": 10000
123+
}
124+
},
125+
"command_name": "commitTransaction",
126+
"database_name": "admin"
127+
}
128+
},
129+
{
130+
"command_started_event": {
131+
"command": {
132+
"commitTransaction": 1,
133+
"lsid": "session0",
134+
"txnNumber": {
135+
"$numberLong": "1"
136+
},
137+
"startTransaction": null,
138+
"autocommit": false,
139+
"writeConcern": {
140+
"w": "majority",
141+
"wtimeout": 10000
142+
}
143+
},
144+
"command_name": "commitTransaction",
145+
"database_name": "admin"
146+
}
147+
}
148+
],
149+
"outcome": {
150+
"collection": {
151+
"data": [
152+
{
153+
"_id": 1
154+
}
155+
]
156+
}
157+
}
158+
},
159+
{
160+
"description": "add RetryableWriteError and UnknownTransactionCommitResult labels to writeConcernError ShutdownInProgress",
161+
"failPoint": {
162+
"configureFailPoint": "failCommand",
163+
"mode": {
164+
"times": 2
165+
},
166+
"data": {
167+
"failCommands": [
168+
"commitTransaction"
169+
],
170+
"errorLabels": [
171+
"RetryableWriteError"
172+
],
173+
"writeConcernError": {
174+
"code": 91,
175+
"errmsg": "Replication is being shut down"
176+
}
177+
}
178+
},
179+
"operations": [
180+
{
181+
"name": "startTransaction",
182+
"object": "session0",
183+
"arguments": {
184+
"options": {
185+
"writeConcern": {
186+
"w": "majority"
187+
}
188+
}
189+
}
190+
},
191+
{
192+
"name": "insertOne",
193+
"object": "collection",
194+
"arguments": {
195+
"session": "session0",
196+
"document": {
197+
"_id": 1
198+
}
199+
},
200+
"result": {
201+
"insertedId": 1
202+
}
203+
},
204+
{
205+
"name": "commitTransaction",
206+
"object": "session0",
207+
"result": {
208+
"errorLabelsContain": [
209+
"RetryableWriteError",
210+
"UnknownTransactionCommitResult"
211+
],
212+
"errorLabelsOmit": [
213+
"TransientTransactionError"
214+
]
215+
}
216+
},
217+
{
218+
"name": "commitTransaction",
219+
"object": "session0"
220+
}
221+
],
222+
"expectations": [
223+
{
224+
"command_started_event": {
225+
"command": {
226+
"insert": "test",
227+
"documents": [
228+
{
229+
"_id": 1
230+
}
231+
],
232+
"ordered": true,
233+
"readConcern": null,
234+
"lsid": "session0",
235+
"txnNumber": {
236+
"$numberLong": "1"
237+
},
238+
"startTransaction": true,
239+
"autocommit": false,
240+
"writeConcern": null
241+
},
242+
"command_name": "insert",
243+
"database_name": "transaction-tests"
244+
}
245+
},
246+
{
247+
"command_started_event": {
248+
"command": {
249+
"commitTransaction": 1,
250+
"lsid": "session0",
251+
"txnNumber": {
252+
"$numberLong": "1"
253+
},
254+
"startTransaction": null,
255+
"autocommit": false,
256+
"writeConcern": {
257+
"w": "majority"
258+
}
259+
},
260+
"command_name": "commitTransaction",
261+
"database_name": "admin"
262+
}
263+
},
264+
{
265+
"command_started_event": {
266+
"command": {
267+
"commitTransaction": 1,
268+
"lsid": "session0",
269+
"txnNumber": {
270+
"$numberLong": "1"
271+
},
272+
"startTransaction": null,
273+
"autocommit": false,
274+
"writeConcern": {
275+
"w": "majority",
276+
"wtimeout": 10000
277+
}
278+
},
279+
"command_name": "commitTransaction",
280+
"database_name": "admin"
281+
}
282+
},
283+
{
284+
"command_started_event": {
285+
"command": {
286+
"commitTransaction": 1,
287+
"lsid": "session0",
288+
"txnNumber": {
289+
"$numberLong": "1"
290+
},
291+
"startTransaction": null,
292+
"autocommit": false,
293+
"writeConcern": {
294+
"w": "majority",
295+
"wtimeout": 10000
296+
}
297+
},
298+
"command_name": "commitTransaction",
299+
"database_name": "admin"
300+
}
301+
}
302+
],
303+
"outcome": {
304+
"collection": {
305+
"data": [
306+
{
307+
"_id": 1
308+
}
309+
]
310+
}
311+
}
312+
}
313+
]
314+
}

0 commit comments

Comments
 (0)