[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: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Changes: | Needed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Quarter: | FY22Q3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Compliance: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
However, there's currently no way for me to use this because when I provide a connection url like
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) |
| 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. |
| 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) |
| 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 ] |
| 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 |