Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14893

Command to flush system hostname cache

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: