Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions source/initial-dns-seedlist-discovery/tests/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ replica set name ``repl0``.

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

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

Expand Down Expand Up @@ -56,7 +57,9 @@ these tests::
_mongodb._tcp.test19.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc.
_mongodb._tcp.test20.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc.
_mongodb._tcp.test21.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc.
_customname._tcp.test22.test.build.10gen.cc 86400 IN SRV 27017 localhost.test.build.10gen.cc
_customname._tcp.test22.test.build.10gen.cc 86400 IN SRV 27017 localhost.test.build.10gen.cc.
_mongodb._tcp.test23.test.build.10gen.cc. 86400 IN SRV 8000 localhost.test.build.10gen.cc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to clarify my understanding. From offline conversation, it sounds like load balancer tests make use of the test1, test3, test4 and test20 records. The test1 and test4 records seem to be used to test that drivers fail during validation, so updating the port from 27017 (the mongos) to 8000 (the actual LB) is not necessary. The test3 record is used to test a successful connection, so the port should be updated, but that record is also used in the load-balanced/srvMaxHosts-zero test which expects to find 27017. So, we need a new test23 record that is identical to test3 but points to port 8000. Let me know if that all sounds right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct (the test3 record is currently used in various replica-set tests, but you're right that it's required to stay the same for other tests).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, update: This change is now strictly additive. There are two new records, test23 (replaces test3) and test24 (replaces test20).

_mongodb._tcp.test24.test.build.10gen.cc. 86400 IN SRV 8000 localhost.test.build.10gen.cc.

Record TTL Class Text
test5.test.build.10gen.cc. 86400 IN TXT "replicaSet=repl0&authSource=thisDB"
Expand All @@ -68,12 +71,18 @@ these tests::
test11.test.build.10gen.cc. 86400 IN TXT "replicaS" "et=rep" "l0"
test20.test.build.10gen.cc. 86400 IN TXT "loadBalanced=true"
test21.test.build.10gen.cc. 86400 IN TXT "loadBalanced=false"

Note that ``test4`` is omitted deliberately to test what happens with no SRV
record. ``test9`` is missing because it was deleted during the development of
the tests. The missing ``test.`` sub-domain in the SRV record target for
``test12`` is deliberate. ``test22`` is used to test a custom service name
(``customname``).
test24.test.build.10gen.cc. 86400 IN TXT "loadBalanced=true"

Notes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up.


- ``test4`` is omitted deliberately to test what happens with no SRV record.
- ``test9`` is missing because it was deleted during the development of the
tests.
- The missing ``test.`` sub-domain in the SRV record target for ``test12`` is
deliberate.
- ``test22`` is used to test a custom service name (``customname``).
- ``test23`` and ``test24`` point to port 8000 (HAProxy) and are used for
load-balanced tests.

