ExportXMLWordPrintableJSON

    • Needed
    • Hide

      Summary of necessary driver changes

      • No driver code changes are required. The spec already allows returned hostnames to be identical to the SRV hostname when the SRV hostname has three or more dot-separated parts; the new tests only verify this. Drivers that already implement the "additional domain level" rule for fewer-than-three parts need no change. For PyMongo, the underlying validation fix already landed in PYTHON-5288 (PyMongo 4.12.1, commits 86e221e and backport de0e233), so PyMongo passes the new tests as-is; the sync commits below only add the new spec test files.

      Commits for syncing spec/prose tests
      (and/or refer to an existing language POC if needed)

      • Spec tests: mongodb/specifications PR #1787, commit 268a28e adds initial-dns-seedlist-discovery/tests/replica-set/identical-hostnames-valid-three-parts.{yml,json} and identical-hostnames-valid-four-parts.{yml,json} (plus README SRV records and changelog entry).
      • PyMongo sync (branch DRIVERS-3162, not yet merged to master):
        • b7d4107a Add identical-hostnames-valid-three-parts.json and update test_dns.py
        • 710e0b3d Add identical-hostnames-valid-four-parts.json
      • Existing language POC: Go Driver PR #2685 (per Preston's 2026-11-02 comment, "everything looks good").

      Context for other referenced/linked tickets

      • PYTHON-5288 (Closed): the user-reported bug that motivated this ticket. PyMongo 4.12.0 incorrectly rejected mongodb+srv connection strings when an SRV record resolved to a hostname identical to the SRV hostname, even with three or more dot-separated parts (ConfigurationError: Invalid SRV host: return address is identical to SRV hostname). Fixed in 4.12.1.
      • This ticket is test-only ("Is this ticket only for tests? Yes"); no downstream team depends on it.
      Show
      Summary of necessary driver changes No driver code changes are required. The spec already allows returned hostnames to be identical to the SRV hostname when the SRV hostname has three or more dot-separated parts; the new tests only verify this. Drivers that already implement the "additional domain level" rule for fewer-than-three parts need no change. For PyMongo, the underlying validation fix already landed in PYTHON-5288 (PyMongo 4.12.1, commits 86e221e and backport de0e233), so PyMongo passes the new tests as-is; the sync commits below only add the new spec test files. Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed) Spec tests: mongodb/specifications PR #1787 , commit 268a28e adds initial-dns-seedlist-discovery/tests/replica-set/identical-hostnames-valid-three-parts.{yml,json} and identical-hostnames-valid-four-parts.{yml,json} (plus README SRV records and changelog entry). PyMongo sync (branch DRIVERS-3162 , not yet merged to master): b7d4107a Add identical-hostnames-valid-three-parts.json and update test_dns.py 710e0b3d Add identical-hostnames-valid-four-parts.json Existing language POC: Go Driver PR #2685 (per Preston's 2026-11-02 comment, "everything looks good"). Context for other referenced/linked tickets PYTHON-5288 (Closed): the user-reported bug that motivated this ticket. PyMongo 4.12.0 incorrectly rejected mongodb+srv connection strings when an SRV record resolved to a hostname identical to the SRV hostname, even with three or more dot-separated parts (ConfigurationError: Invalid SRV host: return address is identical to SRV hostname). Fixed in 4.12.1. This ticket is test-only ("Is this ticket only for tests? Yes"); no downstream team depends on it.
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-5988 In Progress
      CXX-3271 Backlog
      CSHARP-5570 In Code Review
      GODRIVER-3539 Duplicate
      JAVA-5850 Needs Triage
      NODE-6910 Investigating
      MOTOR-1456 Duplicate
      PYTHON-5327 Duplicate
      PHPLIB-1668 Backlog
      RUBY-3653 Needs Triage
      RUST-2200 Ready for Work
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } #scriptField td.willNotDo { background-color: #FF0000; /* Red color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-5988 In Progress CXX-3271 Backlog CSHARP-5570 In Code Review GODRIVER-3539 Duplicate JAVA-5850 Needs Triage NODE-6910 Investigating MOTOR-1456 Duplicate PYTHON-5327 Duplicate PHPLIB-1668 Backlog RUBY-3653 Needs Triage RUST-2200 Ready for Work

      Summary

      According to the MongoDB Initial DNS Seedlist Discovery specification, the requirement that returned hostnames contain an additional domain level applies only when the SRV hostname has fewer than three dot-separated parts. When the SRV hostname has three or more dot-separated parts, it is valid for the returned hostnames to be identical.

      We should add tests to ensure that drivers don't throw validation errors in the case described above.

      Motivation

      Who is the affected end user?

      Who are the stakeholders?

      How does this affect the end user?

      Are they blocked? Are they annoyed? Are they confused?

      How likely is it that this problem or use case will occur?

      Main path? Edge case?

      If the problem does occur, what are the consequences and how severe are they?

      In PYTHON-5288, when using a mongodb+srv connection string, the driver throws an error if the hostname used for SRV resolution is identical to one of the resolved hostnames, even when the hostname contains three or more dot-separated parts.

      This behavior causes valid configurations to fail and appears to contradict the intended logic in the specification.

      Is this issue urgent?

      Tests should be implemented soon so that other drivers can catch a potential problem before the users do.

      Is this ticket required by a downstream team?

      No

      Is this ticket only for tests?

      Yes

      Acceptance Criteria

      • Add new tests to confirm that when the SRV hostname has three or more dot-separated parts, it is valid for the returned hostnames to be identical and an error is not thrown.
        • mongodb+srv://a.b.com is valid and SRV returns a.b.com
        • mongodb+srv://a.b.c.com is valid and SRV returns a.b.c.com

            Assignee:
            Alex Clark
            Reporter:
            Alex Clark
            Jib Adegunloye Jib Adegunloye
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: