File tree Expand file tree Collapse file tree 4 files changed +86
-3
lines changed
tests/json/max_staleness/ReplicaSetNoPrimary Expand file tree Collapse file tree 4 files changed +86
-3
lines changed Original file line number Diff line number Diff line change @@ -541,7 +541,9 @@ mongoc_topology_description_lowest_max_wire_version (
541
541
for (i = 0 ; (size_t ) i < td -> servers -> items_len ; i ++ ) {
542
542
sd = (mongoc_server_description_t * ) mongoc_set_get_item (td -> servers , i );
543
543
544
- if (sd -> type != MONGOC_SERVER_UNKNOWN && sd -> max_wire_version < ret ) {
544
+ if (sd -> type != MONGOC_SERVER_UNKNOWN &&
545
+ sd -> type != MONGOC_SERVER_POSSIBLE_PRIMARY &&
546
+ sd -> max_wire_version < ret ) {
545
547
ret = sd -> max_wire_version ;
546
548
}
547
549
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "topology_description" : {
3
+ "type" : " ReplicaSetNoPrimary" ,
4
+ "servers" : [
5
+ {
6
+ "address" : " a:27017" ,
7
+ "type" : " Unknown"
8
+ },
9
+ {
10
+ "address" : " b:27017" ,
11
+ "type" : " Unknown"
12
+ }
13
+ ]
14
+ },
15
+ "read_preference" : {
16
+ "mode" : " Nearest" ,
17
+ "maxStalenessSeconds" : 1
18
+ },
19
+ "error" : true
20
+ }
Original file line number Diff line number Diff line change 14
14
},
15
15
"read_preference" : {
16
16
"mode" : " Nearest" ,
17
- "maxStalenessSeconds" : 1
17
+ "maxStalenessSeconds" : 90
18
18
},
19
- "error" : true
19
+ "suitable_servers" : [],
20
+ "in_latency_window" : []
20
21
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "topology_description" : {
3
+ "type" : " ReplicaSetNoPrimary" ,
4
+ "servers" : [
5
+ {
6
+ "address" : " a:27017" ,
7
+ "type" : " PossiblePrimary" ,
8
+ "avg_rtt_ms" : 5 ,
9
+ "maxWireVersion" : 0
10
+ },
11
+ {
12
+ "address" : " b:27017" ,
13
+ "type" : " Unknown" ,
14
+ "avg_rtt_ms" : 5 ,
15
+ "maxWireVersion" : 0
16
+ },
17
+ {
18
+ "address" : " c:27017" ,
19
+ "type" : " RSSecondary" ,
20
+ "maxWireVersion" : 5 ,
21
+ "avg_rtt_ms" : 5 ,
22
+ "lastWrite" : {
23
+ "lastWriteDate" : {
24
+ "$numberLong" : " 1"
25
+ }
26
+ }
27
+ }
28
+ ]
29
+ },
30
+ "read_preference" : {
31
+ "mode" : " Nearest" ,
32
+ "maxStalenessSeconds" : 120
33
+ },
34
+ "suitable_servers" : [
35
+ {
36
+ "address" : " c:27017" ,
37
+ "type" : " RSSecondary" ,
38
+ "maxWireVersion" : 5 ,
39
+ "avg_rtt_ms" : 5 ,
40
+ "lastWrite" : {
41
+ "lastWriteDate" : {
42
+ "$numberLong" : " 1"
43
+ }
44
+ }
45
+ }
46
+ ],
47
+ "in_latency_window" : [
48
+ {
49
+ "address" : " c:27017" ,
50
+ "type" : " RSSecondary" ,
51
+ "maxWireVersion" : 5 ,
52
+ "avg_rtt_ms" : 5 ,
53
+ "lastWrite" : {
54
+ "lastWriteDate" : {
55
+ "$numberLong" : " 1"
56
+ }
57
+ }
58
+ }
59
+ ]
60
+ }
You can’t perform that action at this time.
0 commit comments