[DRIVERS-521] Allow custom service names with srvServiceName URI option Created: 05/Jul/18  Updated: 18/Oct/21

Status: Implementing
Project: Drivers
Component/s: Initial DNS Seedlist Discovery
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Eric Herbrandson Assignee: Benji Rewis (Inactive)
Resolution: Unresolved Votes: 2
Labels: devexp-product
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by GODRIVER-777 Does the Go Driver cache DNS and if s... Closed
Issue split
split to CSHARP-3745 Allow custom service names with srvSe... Backlog
split to CXX-2312 Allow custom service names with srvSe... Backlog
split to RUST-911 Allow custom service names with srvSe... Backlog
split to CDRIVER-4086 Allow custom service names with srvSe... Closed
split to GODRIVER-2086 Allow custom service names with srvSe... Closed
split to JAVA-4239 Allow custom service names with srvSe... Closed
split to MOTOR-778 Allow custom service names with srvSe... Closed
split to NODE-3450 Allow custom service names with srvSe... Closed
split to PHPC-1900 Allow custom service names with srvSe... Closed
split to PYTHON-2823 Allow custom service names with srvSe... Closed
split to RUBY-2737 Allow custom service names with srvSe... Closed
Related
related to DRIVERS-1946 Add prose test for SRV polling with a... Implementing
Driver Changes: Needed
Quarter: FY22Q3
Case:
Driver Compliance:
Key Status/Resolution FixVersion
CDRIVER-4086 Fixed 1.21.0
CSHARP-3745 Backlog
CXX-2312 Backlog
GODRIVER-2086 Done 1.8.0
JAVA-4239 Fixed 4.5.0
NODE-3450 Fixed 4.2.0
PHPC-1900 Fixed 1.13.0
PYTHON-2823 Fixed 4.0
RUBY-2737 Fixed 2.18.0
RUST-911 Backlog
SWIFT-1263 Fixed 1.3.0
MOTOR-778 Duplicate

 Description   

We are using DCOS (marathon/mesos) to manage our services. DCOS generates SRV records for our mongos instances under a record that looks like

_mongos-mongodb._tcp.marathon.mesos

However, there's currently no way for me to use this because when I provide a connection url like

mongodb+srv://_mongos-mongodb._tcp.marathon.mesos

the drivers prepend "mongodb._tcp" to the provided url. It's not clear why it's required that the host _must start with "_mongodb._tcp". Why not let the user specify the actual DNS entry to query?

I believe the same issue will exist for multiple orchestration frameworks such as Consul/Nomad and Kubernetes.

Drivers should sync their URI options and seedlist discovery spec tests to this commit. Drivers should accept a new URI option srvServiceName that overrides the default "mongodb" service name for SRV lookup in both discovery and polling.



 Comments   
Comment by Githook User [ 27/Sep/21 ]

Author:

{'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}

Message: DRIVERS-521 Use test22 for custom service name endpoint (#1073)
Branch: master
https://github.com/mongodb/specifications/commit/0fc8e57f601b2ee7af4417b4a25c42eed6a38730

Comment by Benji Rewis (Inactive) [ 24/Sep/21 ]

Opened a small PR to use _customname._tcp.test22.test.build.10gen.cc as the SRV endpoint for the new spec tests. _customname._tcp.test1.test.build.10gen.cc had exactly the same value on SRV lookup as _mongodb._tcp.test1.test.build.10gen.cc, so the spec tests were not really assessing whether a driver was appending a custom service name correctly. _mongodb._tcp.test22.test.build.10gen.cc does not exist, so drivers will now error if customname is not prepended.

https://github.com/mongodb/specifications/pull/1073

Comment by Githook User [ 15/Sep/21 ]

Author:

{'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}

Message: DRIVERS-521 Allow custom SRV service names with srvServiceName URI option (#1067)
Branch: master
https://github.com/mongodb/specifications/commit/c48d7f416e51dce8fd4c8d05bdb05790508ca3bb

Comment by Benji Rewis (Inactive) [ 10/Sep/21 ]

Alternate implementation with a new srvServiceName URI option: https://github.com/mongodb/specifications/pull/1067

Comment by Benji Rewis (Inactive) [ 03/Sep/21 ]

https://github.com/mongodb/specifications/pull/1063

Comment by Rachelle Palmer [ 14/Apr/20 ]

This ticket has been open for a few years now and it remains true that it's an interesting idea however at this point and for the forseeable future MongoDB drivers have a significant amount of work that is both more urgent and more critical to customers, therefore we are resolving this ticket as Won't Fix. If you believe this feature should be added in the long-term, please upvote this feature request here.

Thank you!

Comment by Eric Herbrandson [ 08/Jul/18 ]

Thanks @David Golden. That is a much better title. It seems that DCOS, Consul and Kubernetes do use/support RFC 2782 SRV names. However, I think mandating the service name of "mongodb" is unfortunate and unnecessarily restrictive. For example, in DCOS we have a "group" named "mongodb" that has multiple services inside of it (i.e. shard nodes, config nodes, and mongos nodes). DCOS then generates the service name for the SRV record by concatenating the group name and the service name. This makes it very difficult for use to get a properly named SRV record for mongo.

FWIW, I really appreciate trying to lighten the burden on developers by using simple/short URIs. However, in this case I think this is actually more confusing then helpful. My first instinct was to use the URI "mongodb+srv://_mongos-mongodb._tcp.marathon.mesos". I was definitely surprised when that wasn't correct. Add to that the additional flexibility of being able to use service names other then "mongodb" and I think there's a strong case for this feature

Comment by David Golden [ 06/Jul/18 ]

Hi, Eric. The convention is derived directly from RFC 2782. Given a service name, a protocol, and a domain, a client is supposed to do a DNS lookup on _service._protocol.domain. In this case the mongodb+srv URI scheme mandates the service name "mongodb" and the protocol "tcp". One of the design goals was to simplify and shorten URIs that customers need to configure their applications, which is why the service and protocol are derived from the scheme.

You seem to be asking for support for custom service names, so I've updated the title to reflect your request.

Comment by Eric Herbrandson [ 05/Jul/18 ]

Sorry, I meant to create this as a feature request, not a bug

Generated at Thu Feb 08 08:21:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.