Skip to content

Commit c0999ca

Browse files
authored
Merge branch 'main' into token-bucket-optional
2 parents 098c0df + a1c04e2 commit c0999ca

7 files changed

Lines changed: 142 additions & 49 deletions

File tree

test/spec/server-discovery-and-monitoring/errors/error_handling_handshake.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
}
8686
},
8787
{
88-
"description": "Mark server unknown on network timeout application error (beforeHandshakeCompletes)",
88+
"description": "Ignore network timeout application error (beforeHandshakeCompletes)",
8989
"applicationErrors": [
9090
{
9191
"address": "a:27017",
@@ -118,4 +118,4 @@
118118
}
119119
}
120120
]
121-
}
121+
}
Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,48 @@
11
description: Network timeouts before and after the handshake completes
22
uri: mongodb://a/?replicaSet=rs
33
phases:
4-
- description: Primary A is discovered
5-
responses:
6-
- - a:27017
7-
- ok: 1
8-
helloOk: true
9-
isWritablePrimary: true
10-
hosts:
11-
- a:27017
4+
- description: Primary A is discovered
5+
responses:
6+
- - a:27017
7+
- ok: 1
8+
helloOk: true
9+
isWritablePrimary: true
10+
hosts:
11+
- a:27017
12+
setName: rs
13+
minWireVersion: 0
14+
maxWireVersion: 9
15+
topologyVersion: &topologyVersion_1_1
16+
processId:
17+
"$oid": '000000000000000000000001'
18+
counter:
19+
"$numberLong": '1'
20+
outcome: &outcome
21+
servers:
22+
a:27017:
23+
type: RSPrimary
24+
setName: rs
25+
topologyVersion: *topologyVersion_1_1
26+
pool:
27+
generation: 0
28+
topologyType: ReplicaSetWithPrimary
29+
logicalSessionTimeoutMinutes: null
1230
setName: rs
13-
minWireVersion: 0
14-
maxWireVersion: 9
15-
topologyVersion: &topologyVersion_1_1
16-
processId:
17-
"$oid": '000000000000000000000001'
18-
counter:
19-
"$numberLong": '1'
20-
outcome: &outcome
21-
servers:
22-
a:27017:
23-
type: RSPrimary
24-
setName: rs
25-
topologyVersion: *topologyVersion_1_1
26-
pool:
27-
generation: 0
28-
topologyType: ReplicaSetWithPrimary
29-
logicalSessionTimeoutMinutes: null
30-
setName: rs
3131

32-
- description: Ignore network timeout application error (afterHandshakeCompletes)
33-
applicationErrors:
34-
- address: a:27017
35-
when: afterHandshakeCompletes
36-
maxWireVersion: 9
37-
type: timeout
38-
outcome: *outcome
32+
- description: Ignore network timeout application error (afterHandshakeCompletes)
33+
applicationErrors:
34+
- address: a:27017
35+
when: afterHandshakeCompletes
36+
maxWireVersion: 9
37+
type: timeout
38+
outcome: *outcome
3939

40-
- description: Mark server unknown on network timeout application error (beforeHandshakeCompletes)
41-
applicationErrors:
42-
- address: a:27017
43-
when: beforeHandshakeCompletes
44-
maxWireVersion: 9
45-
type: timeout
46-
outcome: *outcome
40+
- description: Ignore network timeout application error (beforeHandshakeCompletes)
41+
# The test runner may need to add the SystemOverloadedError label for the pre-handshake network timeout.
42+
# The SystemOverloadedError label causes the error to be ignored.
43+
applicationErrors:
44+
- address: a:27017
45+
when: beforeHandshakeCompletes
46+
maxWireVersion: 9
47+
type: timeout
48+
outcome: *outcome
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"topology_description": {
3+
"type": "ReplicaSetWithPrimary",
4+
"servers": [
5+
{
6+
"address": "a:27017",
7+
"avg_rtt_ms": 5,
8+
"type": "RSPrimary"
9+
},
10+
{
11+
"address": "b:27017",
12+
"avg_rtt_ms": 5,
13+
"type": "RSSecondary"
14+
}
15+
]
16+
},
17+
"operation": "read",
18+
"read_preference": {
19+
"mode": "SecondaryPreferred",
20+
"tag_sets": [
21+
{
22+
"data_center": "nyc"
23+
},
24+
{}
25+
]
26+
},
27+
"suitable_servers": [
28+
{
29+
"address": "b:27017",
30+
"avg_rtt_ms": 5,
31+
"type": "RSSecondary"
32+
}
33+
],
34+
"in_latency_window": [
35+
{
36+
"address": "b:27017",
37+
"avg_rtt_ms": 5,
38+
"type": "RSSecondary"
39+
}
40+
]
41+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Attempt to select the secondary using an empty tag set. Expect empty tag set to match.
2+
# This is a regression test for RUST-2363.
3+
---
4+
topology_description:
5+
type: ReplicaSetWithPrimary
6+
servers:
7+
- &1
8+
address: a:27017
9+
avg_rtt_ms: 5
10+
type: RSPrimary
11+
# No "tags".
12+
- &2
13+
address: b:27017
14+
avg_rtt_ms: 5
15+
type: RSSecondary
16+
# No "tags"
17+
operation: read
18+
read_preference:
19+
mode: SecondaryPreferred
20+
tag_sets:
21+
- data_center: nyc # Does not match.
22+
- {} # Empty tag set.
23+
suitable_servers:
24+
- *2
25+
in_latency_window:
26+
- *2

test/spec/transactions/unified/backpressure-retryable-writes.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,17 +412,31 @@
412412
"events": [
413413
{
414414
"commandStartedEvent": {
415-
"commandName": "insert"
415+
"command": {
416+
"startTransaction": true
417+
},
418+
"commandName": "insert",
419+
"databaseName": "transaction-tests"
416420
}
417421
},
418422
{
419423
"commandStartedEvent": {
420-
"commandName": "insert"
424+
"command": {
425+
"startTransaction": true
426+
},
427+
"commandName": "insert",
428+
"databaseName": "transaction-tests"
421429
}
422430
},
423431
{
424432
"commandStartedEvent": {
425-
"commandName": "abortTransaction"
433+
"command": {
434+
"startTransaction": {
435+
"$$exists": false
436+
}
437+
},
438+
"commandName": "abortTransaction",
439+
"databaseName": "admin"
426440
}
427441
}
428442
]
@@ -437,4 +451,4 @@
437451
]
438452
}
439453
]
440-
}
454+
}

test/spec/transactions/unified/backpressure-retryable-writes.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ tests:
144144
outcome:
145145
- collectionName: *collection_name
146146
databaseName: *database_name
147-
documents:
147+
documents:
148148
- { _id: 1 }
149149
- { _id: 2 }
150150
- description: writes are retried maxAttempts=5 times if backpressure labels are added
@@ -239,12 +239,22 @@ tests:
239239
- client: *client0
240240
events:
241241
- commandStartedEvent:
242+
command:
243+
startTransaction: true
242244
commandName: insert
245+
databaseName: *database_name
243246
- commandStartedEvent:
247+
command:
248+
startTransaction: true
244249
commandName: insert
250+
databaseName: *database_name
245251
- commandStartedEvent:
252+
command:
253+
startTransaction:
254+
$$exists: false
246255
commandName: abortTransaction
256+
databaseName: admin
247257
outcome:
248258
- collectionName: *collection_name
249259
databaseName: *database_name
250-
documents: []
260+
documents: []

0 commit comments

Comments
 (0)