|
The hostname that a mongod/mongos is running on (as returned by the gethostname() syscall) is cached in _hostNameCached. This means that code which calls getHostNameCached() or prettyHostName() never notices if the system's hostname changes (notably, the "host" field in serverStatus and "system.hostname" in hostInfo), whereas other code that calls getHostName() directly does update when the hostname changes.
In cases where the hostname has been misconfigured when the mongod/mongos was launched, and has subsequently been updated, the mongod/mongos process must be restarted. It would be useful and less disruptive to have a "flushHostnameCache" command that would reset the _hostNameCached string back to being empty.
This is similar to SERVER-7191, but not quite the same.
|