[CDRIVER-4086] Allow custom service names with srvServiceName URI option Created: 15/Jul/21  Updated: 28/Oct/23  Resolved: 20/Dec/21

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.21.0

Type: New Feature Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Ezra Chung
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-1900 Allow custom service names with srvSe... Closed
Issue split
split from DRIVERS-521 Allow custom service names with srvSe... Implementing
Quarter: FY22Q3
Upstream Changes Summary:

DRIVERS Ticket 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.


 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 [ 20/Dec/21 ]

Author:

{'name': 'Ezra Chung', 'email': '88335979+eramongodb@users.noreply.github.com', 'username': 'eramongodb'}

Message: CDRIVER-4086 Implement srvServiceName for initial DNS seedlist and SRV polling (#916)

  • Update MONGOC_URI_SRVMAXHOSTS to lowercase for consistency
  • Add support for parsing URI option srvServiceName
  • Update spec tests for srvServiceName
  • Add documentation for mongoc_uri_get_srv_service_name()
  • Add support for srvServiceName in DNS seedlist discovery
  • Add mongoc_uri_get_srv_hostname()
  • Replace and rename SRV "service" with "hostname"
    Branch: master
    https://github.com/mongodb/mongo-c-driver/commit/ab65efbfe5442289d6f9b4180a79cb76f6979bf6
Generated at Wed Feb 07 21:19:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.