-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 1.6.2
-
Component/s: Replication
-
None
-
Minor Change
-
ALL
When setting up a replica set it appears only portion of the hostname up to the first period is checked for when doing the isSelf check. This results in a message about bad configs when attempting to use hosts of the following form:
mongo1.primary.domain.com
mongo1.backup.domain.com
I believe it is due to this portion of util/hostandport.h
86 /** returns true if strings seem to be the same hostname.
87 "nyc1" and "nyc1.acme.com" are treated as the same.
88 in fact "nyc1.foo.com" and "nyc1.acme.com" are treated the same -
89 we oly look up to the first period.
90 */
91 inline bool sameHostname(const string& a, const string& b)
which appears to be called from the isSelf method in util/message.cpp which appears to be used in checkMembersUpForConfigChange of db/repl/rs_initiate.cpp
I was unable to find information indicating that this was an intentional restriction on hostnames.