[SERVER-24387] FTDC invokes the 'collStats' command with the database parameter set as the collection name Created: 03/Jun/16  Updated: 14/Jul/16  Resolved: 24/Jun/16

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 3.2.6, 3.3.6
Fix Version/s: 3.3.9

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Mark Benvenuto
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-24389 Fix or remove Command::parseNs() Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 16 (06/24/16)
Participants:

 Description   

The FTDCSimpleInternalCommandCollector for collStats is initialized with the namespace set to the complete oplog collection namespace and then this value is passed in to the command invocation as a database name.

This only works because we blindly concatenate dbname with the value of the first field in the command (which would be empty in this case), but it breaks once we tighten the namespace parsing.



 Comments   
Comment by Githook User [ 24/Jun/16 ]

Author:

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

Message: SERVER-24387 FTDC invokes the 'collStats' command with the database parameter set as the collection name
Branch: master
https://github.com/mongodb/mongo/commit/99fc03c71564643aba2223d3709e138959d2d4cf

Comment by Kaloian Manassiev [ 03/Jun/16 ]

The way I was thinking, it would be best to change FTDCSimpleInternalCommandCollector to be initialized with three values: collectorName, dbName and a BSON object, which represents the command which should be invoked. That way, these values can be directly passed to the run method of the command.

collStats for example would become:

controller->addPeriodicCollector(stdx::make_unique<FTDCSimpleInternalCommandCollector>(
            "local.oplog.rs.stats", "local", BSON("collStats" << "oplog.rs")));

Does this make sense?

PS: As a side note, the param argument is not used anywhere, so this for example has no effect.

Comment by Mark Benvenuto [ 03/Jun/16 ]

How should collStats be called? I happy to change it if you can tell what to change it to.

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