[SERVER-16923] Profiler collection not created when using --profile Created: 17/Jan/15  Updated: 23/Jan/15  Resolved: 20/Jan/15

Status: Closed
Project: Core Server
Component/s: Diagnostics, Storage
Affects Version/s: 2.8.0-rc5
Fix Version/s: 3.0.0-rc6

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

var conn = MongoRunner.runMongod({profile: 2});
var t = conn.getDB('test').foo;
 
// this insert should trigger the creation of the profiler collection
t.insert({});
 
var colls = t.getDB().getCollectionNames();
assert.contains('system.profile', colls, tojson(colls));
 
MongoRunner.stopMongod(conn);

Participants:

 Description   

Starting with commit 02a78a7f3 (from SERVER-16431), a system.profile collection is no longer created when using --profile. The collection is still created when enabling the profiler via runCommand, however:

// Using `./mongod --profile=2`
//
> db.runCommand({profile: 2});
{ "was" : 2, "slowms" : 100, "ok" : 1 }
> db.getCollectionNames();
[ "system.indexes" ]
> db.foo.insert({});
WriteResult({ "nInserted" : 1 })
> db.getCollectionNames();
[ "foo", "system.indexes" ]
 
 
// Using `./mongod`
//
> db.runCommand({profile: 2});
{ "was" : 0, "slowms" : 100, "ok" : 1 }
> db.getCollectionNames();
[ "system.indexes", "system.profile" ]
> db.foo.insert({});
WriteResult({ "nInserted" : 1 })
> db.getCollectionNames();
[ "foo", "system.indexes", "system.profile" ]



 Comments   
Comment by Githook User [ 20/Jan/15 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-16923 Create the system.profile collection if under DB X lock
Branch: master
https://github.com/mongodb/mongo/commit/403a992daa205f2b43469ef45b5008d817a38fb6

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