[SERVER-25629] Accidental "host:port/replicaSetName"-format mongos --configdb arg should be rejected asap. Created: 16/Aug/16 Updated: 25/Jan/17 Resolved: 30/Sep/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.3.11 |
| Fix Version/s: | 3.4.0-rc0 |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Akira Kurogane | Assignee: | Andy Schwerin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Sharding 2016-08-29, Sharding 2016-09-19, Sharding 2016-10-10 |
| Participants: |
| Description |
|
When I begin a mongos with a 3.3.11 test cluster I run the following mongos command.
So the default/compulsory replica set-style config server has come into play and I can't use a plain host list anymore. That is fine. It's also good that the error message points to --help, and it has the right syntax
... but I did it backwards! I.e. I wrote "--configdb <host>[,<host>]*/<replsetName>" instead of the correct "<replsetName>/ <host>[,<host>]*"), probably going from my memory regarding mongodb connection uris. When I do this the mongos starts, implicitly affirming I got the configdb argument format right.
But it hangs without finishing the fork. Meanwhile in the log file the problem is reported like thus.
The line "No primary detected for set akira-macbookpro:27019" is the first one that caught my eye, and I took it to mean something such as the replica set on my config server had not been initialized, or had lost a majority, etc. That the "<host>:<port>" string had been misinterpreted as a replicaset name didn't occur to me for quite a while. So I request some sanity-checking for the --configdb argument. |
| Comments |
| Comment by Githook User [ 30/Sep/16 ] | |||||||||||
|
Author: {u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}Message: | |||||||||||
| Comment by Akira Kurogane [ 10/Sep/16 ] | |||||||||||
|
Hi schwerin. Sorry for the delay. I made a mistake with my task management; all blame on me for that one. I have to admit the warning message rather than exit is sufficient, despite being keen for an exit originally. The warning will be extra-noticeable given nothing else is happening on the terminal at that time. Thanks for adding this usability patch. | |||||||||||
| Comment by Andy Schwerin [ 07/Sep/16 ] | |||||||||||
|
akira.kurogane, I'm uncomfortable actually quitting mongos as in your example, but we could definitely add a log message. What do you think? These are the first several lines from the log:
| |||||||||||
| Comment by Akira Kurogane [ 17/Aug/16 ] | |||||||||||
|
Here's an idea in pseudo-code.
Additional (not alternate) idea: the presence of ":" and "," chars in the replicaSetName string leads to a warning printed on stderr of the launching shell (only before the fork, obviously). | |||||||||||
| Comment by Andy Schwerin [ 16/Aug/16 ] | |||||||||||
|
Unfortunately, "host1:20000,host2:30000" is a legal (though strange) replica set name, and "cfgrs" is a legal host name, so I'm not sure how we could do that sanity checking, akira.kurogane. As such, I think this might have to be closed "Works as Designed". It is disappointing. Do you have any ideas? |