File tree Expand file tree Collapse file tree 3 files changed +89
-2
lines changed
test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read Expand file tree Collapse file tree 3 files changed +89
-2
lines changed Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ public String getName() {
344
344
@ Override
345
345
@ SuppressWarnings ("deprecation" )
346
346
public List <ServerDescription > chooseForReplicaSet (final ClusterDescription clusterDescription ) {
347
- List <ServerDescription > selectedServers = selectFreshServers (clusterDescription , clusterDescription .getAny ());
347
+ List <ServerDescription > selectedServers = selectFreshServers (clusterDescription , clusterDescription .getAnyPrimaryOrSecondary ());
348
348
if (!getTagSetList ().isEmpty ()) {
349
349
ClusterDescription nonStaleClusterDescription = copyClusterDescription (clusterDescription , selectedServers );
350
350
selectedServers = Collections .emptyList ();
Original file line number Diff line number Diff line change 53
53
"data_center" : " nyc"
54
54
},
55
55
"type" : " RSSecondary"
56
+ },
57
+ {
58
+ "address" : " d:27017" ,
59
+ "avg_rtt_ms" : 5 ,
60
+ "tags" : {
61
+ "data_center" : " nyc"
62
+ },
63
+ "type" : " RSArbiter"
64
+ },
65
+ {
66
+ "address" : " e:27017" ,
67
+ "avg_rtt_ms" : 5 ,
68
+ "tags" : {
69
+ "data_center" : " nyc"
70
+ },
71
+ "type" : " RSGhost"
56
72
}
57
- ],
73
+ ],
58
74
"type" : " ReplicaSetNoPrimary"
59
75
}
60
76
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "in_latency_window" : [
3
+ {
4
+ "address" : " b:27017" ,
5
+ "avg_rtt_ms" : 5 ,
6
+ "tags" : {
7
+ "data_center" : " nyc"
8
+ },
9
+ "type" : " RSSecondary"
10
+ }
11
+ ],
12
+ "operation" : " read" ,
13
+ "read_preference" : {
14
+ "mode" : " Nearest" ,
15
+ },
16
+ "suitable_servers" : [
17
+ {
18
+ "address" : " b:27017" ,
19
+ "avg_rtt_ms" : 5 ,
20
+ "tags" : {
21
+ "data_center" : " nyc"
22
+ },
23
+ "type" : " RSSecondary"
24
+ },
25
+ {
26
+ "address" : " c:27017" ,
27
+ "avg_rtt_ms" : 100 ,
28
+ "tags" : {
29
+ "data_center" : " nyc"
30
+ },
31
+ "type" : " RSSecondary"
32
+ }
33
+ ],
34
+ "topology_description" : {
35
+ "servers" : [
36
+ {
37
+ "address" : " b:27017" ,
38
+ "avg_rtt_ms" : 5 ,
39
+ "tags" : {
40
+ "data_center" : " nyc"
41
+ },
42
+ "type" : " RSSecondary"
43
+ },
44
+ {
45
+ "address" : " c:27017" ,
46
+ "avg_rtt_ms" : 100 ,
47
+ "tags" : {
48
+ "data_center" : " nyc"
49
+ },
50
+ "type" : " RSSecondary"
51
+ },
52
+ {
53
+ "address" : " d:27017" ,
54
+ "avg_rtt_ms" : 5 ,
55
+ "tags" : {
56
+ "data_center" : " nyc"
57
+ },
58
+ "type" : " RSArbiter"
59
+ },
60
+ {
61
+ "address" : " e:27017" ,
62
+ "avg_rtt_ms" : 5 ,
63
+ "tags" : {
64
+ "data_center" : " nyc"
65
+ },
66
+ "type" : " RSGhost"
67
+ }
68
+ ],
69
+ "type" : " ReplicaSetNoPrimary"
70
+ }
71
+ }
You can’t perform that action at this time.
0 commit comments