Skip to content

Commit 099da57

Browse files
committed
CSHARP-5855: Add spec test for server deprioritization with changed ServerDescription
1 parent 0680b8c commit 099da57

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"topology_description": {
3+
"type": "ReplicaSetWithPrimary",
4+
"servers": [
5+
{
6+
"address": "b:27017",
7+
"avg_rtt_ms": 5,
8+
"type": "RSSecondary",
9+
"tags": {
10+
"data_center": "nyc"
11+
}
12+
},
13+
{
14+
"address": "c:27017",
15+
"avg_rtt_ms": 100,
16+
"type": "RSSecondary",
17+
"tags": {
18+
"data_center": "nyc"
19+
}
20+
},
21+
{
22+
"address": "a:27017",
23+
"avg_rtt_ms": 25,
24+
"type": "RSPrimary",
25+
"tags": {
26+
"data_center": "nyc"
27+
}
28+
}
29+
]
30+
},
31+
"operation": "read",
32+
"read_preference": {
33+
"mode": "Nearest",
34+
"tag_sets": [
35+
{
36+
"data_center": "nyc"
37+
}
38+
]
39+
},
40+
"deprioritized_servers": [
41+
{
42+
"address": "b:27017",
43+
"avg_rtt_ms": 50,
44+
"type": "RSPrimary",
45+
"tags": {
46+
"data_center": "nyc"
47+
}
48+
}
49+
],
50+
"suitable_servers": [
51+
{
52+
"address": "c:27017",
53+
"avg_rtt_ms": 100,
54+
"type": "RSSecondary",
55+
"tags": {
56+
"data_center": "nyc"
57+
}
58+
},
59+
{
60+
"address": "a:27017",
61+
"avg_rtt_ms": 25,
62+
"type": "RSPrimary",
63+
"tags": {
64+
"data_center": "nyc"
65+
}
66+
}
67+
],
68+
"in_latency_window": [
69+
{
70+
"address": "a:27017",
71+
"avg_rtt_ms": 25,
72+
"type": "RSPrimary",
73+
"tags": {
74+
"data_center": "nyc"
75+
}
76+
}
77+
]
78+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
topology_description:
2+
type: ReplicaSetWithPrimary
3+
servers:
4+
- address: b:27017
5+
avg_rtt_ms: 5
6+
type: RSSecondary
7+
tags:
8+
data_center: nyc
9+
- &2
10+
address: c:27017
11+
avg_rtt_ms: 100
12+
type: RSSecondary
13+
tags:
14+
data_center: nyc
15+
- &3
16+
address: a:27017
17+
avg_rtt_ms: 25
18+
type: RSPrimary
19+
tags:
20+
data_center: nyc
21+
22+
operation: read
23+
24+
read_preference:
25+
mode: Nearest
26+
tag_sets:
27+
- data_center: nyc
28+
29+
deprioritized_servers:
30+
- address: "b:27017"
31+
avg_rtt_ms: 50
32+
type: RSPrimary
33+
tags:
34+
data_center: nyc
35+
36+
suitable_servers:
37+
- *2
38+
- *3
39+
40+
in_latency_window:
41+
- *3

0 commit comments

Comments
 (0)