[JAVA-3573] ClusterConnectionMode must get defaulted to MULTIPLE when setting srvHost in builder Created: 01/Jan/20 Updated: 28/Oct/23 Resolved: 08/Jan/20 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Builders |
| Affects Version/s: | 3.11.0 |
| Fix Version/s: | 3.12.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Raghu c | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
If srvHost is set using the ClusterSettings builder then ClusterConnectionMode must also be set to Multiple. If srvHost is set then hosts will be populated to the default host and default port and ClusterConnectionMode gets defaulted to Single. When creating a connection to cluster if ClusterConnectionMode is not set to Multiple then it's assumed as a SingleServerCluster and the srvHost value is ignored.
When using a ConnectionString with the mongodb+srv this is already being done.
|
| Comments |
| Comment by Githook User [ 08/Jan/20 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}Message: Add note about TXT records to Javadoc of ClusterSettings.Builder#srvHost
|
| Comment by Githook User [ 08/Jan/20 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}Message: Set connection mode to MULTIPLE when srvHost is specified in ClusterSettings Also:
|
| Comment by Githook User [ 08/Jan/20 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}Message: Add note about TXT records to Javadoc of ClusterSettings.Builder#srvHost
|
| Comment by Githook User [ 08/Jan/20 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}Message: Set connection mode to MULTIPLE when srvHost is specified in ClusterSettings Also:
|
| Comment by Jeffrey Yemin [ 07/Jan/20 ] |
|
Decided that the TXT record application is not really possible to address properly, so instead will add a Javadoc comment noting the difference in behavior when using ClusterSettings.Builder#srvHost directly. |
| Comment by Jeffrey Yemin [ 07/Jan/20 ] |
|
Another related problem: when using a connection string, the driver applies the contents of any TXT record found for the SRV host. When using MongoClientSettings, that step is skipped. |