Skip to content

Commit 5d1b42a

Browse files
authored
DRIVERS-2224 Fix load-balanced DNS seedlist discovery tests for new dedicated lb port. (#1148)
1 parent ad1ee9b commit 5d1b42a

13 files changed

+50
-41
lines changed

source/initial-dns-seedlist-discovery/tests/README.rst

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ replica set name ``repl0``.
1414

1515
The tests in the ``load-balanced`` directory MUST be executed against a
1616
load-balanced sharded cluster with the mongos servers running on localhost ports
17-
27017 and 27018 (corresponding to the script in `drivers-evergreen-tools`_). The
18-
load balancers, shard servers, and config servers may run on any open ports.
17+
27017 and 27018 and ``--loadBalancerPort`` 27050 and 27051, respectively
18+
(corresponding to the script in `drivers-evergreen-tools`_). The load balancers,
19+
shard servers, and config servers may run on any open ports.
1920

2021
.. _`drivers-evergreen-tools`: https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/run-load-balancer.sh
2122

@@ -56,7 +57,9 @@ these tests::
5657
_mongodb._tcp.test19.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc.
5758
_mongodb._tcp.test20.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc.
5859
_mongodb._tcp.test21.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc.
59-
_customname._tcp.test22.test.build.10gen.cc 86400 IN SRV 27017 localhost.test.build.10gen.cc
60+
_customname._tcp.test22.test.build.10gen.cc 86400 IN SRV 27017 localhost.test.build.10gen.cc.
61+
_mongodb._tcp.test23.test.build.10gen.cc. 86400 IN SRV 8000 localhost.test.build.10gen.cc.
62+
_mongodb._tcp.test24.test.build.10gen.cc. 86400 IN SRV 8000 localhost.test.build.10gen.cc.
6063

6164
Record TTL Class Text
6265
test5.test.build.10gen.cc. 86400 IN TXT "replicaSet=repl0&authSource=thisDB"
@@ -68,12 +71,18 @@ these tests::
6871
test11.test.build.10gen.cc. 86400 IN TXT "replicaS" "et=rep" "l0"
6972
test20.test.build.10gen.cc. 86400 IN TXT "loadBalanced=true"
7073
test21.test.build.10gen.cc. 86400 IN TXT "loadBalanced=false"
71-
72-
Note that ``test4`` is omitted deliberately to test what happens with no SRV
73-
record. ``test9`` is missing because it was deleted during the development of
74-
the tests. The missing ``test.`` sub-domain in the SRV record target for
75-
``test12`` is deliberate. ``test22`` is used to test a custom service name
76-
(``customname``).
74+
test24.test.build.10gen.cc. 86400 IN TXT "loadBalanced=true"
75+
76+
Notes:
77+
78+
- ``test4`` is omitted deliberately to test what happens with no SRV record.
79+
- ``test9`` is missing because it was deleted during the development of the
80+
tests.
81+
- The missing ``test.`` sub-domain in the SRV record target for ``test12`` is
82+
deliberate.
83+
- ``test22`` is used to test a custom service name (``customname``).
84+
- ``test23`` and ``test24`` point to port 8000 (HAProxy) and are used for
85+
load-balanced tests.
7786

7887
In our tests we have used ``localhost.test.build.10gen.cc`` as the domain, and
7988
then configured ``localhost.test.build.10gen.cc`` to resolve to 127.0.0.1.

source/initial-dns-seedlist-discovery/tests/load-balanced/loadBalanced-directConnection.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"uri": "mongodb+srv://test20.test.build.10gen.cc/?directConnection=false",
2+
"uri": "mongodb+srv://test24.test.build.10gen.cc/?directConnection=false",
33
"seeds": [
4-
"localhost.test.build.10gen.cc:27017"
4+
"localhost.test.build.10gen.cc:8000"
55
],
66
"hosts": [
7-
"localhost.test.build.10gen.cc:27017"
7+
"localhost.test.build.10gen.cc:8000"
88
],
99
"options": {
1010
"loadBalanced": true,

source/initial-dns-seedlist-discovery/tests/load-balanced/loadBalanced-directConnection.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# The TXT record for test20.test.build.10gen.cc contains loadBalanced=true.
1+
# The TXT record for test24.test.build.10gen.cc contains loadBalanced=true.
22
# DRIVERS-1721 introduced this test as passing.
3-
uri: "mongodb+srv://test20.test.build.10gen.cc/?directConnection=false"
3+
uri: "mongodb+srv://test24.test.build.10gen.cc/?directConnection=false"
44
seeds:
5-
- localhost.test.build.10gen.cc:27017
5+
- localhost.test.build.10gen.cc:8000
66
hosts:
77
# In LB mode, the driver does not do server discovery, so the hostname does
8-
# not get resolved to localhost:27017.
9-
- localhost.test.build.10gen.cc:27017
8+
# not get resolved to localhost:8000.
9+
- localhost.test.build.10gen.cc:8000
1010
options:
1111
loadBalanced: true
1212
ssl: true

source/initial-dns-seedlist-discovery/tests/load-balanced/loadBalanced-replicaSet-errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"uri": "mongodb+srv://test20.test.build.10gen.cc/?replicaSet=replset",
2+
"uri": "mongodb+srv://test24.test.build.10gen.cc/?replicaSet=replset",
33
"seeds": [],
44
"hosts": [],
55
"error": true,

source/initial-dns-seedlist-discovery/tests/load-balanced/loadBalanced-replicaSet-errors.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# The TXT record for test20.test.build.10gen.cc contains loadBalanced=true.
2-
uri: "mongodb+srv://test20.test.build.10gen.cc/?replicaSet=replset"
1+
# The TXT record for test24.test.build.10gen.cc contains loadBalanced=true.
2+
uri: "mongodb+srv://test24.test.build.10gen.cc/?replicaSet=replset"
33
seeds: []
44
hosts: []
55
error: true

source/initial-dns-seedlist-discovery/tests/load-balanced/loadBalanced-true-txt.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"uri": "mongodb+srv://test20.test.build.10gen.cc/",
2+
"uri": "mongodb+srv://test24.test.build.10gen.cc/",
33
"seeds": [
4-
"localhost.test.build.10gen.cc:27017"
4+
"localhost.test.build.10gen.cc:8000"
55
],
66
"hosts": [
7-
"localhost.test.build.10gen.cc:27017"
7+
"localhost.test.build.10gen.cc:8000"
88
],
99
"options": {
1010
"loadBalanced": true,
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
uri: "mongodb+srv://test20.test.build.10gen.cc/"
1+
uri: "mongodb+srv://test24.test.build.10gen.cc/"
22
seeds:
3-
- localhost.test.build.10gen.cc:27017
3+
- localhost.test.build.10gen.cc:8000
44
hosts:
55
# In LB mode, the driver does not do server discovery, so the hostname does
6-
# not get resolved to localhost:27017.
7-
- localhost.test.build.10gen.cc:27017
6+
# not get resolved to localhost:8000.
7+
- localhost.test.build.10gen.cc:8000
88
options:
99
loadBalanced: true
1010
ssl: true

source/initial-dns-seedlist-discovery/tests/load-balanced/srvMaxHosts-conflicts_with_loadBalanced-true-txt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"uri": "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=1",
2+
"uri": "mongodb+srv://test24.test.build.10gen.cc/?srvMaxHosts=1",
33
"seeds": [],
44
"hosts": [],
55
"error": true,

source/initial-dns-seedlist-discovery/tests/load-balanced/srvMaxHosts-conflicts_with_loadBalanced-true-txt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
uri: "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=1"
1+
uri: "mongodb+srv://test24.test.build.10gen.cc/?srvMaxHosts=1"
22
seeds: []
33
hosts: []
44
error: true

source/initial-dns-seedlist-discovery/tests/load-balanced/srvMaxHosts-zero-txt.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"uri": "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=0",
2+
"uri": "mongodb+srv://test24.test.build.10gen.cc/?srvMaxHosts=0",
33
"seeds": [
4-
"localhost.test.build.10gen.cc:27017"
4+
"localhost.test.build.10gen.cc:8000"
55
],
66
"hosts": [
7-
"localhost.test.build.10gen.cc:27017"
7+
"localhost.test.build.10gen.cc:8000"
88
],
99
"options": {
1010
"loadBalanced": true,

source/initial-dns-seedlist-discovery/tests/load-balanced/srvMaxHosts-zero-txt.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# loadBalanced=true (TXT) is permitted because srvMaxHosts is non-positive
2-
uri: "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=0"
2+
uri: "mongodb+srv://test24.test.build.10gen.cc/?srvMaxHosts=0"
33
seeds:
4-
- localhost.test.build.10gen.cc:27017
4+
- localhost.test.build.10gen.cc:8000
55
hosts:
6-
- localhost.test.build.10gen.cc:27017
6+
- localhost.test.build.10gen.cc:8000
77
options:
88
loadBalanced: true
99
srvMaxHosts: 0

source/initial-dns-seedlist-discovery/tests/load-balanced/srvMaxHosts-zero.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"uri": "mongodb+srv://test3.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0",
2+
"uri": "mongodb+srv://test23.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0",
33
"seeds": [
4-
"localhost.test.build.10gen.cc:27017"
4+
"localhost.test.build.10gen.cc:8000"
55
],
66
"hosts": [
7-
"localhost.test.build.10gen.cc:27017"
7+
"localhost.test.build.10gen.cc:8000"
88
],
99
"options": {
1010
"loadBalanced": true,

source/initial-dns-seedlist-discovery/tests/load-balanced/srvMaxHosts-zero.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# loadBalanced=true is permitted because srvMaxHosts is non-positive
2-
uri: "mongodb+srv://test3.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0"
2+
uri: "mongodb+srv://test23.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0"
33
seeds:
4-
- localhost.test.build.10gen.cc:27017
4+
- localhost.test.build.10gen.cc:8000
55
hosts:
6-
- localhost.test.build.10gen.cc:27017
6+
- localhost.test.build.10gen.cc:8000
77
options:
88
loadBalanced: true
99
srvMaxHosts: 0

0 commit comments

Comments
 (0)