In our tests we have used ``localhost.test.build.10gen.cc`` as the domain, and
then configured ``localhost.test.build.10gen.cc`` to resolve to 127.0.0.1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"uri": "mongodb+srv://test20.test.build.10gen.cc/?directConnection=false",
"uri": "mongodb+srv://test24.test.build.10gen.cc/?directConnection=false",
"seeds": [
"localhost.test.build.10gen.cc:27017"
"localhost.test.build.10gen.cc:8000"
],
"hosts": [
"localhost.test.build.10gen.cc:27017"
"localhost.test.build.10gen.cc:8000"
],
"options": {
"loadBalanced": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# The TXT record for test20.test.build.10gen.cc contains loadBalanced=true.
# The TXT record for test24.test.build.10gen.cc contains loadBalanced=true.
# DRIVERS-1721 introduced this test as passing.
uri: "mongodb+srv://test20.test.build.10gen.cc/?directConnection=false"
uri: "mongodb+srv://test24.test.build.10gen.cc/?directConnection=false"
seeds:
- localhost.test.build.10gen.cc:27017
- localhost.test.build.10gen.cc:8000
hosts:
# In LB mode, the driver does not do server discovery, so the hostname does
# not get resolved to localhost:27017.
- localhost.test.build.10gen.cc:27017
# not get resolved to localhost:8000.
- localhost.test.build.10gen.cc:8000
options:
loadBalanced: true
ssl: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"uri": "mongodb+srv://test20.test.build.10gen.cc/?replicaSet=replset",
"uri": "mongodb+srv://test24.test.build.10gen.cc/?replicaSet=replset",
"seeds": [],
"hosts": [],
"error": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The TXT record for test20.test.build.10gen.cc contains loadBalanced=true.
uri: "mongodb+srv://test20.test.build.10gen.cc/?replicaSet=replset"
# The TXT record for test24.test.build.10gen.cc contains loadBalanced=true.
uri: "mongodb+srv://test24.test.build.10gen.cc/?replicaSet=replset"
seeds: []
hosts: []
error: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"uri": "mongodb+srv://test20.test.build.10gen.cc/",
"uri": "mongodb+srv://test24.test.build.10gen.cc/",
"seeds": [
"localhost.test.build.10gen.cc:27017"
"localhost.test.build.10gen.cc:8000"
],
"hosts": [
"localhost.test.build.10gen.cc:27017"
"localhost.test.build.10gen.cc:8000"
],
"options": {
"loadBalanced": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
uri: "mongodb+srv://test20.test.build.10gen.cc/"
uri: "mongodb+srv://test24.test.build.10gen.cc/"
seeds:
- localhost.test.build.10gen.cc:27017
- localhost.test.build.10gen.cc:8000
hosts:
# In LB mode, the driver does not do server discovery, so the hostname does
# not get resolved to localhost:27017.
- localhost.test.build.10gen.cc:27017
# not get resolved to localhost:8000.
- localhost.test.build.10gen.cc:8000
options:
loadBalanced: true
ssl: true
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"uri": "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=1",
"uri": "mongodb+srv://test24.test.build.10gen.cc/?srvMaxHosts=1",
"seeds": [],
"hosts": [],
"error": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
uri: "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=1"
uri: "mongodb+srv://test24.test.build.10gen.cc/?srvMaxHosts=1"
seeds: []
hosts: []
error: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"uri": "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=0",
"uri": "mongodb+srv://test24.test.build.10gen.cc/?srvMaxHosts=0",
"seeds": [
"localhost.test.build.10gen.cc:27017"
"localhost.test.build.10gen.cc:8000"
],
"hosts": [
"localhost.test.build.10gen.cc:27017"
"localhost.test.build.10gen.cc:8000"
],
"options": {
"loadBalanced": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# loadBalanced=true (TXT) is permitted because srvMaxHosts is non-positive
uri: "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=0"
uri: "mongodb+srv://test24.test.build.10gen.cc/?srvMaxHosts=0"
seeds:
- localhost.test.build.10gen.cc:27017
- localhost.test.build.10gen.cc:8000
hosts:
- localhost.test.build.10gen.cc:27017
- localhost.test.build.10gen.cc:8000
options:
loadBalanced: true
srvMaxHosts: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"uri": "mongodb+srv://test3.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0",
"uri": "mongodb+srv://test23.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0",
"seeds": [
"localhost.test.build.10gen.cc:27017"
"localhost.test.build.10gen.cc:8000"
],
"hosts": [
"localhost.test.build.10gen.cc:27017"
"localhost.test.build.10gen.cc:8000"
],
"options": {
"loadBalanced": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# loadBalanced=true is permitted because srvMaxHosts is non-positive
uri: "mongodb+srv://test3.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0"
uri: "mongodb+srv://test23.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0"
seeds:
- localhost.test.build.10gen.cc:27017
- localhost.test.build.10gen.cc:8000
hosts:
- localhost.test.build.10gen.cc:27017
- localhost.test.build.10gen.cc:8000
options:
loadBalanced: true
srvMaxHosts: 0
Expand Down