Skip to content

Commit 68130e6

Browse files
author
Divjot Arora
authored
GODRIVER-1486 Add directConnection URI option (#383)
1 parent e55c6c9 commit 68130e6

File tree

88 files changed

+2160
-102
lines changed

Some content is hidden

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

88 files changed

+2160
-102
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"uri": "mongodb+srv://test3.test.build.10gen.cc/?directConnection=false",
3+
"seeds": [
4+
"localhost.test.build.10gen.cc:27017"
5+
],
6+
"hosts": [
7+
"localhost:27017",
8+
"localhost:27018",
9+
"localhost:27019"
10+
],
11+
"options": {
12+
"ssl": true
13+
}
14+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
uri: "mongodb+srv://test3.test.build.10gen.cc/?directConnection=false"
2+
seeds:
3+
- localhost.test.build.10gen.cc:27017
4+
hosts:
5+
- localhost:27017
6+
- localhost:27018
7+
- localhost:27019
8+
options:
9+
ssl: true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"uri": "mongodb+srv://test3.test.build.10gen.cc/?directConnection=true",
3+
"seeds": [],
4+
"hosts": [],
5+
"error": true,
6+
"comment": "Should fail because directConnection=true is incompatible with SRV URIs."
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
uri: "mongodb+srv://test3.test.build.10gen.cc/?directConnection=true"
2+
seeds: []
3+
hosts: []
4+
error: true
5+
comment: Should fail because directConnection=true is incompatible with SRV URIs.

data/server-discovery-and-monitoring/rs/compatible.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
description: "Replica set member with large maxWireVersion"
2+
23
uri: "mongodb://a,b/?replicaSet=rs"
4+
35
phases: [
46
{
57
responses: [

data/server-discovery-and-monitoring/rs/compatible_unknown.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
description: "Replica set member and an unknown server"
2+
23
uri: "mongodb://a,b/?replicaSet=rs"
4+
35
phases: [
46
{
57
responses: [

data/server-discovery-and-monitoring/rs/discover_arbiters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"description": "Discover arbiters",
3-
"uri": "mongodb://a/?replicaSet=rs",
2+
"description": "Discover arbiters with directConnection URI option",
3+
"uri": "mongodb://a/?directConnection=false",
44
"phases": [
55
{
66
"responses": [

data/server-discovery-and-monitoring/rs/discover_arbiters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
description: "Discover arbiters"
1+
description: "Discover arbiters with directConnection URI option"
22

3-
uri: "mongodb://a/?replicaSet=rs"
3+
uri: "mongodb://a/?directConnection=false"
44

55
phases: [
66

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"description": "Discover arbiters with replicaSet URI option",
3+
"uri": "mongodb://a/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"responses": [
7+
[
8+
"a:27017",
9+
{
10+
"ok": 1,
11+
"ismaster": true,
12+
"hosts": [
13+
"a:27017"
14+
],
15+
"arbiters": [
16+
"b:27017"
17+
],
18+
"setName": "rs",
19+
"minWireVersion": 0,
20+
"maxWireVersion": 6
21+
}
22+
]
23+
],
24+
"outcome": {
25+
"servers": {
26+
"a:27017": {
27+
"type": "RSPrimary",
28+
"setName": "rs"
29+
},
30+
"b:27017": {
31+
"type": "Unknown",
32+
"setName": null
33+
}
34+
},
35+
"topologyType": "ReplicaSetWithPrimary",
36+
"logicalSessionTimeoutMinutes": null,
37+
"setName": "rs"
38+
}
39+
}
40+
]
41+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
description: "Discover arbiters with replicaSet URI option"
2+
3+
uri: "mongodb://a/?replicaSet=rs"
4+
5+
phases: [
6+
7+
{
8+
responses: [
9+
10+
["a:27017", {
11+
12+
ok: 1,
13+
ismaster: true,
14+
hosts: ["a:27017"],
15+
arbiters: ["b:27017"],
16+
setName: "rs",
17+
minWireVersion: 0,
18+
maxWireVersion: 6
19+
}]
20+
],
21+
22+
outcome: {
23+
24+
servers: {
25+
26+
"a:27017": {
27+
28+
type: "RSPrimary",
29+
setName: "rs"
30+
},
31+
32+
"b:27017": {
33+
34+
type: "Unknown",
35+
setName:
36+
}
37+
},
38+
topologyType: "ReplicaSetWithPrimary",
39+
logicalSessionTimeoutMinutes: null,
40+
setName: "rs"
41+
}
42+
}
43+
]

0 commit comments

Comments
 (0)