[JAVA-2927] Support polling SRV records for mongos discovery Created: 15/Aug/18  Updated: 28/Oct/23  Resolved: 09/Jan/19

Status: Closed
Project: Java Driver
Component/s: Cluster Management
Affects Version/s: None
Fix Version/s: 3.10.0

Type: New Feature Priority: Major - P3
Reporter: xuran Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on JAVA-3084 Move initial discovery of SRV record ... Closed
is depended on by DRIVERS-561 Support polling SRV records for mongo... Closed
Epic Link: mongos discovery via SRV
Backwards Compatibility: Minor Change

 Description   

We provide mongodb sharded cluster as  a cloud service.We suggest tenant use "mongodb+srv://" as the connection string prefix.

We insert a SRV record into DNS when tenant scale out a mongos node.We want driver auto discovery this node and then apply new connection to it.

Actually this new mongos node does not appear in the topology before the app with driver restart.

I know the "DNS Seed List" feature is aimed to decrease app's maintenance load.It would be better if driver could monitor the change of dns seed list and reset the topology in time.



 Comments   
Comment by Jeffrey Yemin [ 24/Oct/19 ]

wangzicong@bytedance.com looks like we don't have any test cases that don't use the default port. If you have tried it and it's not working, please open a new JAVA issue.

Thanks,
Jeff

Comment by Atwood Wang [ 24/Oct/19 ]

Hi Jeffrey,

 

I have a quick question regarding this change. It seems to me that here the java driver will only resolve the hostname from the SRV record and always assume the mongos server on the host is running under the default port 27017. 

 

Is this by design or am I missing something?

 

Thanks a lot,

Atwood

Comment by Githook User [ 14/Jan/19 ]

Author:

{'username': 'jyemin', 'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin'}

Message: Move StableMultiServerCluster to MultiServerCluster

Did this in two steps so that we wouldn't lose the history
on the former MultiServerCluster class (which is now
called AbstractMultiServerCluster)

JAVA-2927
Branch: 3.10.x
https://github.com/mongodb/mongo-java-driver/commit/53bf5b550f1853c939e30ddbcf380e1f6d8026be

Comment by Githook User [ 14/Jan/19 ]

Author:

{'username': 'jyemin', 'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin'}

Message: Poll for DNS SRV record updates

JAVA-2927
Branch: 3.10.x
https://github.com/mongodb/mongo-java-driver/commit/3b215b5bc39d5ddd3e9b6fc8e494b2fa41d82c9d

Comment by Githook User [ 09/Jan/19 ]

Author:

{'username': 'jyemin', 'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin'}

Message: Move StableMultiServerCluster to MultiServerCluster

Did this in two steps so that we wouldn't lose the history
on the former MultiServerCluster class (which is now
called AbstractMultiServerCluster)

JAVA-2927
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/4f02a9757b7995caff63ba4f26c2121c50d90036

Comment by Githook User [ 09/Jan/19 ]

Author:

{'username': 'jyemin', 'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin'}

Message: Poll for DNS SRV record updates

JAVA-2927
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/fc9ab1ac1e43bdbb813dd25fdd32dff345aac2d2

Comment by Ross Lawley [ 15/Aug/18 ]

Hi benwuhua,

Thank you for the ticket. As you know the current DNS support is only for the initial seedlist discovery and any changes to DNS would require a new MongoClient.

Supporting DNS monitoring would require some wider architectural changes. The implications of those architectural changes need to be considered across all drivers. As such I have created DRIVERS-561 to track the conversation about bringing DNS monitoring to all drivers.

Kind Regards,

Ross

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