-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: directConnection adds unify behavior for replica set discovery
Adds `directConnection` option to unify behavior around configuration for replica set discovery. Migrated mongodb/specifications tests from commit "e56f5eceed7729f8b9b43a4a1f76c7e5840db49f". Skips SDAM tests for legacy topology / behavior that we do not intend to introduce to the legacy topology types. Users should switch to the unified topology. NODE-2452
- Loading branch information
Thomas Reggi
authored
Apr 9, 2020
1 parent
60e31b0
commit c5d60fc
Showing
81 changed files
with
1,608 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
test/spec/initial-dns-seedlist-discovery/direct-connection-false.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"uri": "mongodb+srv://test3.test.build.10gen.cc/?directConnection=false", | ||
"seeds": [ | ||
"localhost.test.build.10gen.cc:27017" | ||
], | ||
"hosts": [ | ||
"localhost:27017", | ||
"localhost:27018", | ||
"localhost:27019" | ||
], | ||
"options": { | ||
"ssl": true | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
test/spec/initial-dns-seedlist-discovery/direct-connection-false.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
uri: "mongodb+srv://test3.test.build.10gen.cc/?directConnection=false" | ||
seeds: | ||
- localhost.test.build.10gen.cc:27017 | ||
hosts: | ||
- localhost:27017 | ||
- localhost:27018 | ||
- localhost:27019 | ||
options: | ||
ssl: true |
7 changes: 7 additions & 0 deletions
7
test/spec/initial-dns-seedlist-discovery/direct-connection-true.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"uri": "mongodb+srv://test3.test.build.10gen.cc/?directConnection=true", | ||
"seeds": [], | ||
"hosts": [], | ||
"error": true, | ||
"comment": "Should fail because directConnection=true is incompatible with SRV URIs." | ||
} |
5 changes: 5 additions & 0 deletions
5
test/spec/initial-dns-seedlist-discovery/direct-connection-true.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
uri: "mongodb+srv://test3.test.build.10gen.cc/?directConnection=true" | ||
seeds: [] | ||
hosts: [] | ||
error: true | ||
comment: Should fail because directConnection=true is incompatible with SRV URIs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/spec/server-discovery-and-monitoring/rs/compatible_unknown.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/spec/server-discovery-and-monitoring/rs/discover_arbiters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/spec/server-discovery-and-monitoring/rs/discover_arbiters.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
test/spec/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"description": "Discover arbiters with replicaSet URI option", | ||
"uri": "mongodb://a/?replicaSet=rs", | ||
"phases": [ | ||
{ | ||
"responses": [ | ||
[ | ||
"a:27017", | ||
{ | ||
"ok": 1, | ||
"ismaster": true, | ||
"hosts": [ | ||
"a:27017" | ||
], | ||
"arbiters": [ | ||
"b:27017" | ||
], | ||
"setName": "rs", | ||
"minWireVersion": 0, | ||
"maxWireVersion": 6 | ||
} | ||
] | ||
], | ||
"outcome": { | ||
"servers": { | ||
"a:27017": { | ||
"type": "RSPrimary", | ||
"setName": "rs" | ||
}, | ||
"b:27017": { | ||
"type": "Unknown", | ||
"setName": null | ||
} | ||
}, | ||
"topologyType": "ReplicaSetWithPrimary", | ||
"logicalSessionTimeoutMinutes": null, | ||
"setName": "rs" | ||
} | ||
} | ||
] | ||
} |
43 changes: 43 additions & 0 deletions
43
test/spec/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
description: "Discover arbiters with replicaSet URI option" | ||
|
||
uri: "mongodb://a/?replicaSet=rs" | ||
|
||
phases: [ | ||
|
||
{ | ||
responses: [ | ||
|
||
["a:27017", { | ||
|
||
ok: 1, | ||
ismaster: true, | ||
hosts: ["a:27017"], | ||
arbiters: ["b:27017"], | ||
setName: "rs", | ||
minWireVersion: 0, | ||
maxWireVersion: 6 | ||
}] | ||
], | ||
|
||
outcome: { | ||
|
||
servers: { | ||
|
||
"a:27017": { | ||
|
||
type: "RSPrimary", | ||
setName: "rs" | ||
}, | ||
|
||
"b:27017": { | ||
|
||
type: "Unknown", | ||
setName: | ||
} | ||
}, | ||
topologyType: "ReplicaSetWithPrimary", | ||
logicalSessionTimeoutMinutes: null, | ||
setName: "rs" | ||
} | ||
} | ||
] |
31 changes: 31 additions & 0 deletions
31
test/spec/server-discovery-and-monitoring/rs/discover_ghost.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"description": "Discover ghost with directConnection URI option", | ||
"uri": "mongodb://b/?directConnection=false", | ||
"phases": [ | ||
{ | ||
"responses": [ | ||
[ | ||
"b:27017", | ||
{ | ||
"ok": 1, | ||
"ismaster": false, | ||
"isreplicaset": true, | ||
"minWireVersion": 0, | ||
"maxWireVersion": 6 | ||
} | ||
] | ||
], | ||
"outcome": { | ||
"servers": { | ||
"b:27017": { | ||
"type": "RSGhost", | ||
"setName": null | ||
} | ||
}, | ||
"topologyType": "Unknown", | ||
"logicalSessionTimeoutMinutes": null, | ||
"setName": null | ||
} | ||
} | ||
] | ||
} |
35 changes: 35 additions & 0 deletions
35
test/spec/server-discovery-and-monitoring/rs/discover_ghost.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
description: "Discover ghost with directConnection URI option" | ||
|
||
uri: "mongodb://b/?directConnection=false" | ||
|
||
phases: [ | ||
|
||
{ | ||
responses: [ | ||
|
||
["b:27017", { | ||
|
||
ok: 1, | ||
ismaster: false, | ||
isreplicaset: true, | ||
minWireVersion: 0, | ||
maxWireVersion: 6 | ||
}] | ||
], | ||
|
||
outcome: { | ||
|
||
servers: { | ||
|
||
"b:27017": { | ||
|
||
type: "RSGhost", | ||
setName: | ||
} | ||
}, | ||
topologyType: "Unknown", | ||
logicalSessionTimeoutMinutes: null, | ||
setName: | ||
} | ||
} | ||
] |
Oops, something went wrong.