Skip to content

Commit 47996f3

Browse files
author
Isabella Siu
authored
GODRIVER-1572 reduce race conditions in SDAM error handling (#425)
1 parent 34d063f commit 47996f3

File tree

151 files changed

+13608
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+13608
-146
lines changed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"description": "Network timeouts before and after the handshake completes",
3+
"uri": "mongodb://a/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"description": "Primary A is discovered",
7+
"responses": [
8+
[
9+
"a:27017",
10+
{
11+
"ok": 1,
12+
"ismaster": true,
13+
"hosts": [
14+
"a:27017"
15+
],
16+
"setName": "rs",
17+
"minWireVersion": 0,
18+
"maxWireVersion": 9,
19+
"topologyVersion": {
20+
"processId": {
21+
"$oid": "000000000000000000000001"
22+
},
23+
"counter": {
24+
"$numberLong": "1"
25+
}
26+
}
27+
}
28+
]
29+
],
30+
"outcome": {
31+
"servers": {
32+
"a:27017": {
33+
"type": "RSPrimary",
34+
"setName": "rs",
35+
"topologyVersion": {
36+
"processId": {
37+
"$oid": "000000000000000000000001"
38+
},
39+
"counter": {
40+
"$numberLong": "1"
41+
}
42+
},
43+
"pool": {
44+
"generation": 0
45+
}
46+
}
47+
},
48+
"topologyType": "ReplicaSetWithPrimary",
49+
"logicalSessionTimeoutMinutes": null,
50+
"setName": "rs"
51+
}
52+
},
53+
{
54+
"description": "Ignore network timeout application error (afterHandshakeCompletes)",
55+
"applicationErrors": [
56+
{
57+
"address": "a:27017",
58+
"when": "afterHandshakeCompletes",
59+
"maxWireVersion": 9,
60+
"type": "timeout"
61+
}
62+
],
63+
"outcome": {
64+
"servers": {
65+
"a:27017": {
66+
"type": "RSPrimary",
67+
"setName": "rs",
68+
"topologyVersion": {
69+
"processId": {
70+
"$oid": "000000000000000000000001"
71+
},
72+
"counter": {
73+
"$numberLong": "1"
74+
}
75+
},
76+
"pool": {
77+
"generation": 0
78+
}
79+
}
80+
},
81+
"topologyType": "ReplicaSetWithPrimary",
82+
"logicalSessionTimeoutMinutes": null,
83+
"setName": "rs"
84+
}
85+
},
86+
{
87+
"description": "Mark server unknown on network timeout application error (beforeHandshakeCompletes)",
88+
"applicationErrors": [
89+
{
90+
"address": "a:27017",
91+
"when": "beforeHandshakeCompletes",
92+
"maxWireVersion": 9,
93+
"type": "timeout"
94+
}
95+
],
96+
"outcome": {
97+
"servers": {
98+
"a:27017": {
99+
"type": "Unknown",
100+
"topologyVersion": null,
101+
"pool": {
102+
"generation": 1
103+
}
104+
}
105+
},
106+
"topologyType": "ReplicaSetNoPrimary",
107+
"logicalSessionTimeoutMinutes": null,
108+
"setName": "rs"
109+
}
110+
}
111+
]
112+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
description: Network timeouts before and after the handshake completes
2+
uri: mongodb://a/?replicaSet=rs
3+
phases:
4+
- description: Primary A is discovered
5+
responses:
6+
- - a:27017
7+
- ok: 1
8+
ismaster: true
9+
hosts:
10+
- a:27017
11+
setName: rs
12+
minWireVersion: 0
13+
maxWireVersion: 9
14+
topologyVersion: &topologyVersion_1_1
15+
processId:
16+
"$oid": '000000000000000000000001'
17+
counter:
18+
"$numberLong": '1'
19+
outcome: &outcome
20+
servers:
21+
a:27017:
22+
type: RSPrimary
23+
setName: rs
24+
topologyVersion: *topologyVersion_1_1
25+
pool:
26+
generation: 0
27+
topologyType: ReplicaSetWithPrimary
28+
logicalSessionTimeoutMinutes: null
29+
setName: rs
30+
31+
- description: Ignore network timeout application error (afterHandshakeCompletes)
32+
applicationErrors:
33+
- address: a:27017
34+
when: afterHandshakeCompletes
35+
maxWireVersion: 9
36+
type: timeout
37+
outcome: *outcome
38+
39+
- description: Mark server unknown on network timeout application error (beforeHandshakeCompletes)
40+
applicationErrors:
41+
- address: a:27017
42+
when: beforeHandshakeCompletes
43+
maxWireVersion: 9
44+
type: timeout
45+
outcome:
46+
servers:
47+
a:27017:
48+
type: Unknown
49+
topologyVersion: null
50+
pool:
51+
generation: 1
52+
topologyType: ReplicaSetNoPrimary
53+
logicalSessionTimeoutMinutes: null
54+
setName: rs
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"description": "Non-stale network error",
3+
"uri": "mongodb://a/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"description": "Primary A is discovered",
7+
"responses": [
8+
[
9+
"a:27017",
10+
{
11+
"ok": 1,
12+
"ismaster": true,
13+
"hosts": [
14+
"a:27017"
15+
],
16+
"setName": "rs",
17+
"minWireVersion": 0,
18+
"maxWireVersion": 9,
19+
"topologyVersion": {
20+
"processId": {
21+
"$oid": "000000000000000000000001"
22+
},
23+
"counter": {
24+
"$numberLong": "1"
25+
}
26+
}
27+
}
28+
]
29+
],
30+
"outcome": {
31+
"servers": {
32+
"a:27017": {
33+
"type": "RSPrimary",
34+
"setName": "rs",
35+
"topologyVersion": {
36+
"processId": {
37+
"$oid": "000000000000000000000001"
38+
},
39+
"counter": {
40+
"$numberLong": "1"
41+
}
42+
},
43+
"pool": {
44+
"generation": 0
45+
}
46+
}
47+
},
48+
"topologyType": "ReplicaSetWithPrimary",
49+
"logicalSessionTimeoutMinutes": null,
50+
"setName": "rs"
51+
}
52+
},
53+
{
54+
"description": "Non-stale network error marks server Unknown",
55+
"applicationErrors": [
56+
{
57+
"address": "a:27017",
58+
"when": "afterHandshakeCompletes",
59+
"maxWireVersion": 9,
60+
"type": "network"
61+
}
62+
],
63+
"outcome": {
64+
"servers": {
65+
"a:27017": {
66+
"type": "Unknown",
67+
"topologyVersion": null,
68+
"pool": {
69+
"generation": 1
70+
}
71+
}
72+
},
73+
"topologyType": "ReplicaSetNoPrimary",
74+
"logicalSessionTimeoutMinutes": null,
75+
"setName": "rs"
76+
}
77+
}
78+
]
79+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
description: Non-stale network error
2+
uri: mongodb://a/?replicaSet=rs
3+
phases:
4+
- description: Primary A is discovered
5+
responses:
6+
- - a:27017
7+
- ok: 1
8+
ismaster: true
9+
hosts:
10+
- a:27017
11+
setName: rs
12+
minWireVersion: 0
13+
maxWireVersion: 9
14+
topologyVersion: &topologyVersion_1_1
15+
processId:
16+
"$oid": '000000000000000000000001'
17+
counter:
18+
"$numberLong": '1'
19+
outcome: &outcome
20+
servers:
21+
a:27017:
22+
type: RSPrimary
23+
setName: rs
24+
topologyVersion: *topologyVersion_1_1
25+
pool:
26+
generation: 0
27+
topologyType: ReplicaSetWithPrimary
28+
logicalSessionTimeoutMinutes: null
29+
setName: rs
30+
31+
- description: Non-stale network error marks server Unknown
32+
applicationErrors:
33+
- address: a:27017
34+
when: afterHandshakeCompletes
35+
maxWireVersion: 9
36+
type: network
37+
outcome:
38+
servers:
39+
a:27017:
40+
type: Unknown
41+
topologyVersion: null
42+
pool:
43+
generation: 1
44+
topologyType: ReplicaSetNoPrimary
45+
logicalSessionTimeoutMinutes: null
46+
setName: rs
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"description": "Non-stale network timeout error",
3+
"uri": "mongodb://a/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"description": "Primary A is discovered",
7+
"responses": [
8+
[
9+
"a:27017",
10+
{
11+
"ok": 1,
12+
"ismaster": true,
13+
"hosts": [
14+
"a:27017"
15+
],
16+
"setName": "rs",
17+
"minWireVersion": 0,
18+
"maxWireVersion": 9,
19+
"topologyVersion": {
20+
"processId": {
21+
"$oid": "000000000000000000000001"
22+
},
23+
"counter": {
24+
"$numberLong": "1"
25+
}
26+
}
27+
}
28+
]
29+
],
30+
"outcome": {
31+
"servers": {
32+
"a:27017": {
33+
"type": "RSPrimary",
34+
"setName": "rs",
35+
"topologyVersion": {
36+
"processId": {
37+
"$oid": "000000000000000000000001"
38+
},
39+
"counter": {
40+
"$numberLong": "1"
41+
}
42+
},
43+
"pool": {
44+
"generation": 0
45+
}
46+
}
47+
},
48+
"topologyType": "ReplicaSetWithPrimary",
49+
"logicalSessionTimeoutMinutes": null,
50+
"setName": "rs"
51+
}
52+
},
53+
{
54+
"description": "Non-stale network timeout error does not mark server Unknown",
55+
"applicationErrors": [
56+
{
57+
"address": "a:27017",
58+
"when": "afterHandshakeCompletes",
59+
"maxWireVersion": 9,
60+
"type": "timeout"
61+
}
62+
],
63+
"outcome": {
64+
"servers": {
65+
"a:27017": {
66+
"type": "RSPrimary",
67+
"setName": "rs",
68+
"topologyVersion": {
69+
"processId": {
70+
"$oid": "000000000000000000000001"
71+
},
72+
"counter": {
73+
"$numberLong": "1"
74+
}
75+
},
76+
"pool": {
77+
"generation": 0
78+
}
79+
}
80+
},
81+
"topologyType": "ReplicaSetWithPrimary",
82+
"logicalSessionTimeoutMinutes": null,
83+
"setName": "rs"
84+
}
85+
}
86+
]
87+
}

0 commit comments

Comments
 (0)