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

Command to flush system hostname cache

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Internal Code
    • None
    • Service Arch
    • Service Arch 2022-12-26, Service Arch 2023-01-09, Service Arch 2023-01-23, Service Arch 2023-02-06

    Description

      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.

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: