-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
-
Server Programmability
-
Service Arch 2022-12-26, Service Arch 2023-01-09, Service Arch 2023-01-23, Service Arch 2023-02-06
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.
- is related to
-
SERVER-59826 Provide a way to override hostname in mongos
- Backlog
- related to
-
SERVER-7191 Add a method/solution for viewing and/or flushing the cache of all known self-hostnames
- Closed