[SERVER-28560] Support specifying multiple mongos processes in the shell URI connection string Created: 20/Mar/17 Updated: 08/Jan/24 Resolved: 29/Jul/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 3.4.14 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Enrique Garnelo Prediger | Assignee: | Backlog - Service Architecture |
| Resolution: | Gone away | Votes: | 4 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Service Arch
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||
| Description |
|
The mongo shell should allow multiple mongos processes to be specified in a connection string URI, with the expectation that this would connect to the first available mongos process. Drivers support this behaviour for the standard connection string URI format, but the mongo shell returns an unhelpful error message in MongoDB 3.4:
The replicaSet option cannot be used with a mongos connection. For now the only workaround I have is with a shell script and leveraging the 'echo $?' result to continue iterating through the list of available host:port of mongos processes. |
| Comments |
| Comment by Mira Carey [ 29/Jul/19 ] | |||
I could be wrong, but I thought it was actually that we only send network requests to the first host we manage to connect to (and affix to it after that). Closing this out as gone away, as the asked for functionality is present in 3.6 and later shells | |||
| Comment by Max Hirschhorn [ 30/Mar/18 ] | |||
|
stennie, my understanding from having talked to mira.carey@mongodb.com about this in-person before is that this limitation was incidentally removed by the changes from 400b86d as part of | |||
| Comment by Stennie Steneker (Inactive) [ 28/Mar/18 ] | |||
|
This issue appears to be fixed in the 3.6 mongo shell. Tested using 3.6.3 and several likely variations:
Possibly related to improvements from sara.golemon ( The 3.4.14 shell fails to connect and exits with an unhelpful error message:
The 3.2.19 shell doesn't exit, but appears to only be attempting to connect to the first host in the connection string. |