[SERVER-30394] ftdc file_manager generates an incorrect absolute diagnostic data path for mongos if the logpath is a relative path Created: 28/Jul/17  Updated: 30/Oct/23  Resolved: 07/Aug/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.5.11
Fix Version/s: 3.5.12

Type: Bug Priority: Major - P3
Reporter: James O'Leary Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Configure a mongos with the following conf file excerpt or commmand line parameter '--logpath 12345/mongos.log' and the mongos from say '/tmp/mongos.ftdc':

$> mkdir -p /tmp/mongos.ftdc/12345
$> cd /tmp/mongos.ftdc
$> mongos -f mongo.conf
# OR 
$> mongos  --logpath 12345/mongos.log ... # the rest of the params

Check '/tmp/mongos.ftdc/12345/mongos.log':

$ egrep '12345' /tmp/mongos.ftdc/12345/mongos.log                
2017-07-28T13:19:34.107+0100 I CONTROL  [mongosMain] options: { config: "/tmp/mongos.yml", net: { bindIp: "0.0.0.0", port: 27067 }, processManagement: { fork: true }, setParameter: { enableTestCommands: "1" }, sharding: { configDB: "configRepl/fugly:27019" }, systemLog: { destination: "file", path: "12345/mongos.log" } }
2017-07-28T13:19:36.111+0100 I FTDC     [mongosMain] Initializing full-time diagnostic data capture with directory '12345/mongos.diagnostic.data'
2017-07-28T13:19:37.000+0100 W FTDC     [ftdc] Uncaught exception in 'NonExistentPath: '/12345/mongos.diagnostic.data' could not be created: Permission denied' in full-time diagnostic data capture subsystem. Shutting down the full-time diagnostic data capture subsystem.

Conf file:

systemLog:
  destination: file
  path: 12345/mongos.log

Sprint: Platforms 2017-08-21
Participants:

 Description   

Both --logpath and systemLog.path can accept relative paths and correctly converts them based on the CWD.

However, when a relative path is passed to FTDCFileManager::create, it is incorrectly converted to an absolute path off the root file system.

While using relative paths for configuration parameters is probably not the expected use case, the ftdc code should work in the same fashion as logging.



 Comments   
Comment by Githook User [ 07/Aug/17 ]

Author:

{'username': 'markbenvenuto', 'email': 'mark.benvenuto@mongodb.com', 'name': 'Mark Benvenuto'}

Message: SERVER-30394 ftdc file_manager generates an incorrect absolute diagnostic data path for mongos if the logpath is a relative path
Branch: master
https://github.com/mongodb/mongo/commit/b5ffaeae9c8f7a9e385c61475700c60eddd88e3c

Generated at Thu Feb 08 04:23:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.