[SERVER-14893] Command to flush system hostname cache Created: 14/Aug/14  Updated: 16/Feb/23

Status: Backlog
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Kevin Pulo Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-7191 Add a method/solution for viewing and... Closed
is related to SERVER-59826 Provide a way to override hostname in... Backlog
Assigned Teams:
Service Arch
Sprint: Service Arch 2022-12-26, Service Arch 2023-01-09, Service Arch 2023-01-23, Service Arch 2023-02-06
Participants:

 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.


Generated at Thu Feb 08 03:36:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.